Skip to content

Commit

Permalink
Use Ed25519 verify_strict function rather than just verify, fix #857
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jul 5, 2023
1 parent 8b423d0 commit 738849f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions soroban-env-host/src/host/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ impl Host {
public_key: &ed25519_dalek::PublicKey,
sig: &ed25519_dalek::Signature,
) -> Result<(), HostError> {
use ed25519_dalek::Verifier;
self.charge_budget(
ContractCostType::VerifyEd25519Sig,
Some(payload.len() as u64),
)?;
public_key.verify(payload, sig).map_err(|_| {
public_key.verify_strict(payload, sig).map_err(|_| {
self.err(
ScErrorType::Crypto,
ScErrorCode::InvalidInput,
Expand Down

0 comments on commit 738849f

Please sign in to comment.