diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 19:48:34 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 19:48:34 +0000 |
commit | 3c37a26e1fcdeaacb06f9ba2b516398bffd9ae29 (patch) | |
tree | 83238f97cb4f7930d8f279bc40b2dff0d601e6fb /net/base/x509_certificate_openssl.cc | |
parent | 7f2fff13019ba89274e598f8076911610749909a (diff) | |
download | chromium_src-3c37a26e1fcdeaacb06f9ba2b516398bffd9ae29.zip chromium_src-3c37a26e1fcdeaacb06f9ba2b516398bffd9ae29.tar.gz chromium_src-3c37a26e1fcdeaacb06f9ba2b516398bffd9ae29.tar.bz2 |
Have OpenSSL simply increment the ref-count, rather than copy and reparse the entire certificate
R=wtc
BUG=None
TEST=Build with use_openssl=1, X509Certificate* tests continue to work
Review URL: http://codereview.chromium.org/3677001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/x509_certificate_openssl.cc')
-rw-r--r-- | net/base/x509_certificate_openssl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc index afba382..6969c7d8 100644 --- a/net/base/x509_certificate_openssl.cc +++ b/net/base/x509_certificate_openssl.cc @@ -5,6 +5,7 @@ #include "net/base/x509_certificate.h" #include <openssl/asn1.h> +#include <openssl/crypto.h> #include <openssl/obj_mac.h> #include <openssl/pem.h> #include <openssl/pkcs7.h> @@ -249,7 +250,9 @@ void sk_X509_free_fn(STACK_OF(X509)* st) { // static X509Certificate::OSCertHandle X509Certificate::DupOSCertHandle( OSCertHandle cert_handle) { - return X509_dup(cert_handle); + DCHECK(cert_handle); + CRYPTO_add(&cert_handle->references, 1, CRYPTO_LOCK_X509); + return cert_handle; } // static |