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

Unified Diff: net/cert/x509_certificate_openssl.cc

Issue 361193003: Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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/ct_log_verifier_openssl.cc ('k') | net/cert/x509_util_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_openssl.cc
diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc
index 71d558ddc84b296d4490639c988488ae8af4ab45..005423baf826523bbd4819f671be99eaa596d02a 100644
--- a/net/cert/x509_certificate_openssl.cc
+++ b/net/cert/x509_certificate_openssl.cc
@@ -19,6 +19,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "crypto/openssl_util.h"
+#include "crypto/scoped_openssl_types.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/cert/x509_util_openssl.h"
@@ -32,12 +33,15 @@ namespace net {
namespace {
+typedef crypto::ScopedOpenSSL<GENERAL_NAMES, GENERAL_NAMES_free>::Type
+ ScopedGENERAL_NAMES;
+
void CreateOSCertHandlesFromPKCS7Bytes(
const char* data, int length,
X509Certificate::OSCertHandles* handles) {
crypto::EnsureOpenSSLInit();
const unsigned char* der_data = reinterpret_cast<const unsigned char*>(data);
- crypto::ScopedOpenSSL<PKCS7, PKCS7_free> pkcs7_cert(
+ crypto::ScopedOpenSSL<PKCS7, PKCS7_free>::Type pkcs7_cert(
d2i_PKCS7(NULL, &der_data, length));
if (!pkcs7_cert.get())
return;
@@ -105,7 +109,7 @@ void ParseSubjectAltName(X509Certificate::OSCertHandle cert,
if (!alt_name_ext)
return;
- crypto::ScopedOpenSSL<GENERAL_NAMES, GENERAL_NAMES_free> alt_names(
+ ScopedGENERAL_NAMES alt_names(
reinterpret_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(alt_name_ext)));
if (!alt_names.get())
return;
@@ -182,7 +186,7 @@ class X509InitSingleton {
}
int der_cache_ex_index_;
- crypto::ScopedOpenSSL<X509_STORE, X509_STORE_free> store_;
+ crypto::ScopedOpenSSL<X509_STORE, X509_STORE_free>::Type store_;
DISALLOW_COPY_AND_ASSIGN(X509InitSingleton);
};
@@ -437,8 +441,7 @@ void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle,
*type = kPublicKeyTypeUnknown;
*size_bits = 0;
- crypto::ScopedOpenSSL<EVP_PKEY, EVP_PKEY_free> scoped_key(
- X509_get_pubkey(cert_handle));
+ crypto::ScopedEVP_PKEY scoped_key(X509_get_pubkey(cert_handle));
if (!scoped_key.get())
return;
@@ -472,7 +475,7 @@ bool X509Certificate::IsIssuedByEncoded(
// Convert to a temporary list of X509_NAME objects.
// It will own the objects it points to.
- crypto::ScopedOpenSSL<STACK_OF(X509_NAME), sk_X509_NAME_free_all>
+ crypto::ScopedOpenSSL<STACK_OF(X509_NAME), sk_X509_NAME_free_all>::Type
issuer_names(sk_X509_NAME_new_null());
if (!issuer_names.get())
return false;
« no previous file with comments | « net/cert/ct_log_verifier_openssl.cc ('k') | net/cert/x509_util_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698