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

Unified Diff: net/cert/x509_certificate_openssl.cc

Issue 462543002: Certificate Transparency: Code for unpacking EV cert hashes whitelist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/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;

Powered by Google App Engine
This is Rietveld 408576698