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

Unified Diff: net/cert/ct_log_verifier_openssl.cc

Issue 1742873002: Switch //net to the new SPKI and PKCS#8 APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spki-crypto
Patch Set: tweak keygen_handler_openssl.cc 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 | « net/base/openssl_private_key_store_android.cc ('k') | net/cert/internal/verify_signed_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_log_verifier_openssl.cc
diff --git a/net/cert/ct_log_verifier_openssl.cc b/net/cert/ct_log_verifier_openssl.cc
index 5fe41fd7769bc5ddd9b556baa28d399fe4cd8f38..88f9027cd038521c544af62428f59bbff3a32def 100644
--- a/net/cert/ct_log_verifier_openssl.cc
+++ b/net/cert/ct_log_verifier_openssl.cc
@@ -4,8 +4,8 @@
#include "net/cert/ct_log_verifier.h"
+#include <openssl/bytestring.h>
#include <openssl/evp.h>
-#include <openssl/x509.h>
#include "base/logging.h"
#include "crypto/openssl_util.h"
@@ -50,10 +50,11 @@ CTLogVerifier::~CTLogVerifier() {
bool CTLogVerifier::Init(const base::StringPiece& public_key) {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- const uint8_t* ptr = reinterpret_cast<const uint8_t*>(public_key.data());
- const uint8_t* end = ptr + public_key.size();
- public_key_ = d2i_PUBKEY(nullptr, &ptr, public_key.size());
- if (!public_key_ || ptr != end)
+ CBS cbs;
+ CBS_init(&cbs, reinterpret_cast<const uint8_t*>(public_key.data()),
+ public_key.size());
+ public_key_ = EVP_parse_public_key(&cbs);
+ if (!public_key_ || CBS_len(&cbs) != 0)
return false;
key_id_ = crypto::SHA256HashString(public_key);
« no previous file with comments | « net/base/openssl_private_key_store_android.cc ('k') | net/cert/internal/verify_signed_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698