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

Unified Diff: net/cert/ct_log_verifier_openssl.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.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 | « net/cert/ct_known_logs_static.h ('k') | net/cert/ct_log_verifier_unittest.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 884ae8a4a402774832b02d0ee41523544af9b9a1..55bc3e123aaf71dc54b80e047a8aca56d4d69f1b 100644
--- a/net/cert/ct_log_verifier_openssl.cc
+++ b/net/cert/ct_log_verifier_openssl.cc
@@ -56,13 +56,10 @@ bool CTLogVerifier::Init(const base::StringPiece& public_key,
const base::StringPiece& description) {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- crypto::ScopedBIO bio(
- BIO_new_mem_buf(const_cast<char*>(public_key.data()), public_key.size()));
- if (!bio.get())
- return false;
-
- public_key_ = d2i_PUBKEY_bio(bio.get(), NULL);
- if (!public_key_)
+ 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)
return false;
key_id_ = crypto::SHA256HashString(public_key);
« no previous file with comments | « net/cert/ct_known_logs_static.h ('k') | net/cert/ct_log_verifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698