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

Unified Diff: crypto/signature_verifier_openssl.cc

Issue 401153002: Switch to BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase across DEPS change Created 6 years, 5 months 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 | « crypto/scoped_openssl_types.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/signature_verifier_openssl.cc
diff --git a/crypto/signature_verifier_openssl.cc b/crypto/signature_verifier_openssl.cc
index 155a2cf3ef72a21cbcbb3b3f8efe9e16bc2cf641..a855120ef83bd233cae7b7e4be1d1ba2fce3627b 100644
--- a/crypto/signature_verifier_openssl.cc
+++ b/crypto/signature_verifier_openssl.cc
@@ -26,7 +26,7 @@ const EVP_MD* ToOpenSSLDigest(SignatureVerifier::HashAlgorithm hash_alg) {
case SignatureVerifier::SHA256:
return EVP_sha256();
}
- return EVP_md_null();
+ return NULL;
}
} // namespace
@@ -80,8 +80,11 @@ bool SignatureVerifier::VerifyInitRSAPSS(HashAlgorithm hash_alg,
const uint8* public_key_info,
int public_key_info_len) {
OpenSSLErrStackTracer err_tracer(FROM_HERE);
- const EVP_MD* digest = ToOpenSSLDigest(hash_alg);
+ const EVP_MD* const digest = ToOpenSSLDigest(hash_alg);
DCHECK(digest);
+ if (!digest) {
+ return false;
+ }
EVP_PKEY_CTX* pkey_ctx;
if (!CommonInit(digest, signature, signature_len, public_key_info,
@@ -92,8 +95,12 @@ bool SignatureVerifier::VerifyInitRSAPSS(HashAlgorithm hash_alg,
int rv = EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING);
if (rv != 1)
return false;
- rv = EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx,
- ToOpenSSLDigest(mask_hash_alg));
+ const EVP_MD* const mgf_digest = ToOpenSSLDigest(mask_hash_alg);
+ DCHECK(mgf_digest);
+ if (!mgf_digest) {
+ return false;
+ }
+ rv = EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, mgf_digest);
if (rv != 1)
return false;
rv = EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, salt_len);
« no previous file with comments | « crypto/scoped_openssl_types.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698