Skip to content

Commit

Permalink
Return error rather than panic
Browse files Browse the repository at this point in the history
  • Loading branch information
facutuesca committed Feb 26, 2024
1 parent fcf08f8 commit 0b9fd57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rust/src/backend/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ impl ECPrivateKey {
}
} else {
let _ = algo;
assert!(!deterministic);
return Err(CryptographyError::from(

This comment has been minimized.

Copy link
@alex

alex Feb 26, 2024

Member

This isn't correct -- it now returns an error unconditionally on deterministic.

My recommendation would be to just have it ignore deterministic entirely here.

This comment has been minimized.

Copy link
@facutuesca

facutuesca Feb 26, 2024

Author Contributor

🤦 yes, you're correct, sorry about that. I removed the return Err statement.

exceptions::UnsupportedAlgorithm::new_err((
"ECDSA with deterministic signature (RFC 6979) is not supported by this version of OpenSSL.",
exceptions::Reasons::UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
)),
));
}
}

Expand Down

0 comments on commit 0b9fd57

Please sign in to comment.