summaryrefslogtreecommitdiffstats
path: root/net/base/x509_certificate_mac.cc
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 14:33:11 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 14:33:11 +0000
commit1e5fead8aa598e7d834806f6f8eaef8302074f35 (patch)
tree27d865f1cbc3f810fd0ea0038228057e2dafd814 /net/base/x509_certificate_mac.cc
parent2db58053f8e04deaf129724bdf8ec0b326fb65ac (diff)
downloadchromium_src-1e5fead8aa598e7d834806f6f8eaef8302074f35.zip
chromium_src-1e5fead8aa598e7d834806f6f8eaef8302074f35.tar.gz
chromium_src-1e5fead8aa598e7d834806f6f8eaef8302074f35.tar.bz2
Adds X509 certificates for OpenSSL.
Depends on http://codereview.chromium.org/3565006/show TEST=Existing *X509* tests should pass. Review URL: http://codereview.chromium.org/3529008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/x509_certificate_mac.cc')
-rw-r--r--net/base/x509_certificate_mac.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc
index e4c5c7f..cd8a3ca 100644
--- a/net/base/x509_certificate_mac.cc
+++ b/net/base/x509_certificate_mac.cc
@@ -728,6 +728,21 @@ bool X509Certificate::VerifyEV() const {
}
// static
+bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
+ X509Certificate::OSCertHandle b) {
+ DCHECK(a && b);
+ if (a == b)
+ return true;
+ if (CFEqual(a, b))
+ return true;
+ CSSM_DATA a_data, b_data;
+ return SecCertificateGetData(a, &a_data) == noErr &&
+ SecCertificateGetData(b, &b_data) == noErr &&
+ a_data.Length == b_data.Length &&
+ memcmp(a_data.Data, b_data.Data, a_data.Length) == 0;
+}
+
+// static
X509Certificate::OSCertHandle X509Certificate::CreateOSCertHandleFromBytes(
const char* data, int length) {
CSSM_DATA cert_data;