Index: net/cert/x509_certificate_nss.cc |
diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc |
index 9e95413a22e311d8b93bdc2e04078945847083d5..6e37bf2d82a5ebe852d83d0bda09029348e2040c 100644 |
--- a/net/cert/x509_certificate_nss.cc |
+++ b/net/cert/x509_certificate_nss.cc |
@@ -225,6 +225,21 @@ SHA1HashValue X509Certificate::CalculateFingerprint( |
} |
// static |
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) { |
+ SHA256HashValue sha256; |
+ memset(sha256.data, 0, sizeof(sha256.data)); |
+ |
+ DCHECK(NULL != cert->derCert.data); |
+ DCHECK_NE(0U, cert->derCert.len); |
+ |
+ SECStatus rv = HASH_HashBuf( |
+ HASH_AlgSHA256, sha256.data, cert->derCert.data, cert->derCert.len); |
+ DCHECK_EQ(SECSuccess, rv); |
+ |
+ return sha256; |
+} |
+ |
+// static |
SHA1HashValue X509Certificate::CalculateCAFingerprint( |
const OSCertHandles& intermediates) { |
SHA1HashValue sha1; |