Index: net/cert/x509_certificate_ios.cc |
diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc |
index f59cb650993cb039bf64d67f794c7952a5f3e366..b0908b77afae4b4397adbc8e4ca61f653e121406 100644 |
--- a/net/cert/x509_certificate_ios.cc |
+++ b/net/cert/x509_certificate_ios.cc |
@@ -186,6 +186,22 @@ SHA1HashValue X509Certificate::CalculateFingerprint( |
} |
// static |
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) { |
+ SHA256HashValue sha256; |
+ memset(sha256.data, 0, sizeof(sha256.data)); |
+ |
+ ScopedCFTypeRef<CFDataRef> cert_data(SecCertificateCopyData(cert)); |
+ if (!cert_data) |
+ return sha256; |
+ DCHECK(CFDataGetBytePtr(cert_data)); |
+ DCHECK_NE(0, CFDataGetLength(cert_data)); |
+ CC_SHA256( |
+ CFDataGetBytePtr(cert_data), CFDataGetLength(cert_data), sha256.data); |
+ |
+ return sha256; |
+} |
+ |
+// static |
SHA1HashValue X509Certificate::CalculateCAFingerprint( |
const OSCertHandles& intermediates) { |
SHA1HashValue sha1; |