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

Unified Diff: net/cert/cert_verify_proc_openssl.cc

Issue 2400033005: Use BoringSSL scopers in //net. (Closed)
Patch Set: eroman comments Created 4 years, 2 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/cert/cert_verify_proc_ios.cc ('k') | net/cert/ct_log_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc_openssl.cc
diff --git a/net/cert/cert_verify_proc_openssl.cc b/net/cert/cert_verify_proc_openssl.cc
index 824a95cdc454287ec81bddf5698e990a92a98f5e..ab7daf04f676adcc6069f81e82ebb1d8e70e893a 100644
--- a/net/cert/cert_verify_proc_openssl.cc
+++ b/net/cert/cert_verify_proc_openssl.cc
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/sha1.h"
#include "crypto/openssl_util.h"
-#include "crypto/scoped_openssl_types.h"
#include "crypto/sha2.h"
#include "net/base/net_errors.h"
#include "net/cert/asn1_util.h"
@@ -90,11 +89,9 @@ CertStatus MapCertErrorToCertStatus(int err) {
}
}
-// sk_X509_free is a function-style macro, so can't be used as a template
-// param directly.
-void sk_X509_free_fn(STACK_OF(X509)* st) {
- sk_X509_free(st);
-}
+struct ShallowX509StackDeleter {
+ void operator()(STACK_OF(X509) * st) const { sk_X509_free(st); }
+};
void GetCertChainInfo(X509_STORE_CTX* store_ctx,
CertVerifyResult* verify_result) {
@@ -211,10 +208,9 @@ int CertVerifyProcOpenSSL::VerifyInternal(
verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID;
}
- crypto::ScopedOpenSSL<X509_STORE_CTX, X509_STORE_CTX_free> ctx(
- X509_STORE_CTX_new());
+ bssl::UniquePtr<X509_STORE_CTX> ctx(X509_STORE_CTX_new());
- crypto::ScopedOpenSSL<STACK_OF(X509), sk_X509_free_fn> intermediates(
+ std::unique_ptr<STACK_OF(X509), ShallowX509StackDeleter> intermediates(
sk_X509_new_null());
if (!intermediates.get())
return ERR_OUT_OF_MEMORY;
« no previous file with comments | « net/cert/cert_verify_proc_ios.cc ('k') | net/cert/ct_log_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698