Index: chrome/browser/safe_browsing/download_protection_service.cc |
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc |
index 766bbd15bbe60927426745d02a68780576aa2fde..2d6512d9e6c6e282ffe48e3a62e3217e00c1ca3b 100644 |
--- a/chrome/browser/safe_browsing/download_protection_service.cc |
+++ b/chrome/browser/safe_browsing/download_protection_service.cc |
@@ -19,6 +19,7 @@ |
#include "base/metrics/sparse_histogram.h" |
#include "base/rand_util.h" |
#include "base/sequenced_task_runner_helpers.h" |
+#include "base/sha1.h" |
#include "base/stl_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_split.h" |
@@ -1323,8 +1324,10 @@ void DownloadProtectionService::GetCertificateWhitelistStrings( |
paths_to_check.insert(ou_tokens[i]); |
} |
- std::string issuer_fp = base::HexEncode(issuer.fingerprint().data, |
- sizeof(issuer.fingerprint().data)); |
+ std::string issuer_der; |
+ net::X509Certificate::GetDEREncoded(issuer.os_cert_handle(), &issuer_der); |
+ std::string hashed = base::SHA1HashString(issuer_der); |
+ std::string issuer_fp = base::HexEncode(hashed.data(), hashed.size()); |
for (std::set<std::string>::iterator it = paths_to_check.begin(); |
it != paths_to_check.end(); ++it) { |
whitelist_strings->push_back("cert/" + issuer_fp + *it); |