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

Unified Diff: net/base/x509_certificate_mac.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_mac.cc
diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc
index 033ddbf4a6ce64f5c51b7d470512412496dfc654..4bb9adf66b58371d8d2d1b94b5a2a2a8163142cc 100644
--- a/net/base/x509_certificate_mac.cc
+++ b/net/base/x509_certificate_mac.cc
@@ -634,17 +634,6 @@ bool X509Certificate::IsIssuedByKnownRoot(CFArrayRef chain) {
}
// 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,
@@ -784,17 +773,6 @@ X509Certificate* X509Certificate::CreateSelfSigned(
X509Certificate::OSCertHandles());
}
-void X509Certificate::Persist(Pickle* pickle) {
- CSSM_DATA cert_data;
- OSStatus status = SecCertificateGetData(cert_handle_, &cert_data);
- if (status) {
- NOTREACHED();
- return;
- }
-
- pickle->WriteData(reinterpret_cast<char*>(cert_data.Data), cert_data.Length);
-}
-
void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const {
dns_names->clear();
@@ -1340,4 +1318,28 @@ CFArrayRef X509Certificate::CreateClientCertificateChain() const {
return chain.release();
}
+// 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) {
+ CSSM_DATA cert_data;
+ OSStatus status = SecCertificateGetData(cert_handle, &cert_data);
+ if (status)
+ return false;
+
+ return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data),
+ cert_data.Length);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698