Skip to content

Commit

Permalink
Fix for crate consumers not finding Signature trait methods (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
itowlson committed Jan 31, 2022
1 parent 053cb8a commit d46c371
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/invoice/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl KeyEntry {
}
Some(txt) => {
let decoded_txt = base64::decode(txt)?;
let sig = EdSignature::from_bytes(decoded_txt.as_slice())?;
let sig = EdSignature::try_from(decoded_txt.as_slice())?;
key.verify_strict(self.label.as_bytes(), &sig)?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/invoice/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl VerificationStrategy {

let pubkey =
PublicKey::from_bytes(&pk).map_err(|_| SignatureError::CorruptKey(sig.key.clone()))?;
let ed_sig = EdSignature::from_bytes(sig_block.as_slice())
let ed_sig = EdSignature::try_from(sig_block.as_slice())
.map_err(|_| SignatureError::CorruptSignature(sig.key.clone()))?;
pubkey
.verify_strict(cleartext, &ed_sig)
Expand Down

0 comments on commit d46c371

Please sign in to comment.