Index: net/cert/x509_certificate_openssl.cc |
diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc |
index fdd0e48d8551eef12623ea3e7d3b397d039147de..7167220f22c3163a17189429be21bd791c54decd 100644 |
--- a/net/cert/x509_certificate_openssl.cc |
+++ b/net/cert/x509_certificate_openssl.cc |
@@ -294,6 +294,16 @@ SHA1HashValue X509Certificate::CalculateFingerprint(OSCertHandle cert) { |
} |
// static |
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) { |
+ SHA256HashValue sha256; |
+ unsigned int sha256_size = static_cast<unsigned int>(sizeof(sha256.data)); |
+ int ret = X509_digest(cert, EVP_sha256(), sha256.data, &sha256_size); |
+ CHECK(ret); |
+ CHECK_EQ(sha256_size, sizeof(sha256.data)); |
+ return sha256; |
+} |
+ |
+// static |
SHA1HashValue X509Certificate::CalculateCAFingerprint( |
const OSCertHandles& intermediates) { |
SHA1HashValue sha1; |