Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let ECDSA_verify return -1 for ASN1 parsing fail #1935

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto/fipsmodule/ecdsa/ecdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int ECDSA_sign(int type, const uint8_t *digest, size_t digest_len, uint8_t *sig,
int ECDSA_verify(int type, const uint8_t *digest, size_t digest_len,
const uint8_t *sig, size_t sig_len, const EC_KEY *eckey) {
ECDSA_SIG *s;
int ret = 0;
int ret = -1;
uint8_t *der = NULL;

// Decode the ECDSA signature.
Expand Down
4 changes: 2 additions & 2 deletions include/openssl/ecdsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ OPENSSL_EXPORT int ECDSA_sign(int type, const uint8_t *digest,

// ECDSA_verify verifies that |sig_len| bytes from |sig| constitute a valid
// signature by |key| of |digest|. (The |type| argument should be zero.) It
// returns one on success or zero if the signature is invalid or an error
// occurred.
// returns one on success or zero if the signature is invalid. It returns -1
// if any other error has occurred such as invalid ASN1 input.
//
// WARNING: |digest| must be the output of some hash function on the data to be
// verified. Passing unhashed inputs will not result in a secure signature
Expand Down
Loading