summaryrefslogtreecommitdiff
path: root/chromium/net/cert/cert_verify_proc_openssl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/cert/cert_verify_proc_openssl.cc')
-rw-r--r--chromium/net/cert/cert_verify_proc_openssl.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/chromium/net/cert/cert_verify_proc_openssl.cc b/chromium/net/cert/cert_verify_proc_openssl.cc
index 824a95cdc45..988bdec1e2e 100644
--- a/chromium/net/cert/cert_verify_proc_openssl.cc
+++ b/chromium/net/cert/cert_verify_proc_openssl.cc
@@ -4,15 +4,12 @@
#include "net/cert/cert_verify_proc_openssl.h"
-#include <openssl/x509v3.h>
-
#include <string>
#include <vector>
#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"
@@ -21,6 +18,7 @@
#include "net/cert/cert_verify_result.h"
#include "net/cert/test_root_certs.h"
#include "net/cert/x509_certificate.h"
+#include "third_party/boringssl/src/include/openssl/x509v3.h"
namespace net {
@@ -90,11 +88,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 +207,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;