Skip to content

Commit

Permalink
avoid panic in eddsa verify
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Jul 9, 2021
1 parent 86c0124 commit 0601cf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions evercrypt-rs/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ pub fn verify(
) -> Result<bool, Error> {
match mode {
Mode::Ed25519 => {
if signature.len() != 64 {
return Err(Error::InvalidSignature);
}
if pk.len() != 32 {
return Err(Error::InvalidPoint);
}
let mut key = [0u8; 32];
key.clone_from_slice(pk);
let mut sig = [0u8; 64];
Expand Down

0 comments on commit 0601cf0

Please sign in to comment.