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