]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Wrap long onion_message fuzz strings
authorJeffrey Czyz <jkczyz@gmail.com>
Wed, 25 Oct 2023 21:37:26 +0000 (16:37 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 25 Oct 2023 23:12:44 +0000 (18:12 -0500)
Some editors like vim slow to a crawl when scrolling over long strings
when syntax highlighting is turned on. Limit the length in fuzz strings
to avoid this.

fuzz/src/onion_message.rs

index fcc8dc3cad2a8d60c36ac836acd63254e7814ff2..9cc3e04a637b4ea4960df59e76870155512c4161 100644 (file)
@@ -211,7 +211,40 @@ mod tests {
 
        #[test]
        fn test_no_onion_message_breakage() {
-               let two_unblinded_hops_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d000000000000000000000000000000eb0000000000000000000000000000000000000000000000000000000000000036041096000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
+               let two_unblinded_hops_om = "\
+                       020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
+                       000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
+                       02020202020202020202020202020202020202026d000000000000000000000000000000eb0000000000000\
+                       000000000000000000000000000000000000000000000000036041096000000000000000000000000000000\
+                       fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
+                       000000000000000000";
                let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
                super::do_test(&::hex::decode(two_unblinded_hops_om).unwrap(), &logger);
                {
@@ -219,7 +252,40 @@ mod tests {
                        assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), "Forwarding an onion message to peer 020202020202020202020202020202020202020202020202020202020202020202".to_string())), Some(&1));
                }
 
-               let two_unblinded_two_blinded_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d0000000000000000000000000000009e0000000000000000000000000000000000000000000000000000000000000058045604210203030303030303030303030303030303030303030303030303030303030303020821020000000000000000000000000000000000000000000000000000000000000e0196000000000000000000000000000000e9000000000000000000000000000000000000000000000000000000000000003504330421020404040404040404040404040404040404040404040404040404040404040402ca00000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000003604103f000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
+               let two_unblinded_two_blinded_om = "\
+                       020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
+                       000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
+                       02020202020202020202020202020202020202026d0000000000000000000000000000009e0000000000000\
+                       000000000000000000000000000000000000000000000000058045604210203030303030303030303030303\
+                       030303030303030303030303030303030303020821020000000000000000000000000000000000000000000\
+                       000000000000000000e0196000000000000000000000000000000e900000000000000000000000000000000\
+                       000000000000000000000000000000350433042102040404040404040404040404040404040404040404040\
+                       4040404040404040402ca000000000000000000000000000000420000000000000000000000000000000000\
+                       00000000000000000000000000003604103f000000000000000000000000000000fd1092202a2a2a2a2a2a2\
+                       a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
+                       000000000000000000";
                let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
                super::do_test(&::hex::decode(two_unblinded_two_blinded_om).unwrap(), &logger);
                {
@@ -227,7 +293,40 @@ mod tests {
                        assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), "Forwarding an onion message to peer 020202020202020202020202020202020202020202020202020202020202020202".to_string())), Some(&1));
                }
 
-               let three_blinded_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d000000000000000000000000000000b20000000000000000000000000000000000000000000000000000000000000035043304210203030303030303030303030303030303030303030303030303030303030303029600000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000003604104e000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
+               let three_blinded_om = "\
+                       020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
+                       000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
+                       02020202020202020202020202020202020202026d000000000000000000000000000000b20000000000000\
+                       000000000000000000000000000000000000000000000000035043304210203030303030303030303030303\
+                       030303030303030303030303030303030303029600000000000000000000000000000033000000000000000\
+                       000000000000000000000000000000000000000000000003604104e000000000000000000000000000000fd\
+                       1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a00000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+                       000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
+                       000000000000000000";
                let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
                super::do_test(&::hex::decode(three_blinded_om).unwrap(), &logger);
                {