We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f1d7c6 commit e060304Copy full SHA for e060304
lightning/src/util/message_signing.rs
@@ -36,6 +36,11 @@ fn sigrec_encode(sig_rec: RecoverableSignature) -> Vec<u8> {
36
}
37
38
fn sigrec_decode(sig_rec: Vec<u8>) -> Result<RecoverableSignature, Error> {
39
+ // Signature must be 64 + 1 bytes long (compact signature + recovery id)
40
+ if sig_rec.len() < 65 {
41
+ return Err(Error::InvalidSignature);
42
+ }
43
+
44
let rsig = &sig_rec[1..];
45
let rid = sig_rec[0] as i32 - 31;
46
0 commit comments