Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: content/child/webcrypto/openssl/rsa_sign_openssl.cc

Issue 688983004: WebCrypto: Don't check for negative values from EVP_DigestVerifyFinal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/openssl/rsa_sign_openssl.cc
diff --git a/content/child/webcrypto/openssl/rsa_sign_openssl.cc b/content/child/webcrypto/openssl/rsa_sign_openssl.cc
index 1410aabb25ba1c9bcbf78c5b678710130f639c98..ea6386e6765bbac585ee87ac21f667b1e68cc95b 100644
--- a/content/child/webcrypto/openssl/rsa_sign_openssl.cc
+++ b/content/child/webcrypto/openssl/rsa_sign_openssl.cc
@@ -140,14 +140,9 @@ Status RsaVerify(const blink::WebCryptoKey& key,
if (!EVP_DigestVerifyUpdate(ctx.get(), data.bytes(), data.byte_length()))
return Status::OperationError();
- // Note that the return value can be:
- // 1 --> Success
- // 0 --> Verification failed
- // <0 --> Operation error
- int rv = EVP_DigestVerifyFinal(
- ctx.get(), signature.bytes(), signature.byte_length());
- *signature_match = rv == 1;
- return rv >= 0 ? Status::Success() : Status::OperationError();
+ *signature_match = 1 == EVP_DigestVerifyFinal(ctx.get(), signature.bytes(),
+ signature.byte_length());
+ return Status::Success();
}
} // namespace webcrypto
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698