You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (ECDSA_do_verify(digest, SHA256_DIGEST_LENGTH, ecdsa_sig_, eck_) == 0) {
Here you are regarding a signature as invalid if ECDSA_do_verify returns 0, and valid otherwise. However it can also return -1 to indicate failure and your code would incorrectly interpret this as having passed verification.
The OpenSSL documentation states:
ECDSA_verify() and ECDSA_do_verify() return 1 for a valid signature, 0 for an invalid signature and -1 on error.
Proof of concept where ECDSA_do_verify returns not 0 but -1 for an invalid signature:
A specific (unhashed) message is passed to the verification function. It might be possible to craft an r, s such that EC_KEY_set_public_key will return -1 for any given (hashed) message. If that is the case, this breaks the entire security of this scheme. Whether that is the case depends on how ECC is implemented in OpenSSL, and this may vary from one version to the next.
This was tested using the current OpenSSL master branch on x64 Linux.
The text was updated successfully, but these errors were encountered:
esp/src/api_manager/auth/lib/auth_jwt_validator.cc
Line 738 in 1a01fe7
Here you are regarding a signature as invalid if
ECDSA_do_verify
returns 0, and valid otherwise. However it can also return -1 to indicate failure and your code would incorrectly interpret this as having passed verification.The OpenSSL documentation states:
Proof of concept where
ECDSA_do_verify
returns not 0 but -1 for an invalid signature:A specific (unhashed) message is passed to the verification function. It might be possible to craft an
r, s
such thatEC_KEY_set_public_key
will return -1 for any given (hashed) message. If that is the case, this breaks the entire security of this scheme. Whether that is the case depends on how ECC is implemented in OpenSSL, and this may vary from one version to the next.This was tested using the current OpenSSL
master
branch on x64 Linux.The text was updated successfully, but these errors were encountered: