projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use `impl<bounds>` instead of a `where` clause to help bindings
[rust-lightning]
/
lightning
/
src
/
util
/
message_signing.rs
diff --git
a/lightning/src/util/message_signing.rs
b/lightning/src/util/message_signing.rs
index 2055b4087749ada5b3baef731770608baceb629e..8beff835a4bffe1f0b3d59e672380323b6164f98 100644
(file)
--- a/
lightning/src/util/message_signing.rs
+++ b/
lightning/src/util/message_signing.rs
@@
-36,6
+36,11
@@
fn sigrec_encode(sig_rec: RecoverableSignature) -> Vec<u8> {
}
fn sigrec_decode(sig_rec: Vec<u8>) -> Result<RecoverableSignature, Error> {
}
fn sigrec_decode(sig_rec: Vec<u8>) -> Result<RecoverableSignature, Error> {
+ // Signature must be 64 + 1 bytes long (compact signature + recovery id)
+ if sig_rec.len() != 65 {
+ return Err(Error::InvalidSignature);
+ }
+
let rsig = &sig_rec[1..];
let rid = sig_rec[0] as i32 - 31;
let rsig = &sig_rec[1..];
let rid = sig_rec[0] as i32 - 31;