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

Unified Diff: net/base/x509_certificate_nss.cc

Issue 2944008: Refactor X509Certificate caching to cache the OS handle, rather than the X509Certificate (Closed)
Patch Set: Rebase to trunk after splitting out 4645001 Created 9 years, 11 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
Index: net/base/x509_certificate_nss.cc
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc
index 6a6f534f8002c5ca0a5a2d5e3b611769f5368ab6..3f972bc10a5857e1e0099e37f42d614004f1e978 100644
--- a/net/base/x509_certificate_nss.cc
+++ b/net/base/x509_certificate_nss.cc
@@ -692,8 +692,7 @@ X509Certificate* X509Certificate::CreateSelfSigned(
// Save the signed result to the cert.
cert->derCert = *result;
- X509Certificate* x509_cert =
- CreateFromHandle(cert, SOURCE_LONE_CERT_IMPORT, OSCertHandles());
+ X509Certificate* x509_cert = CreateFromHandle(cert, OSCertHandles());
CERT_DestroyCertificate(cert);
return x509_cert;
}
@@ -708,6 +707,11 @@ void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const {
dns_names->push_back(subject_.common_name);
}
+X509Certificate::OSCertListHandle
+X509Certificate::CreateOSCertListHandle() const {
+ return CERT_DupCertificate(cert_handle_);
+}
+
int X509Certificate::Verify(const std::string& hostname,
int flags,
CertVerifyResult* verify_result) const {
@@ -902,6 +906,11 @@ void X509Certificate::FreeOSCertHandle(OSCertHandle cert_handle) {
}
// static
+void X509Certificate::FreeOSCertListHandle(OSCertListHandle cert_list) {
+ CERT_DestroyCertificate(cert_list);
+}
+
+// static
SHA1Fingerprint X509Certificate::CalculateFingerprint(
OSCertHandle cert) {
SHA1Fingerprint sha1;

Powered by Google App Engine
This is Rietveld 408576698