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

Unified Diff: crypto/signature_verifier_openssl.cc

Issue 1739403002: Cut down on usage of deprecated APIs in //crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grumble grumble string vector char uint8_t grumble Created 4 years, 10 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/rsa_private_key_openssl.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('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 a756149bdc4aa3281a3d7f7fb7b76ef09df6a477..2e64a58e94b8096e56bc207bd9f39c7d6751faa7 100644
--- a/crypto/signature_verifier_openssl.cc
+++ b/crypto/signature_verifier_openssl.cc
@@ -4,6 +4,7 @@
#include "crypto/signature_verifier.h"
+#include <openssl/bytestring.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <stdint.h>
@@ -139,9 +140,10 @@ bool SignatureVerifier::CommonInit(const EVP_MD* digest,
signature_.assign(signature, signature + signature_len);
- const uint8_t* ptr = public_key_info;
- ScopedEVP_PKEY public_key(d2i_PUBKEY(nullptr, &ptr, public_key_info_len));
- if (!public_key.get() || ptr != public_key_info + public_key_info_len)
+ CBS cbs;
+ CBS_init(&cbs, public_key_info, public_key_info_len);
+ ScopedEVP_PKEY public_key(EVP_parse_public_key(&cbs));
+ if (!public_key || CBS_len(&cbs) != 0)
return false;
verify_context_->ctx.reset(EVP_MD_CTX_create());
« no previous file with comments | « crypto/rsa_private_key_openssl.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698