You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, deserialized invoices recomputed their signature hash by
re-encoding the parsed invoice. Non-canonical amount digits could then
be dropped, letting distinct encodings share a hash.
Hash deserialized invoices from the HRP and unsigned data bytes accepted
by the parser so the cached hash remains bound to the encoded invoice.
Reported by Project Loupe.
Co-Authored-By: HAL 9000
let canonical_str = "lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q5sqqqqqqqqqqqqqqqpqsq67gye39hfg3zd8rgc80k32tvy9xk2xunwm5lzexnvpx6fd77en8qaq424dxgt56cag2dpt359k3ssyhetktkpqh24jqnjyw6uqd08sgptq44qu";
1475
+
let parsed = CheckedHrpstring::new::<Bolt11Bech32>(canonical_str).unwrap();
1476
+
let data_fes = parsed.fe32_iter::<&mutdynIterator<Item = u8>>().collect::<Vec<_>>();
1477
+
1478
+
let malleated_hrp = Hrp::parse_unchecked("lnbc025m");
0 commit comments