Index: net/base/cert_verify_proc_mac.cc |
=================================================================== |
--- net/base/cert_verify_proc_mac.cc (revision 150362) |
+++ net/base/cert_verify_proc_mac.cc (working copy) |
@@ -8,6 +8,9 @@ |
#include <CoreServices/CoreServices.h> |
#include <Security/Security.h> |
+#include <string> |
+#include <vector> |
+ |
#include "base/logging.h" |
#include "base/mac/mac_logging.h" |
#include "base/mac/scoped_cftyperef.h" |
@@ -231,7 +234,7 @@ |
} |
void AppendPublicKeyHashes(CFArrayRef chain, |
- std::vector<SHA1Fingerprint>* hashes) { |
+ std::vector<HashValueVector>* hashes) { |
const CFIndex n = CFArrayGetCount(chain); |
for (CFIndex i = 0; i < n; i++) { |
SecCertificateRef cert = reinterpret_cast<SecCertificateRef>( |
@@ -246,9 +249,15 @@ |
if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes)) |
continue; |
- SHA1Fingerprint hash; |
- CC_SHA1(spki_bytes.data(), spki_bytes.size(), hash.data); |
- hashes->push_back(hash); |
+ HashValue sha1; |
+ sha1.tag = HASH_VALUE_SHA1; |
+ CC_SHA1(spki_bytes.data(), spki_bytes.size(), sha1.data()); |
+ (*hashes)[HASH_VALUE_SHA1].push_back(sha1); |
+ |
+ HashValue sha256; |
+ sha256.tag = HASH_VALUE_SHA256; |
+ CC_SHA256(spki_bytes.data(), spki_bytes.size(), sha256.data()); |
+ (*hashes)[HASH_VALUE_SHA256].push_back(sha256); |
} |
} |
@@ -325,7 +334,7 @@ |
return false; |
SecCertificateRef root_ref = reinterpret_cast<SecCertificateRef>( |
const_cast<void*>(CFArrayGetValueAtIndex(chain, n - 1))); |
- SHA1Fingerprint hash = X509Certificate::CalculateFingerprint(root_ref); |
+ SHA1HashValue hash = X509Certificate::CalculateFingerprint(root_ref); |
return IsSHA1HashInSortedArray( |
hash, &kKnownRootCertSHA1Hashes[0][0], sizeof(kKnownRootCertSHA1Hashes)); |
} |