| Index: net/base/cert_verify_proc_win.cc
|
| ===================================================================
|
| --- net/base/cert_verify_proc_win.cc (revision 155029)
|
| +++ net/base/cert_verify_proc_win.cc (working copy)
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "net/base/cert_verify_proc_win.h"
|
|
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/sha1.h"
|
| #include "base/string_util.h"
|
| @@ -283,7 +286,7 @@
|
| PCERT_CHAIN_ELEMENT* element = first_chain->rgpElement;
|
| PCCERT_CONTEXT cert = element[num_elements - 1]->pCertContext;
|
|
|
| - SHA1Fingerprint hash = X509Certificate::CalculateFingerprint(cert);
|
| + SHA1HashValue hash = X509Certificate::CalculateFingerprint(cert);
|
| return IsSHA1HashInSortedArray(
|
| hash, &kKnownRootCertSHA1Hashes[0][0], sizeof(kKnownRootCertSHA1Hashes));
|
| }
|
| @@ -442,7 +445,7 @@
|
| }
|
|
|
| void AppendPublicKeyHashes(PCCERT_CHAIN_CONTEXT chain,
|
| - std::vector<SHA1Fingerprint>* hashes) {
|
| + HashValueVector* hashes) {
|
| if (chain->cChain == 0)
|
| return;
|
|
|
| @@ -460,10 +463,14 @@
|
| if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes))
|
| continue;
|
|
|
| - SHA1Fingerprint hash;
|
| + HashValue sha1(HASH_VALUE_SHA1);
|
| base::SHA1HashBytes(reinterpret_cast<const uint8*>(spki_bytes.data()),
|
| - spki_bytes.size(), hash.data);
|
| - hashes->push_back(hash);
|
| + spki_bytes.size(), sha1.data());
|
| + hashes->push_back(sha1);
|
| +
|
| + HashValue sha256(HASH_VALUE_SHA256);
|
| + crypto::SHA256HashString(spki_bytes, sha1.data(), crypto::kSHA256Length);
|
| + hashes->push_back(sha256);
|
| }
|
| }
|
|
|
| @@ -504,7 +511,7 @@
|
|
|
| // Look up the EV policy OID of the root CA.
|
| PCCERT_CONTEXT root_cert = element[num_elements - 1]->pCertContext;
|
| - SHA1Fingerprint fingerprint =
|
| + SHA1HashValue fingerprint =
|
| X509Certificate::CalculateFingerprint(root_cert);
|
| EVRootCAMetadata* metadata = EVRootCAMetadata::GetInstance();
|
| return metadata->HasEVPolicyOID(fingerprint, policy_oid);
|
|
|