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

Unified Diff: net/base/x509_certificate_openssl.cc

Issue 4645001: Change the HTTP cache to cache the entire certificate chain for SSL sites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/net/base
Patch Set: Rebase before commit Created 9 years, 8 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_openssl.cc
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc
index 52d9d4edecfd3401ab1c9f231098c975c4c47206..10ce266ce0861ed9d3055bc947ac3379a2e3bf78 100644
--- a/net/base/x509_certificate_openssl.cc
+++ b/net/base/x509_certificate_openssl.cc
@@ -385,17 +385,6 @@ X509Certificate::OSCertHandles X509Certificate::CreateOSCertHandlesFromBytes(
}
// static
-X509Certificate* X509Certificate::CreateFromPickle(const Pickle& pickle,
- void** pickle_iter) {
- const char* data;
- int length;
- if (!pickle.ReadData(pickle_iter, &data, &length))
- return NULL;
-
- return CreateFromBytes(data, length);
-}
-
-// static
X509Certificate* X509Certificate::CreateSelfSigned(
crypto::RSAPrivateKey* key,
const std::string& subject,
@@ -405,15 +394,6 @@ X509Certificate* X509Certificate::CreateSelfSigned(
return NULL;
}
-void X509Certificate::Persist(Pickle* pickle) {
- DERCache der_cache;
- if (!GetDERAndCacheIfNeeded(cert_handle_, &der_cache))
- return;
-
- pickle->WriteData(reinterpret_cast<const char*>(der_cache.data),
- der_cache.data_length);
-}
-
void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const {
dns_names->clear();
@@ -533,4 +513,28 @@ bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0;
}
+// static
+X509Certificate::OSCertHandle
+X509Certificate::ReadCertHandleFromPickle(const Pickle& pickle,
+ void** pickle_iter) {
+ const char* data;
+ int length;
+ if (!pickle.ReadData(pickle_iter, &data, &length))
+ return NULL;
+
+ return CreateOSCertHandleFromBytes(data, length);
+}
+
+// static
+bool X509Certificate::WriteCertHandleToPickle(OSCertHandle cert_handle,
+ Pickle* pickle) {
+ DERCache der_cache;
+ if (!GetDERAndCacheIfNeeded(cert_handle, &der_cache))
+ return false;
+
+ return pickle->WriteData(
+ reinterpret_cast<const char*>(der_cache.data),
+ der_cache.data_length);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698