Skip to content

Commit

Permalink
update sig deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacholme7 committed Jan 13, 2025
1 parent 8cc0f76 commit 951ecb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion anchor/eth/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ pub fn verify_signature(
let hash = keccak256(data);

// Deserialize the signature
let signature = Signature::deserialize(&signature).expect("Failed to deserialize signature");
let signature = match Signature::deserialize(&signature) {
Ok(sig) => sig,
Err(_) => return false,
};

// Verify the signature against the message
signature.verify(public_key, hash)
Expand Down

0 comments on commit 951ecb3

Please sign in to comment.