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

Unified Diff: chrome/browser/safe_browsing/download_protection_service_unittest.cc

Issue 2000503002: Remove the fingerprint and ca_fingerprint from X509Certificate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
Patch Set: Created 4 years, 7 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: chrome/browser/safe_browsing/download_protection_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index 8785fa0a749b601b2dbe7e27059cceb090203933..8ce9026f13bba0ec61c589b97320a9d56bf0bfd3 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -23,6 +23,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
+#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/history/history_service_factory.h"
@@ -1731,9 +1732,12 @@ TEST_F(DownloadProtectionServiceTest, GetCertificateWhitelistStrings) {
scoped_refptr<net::X509Certificate> issuer_cert(
ReadTestCertificate("issuer.pem"));
ASSERT_TRUE(issuer_cert.get());
- std::string cert_base = "cert/" + base::HexEncode(
- issuer_cert->fingerprint().data,
- sizeof(issuer_cert->fingerprint().data));
+ std::string issuer_der;
+ net::X509Certificate::GetDEREncoded(issuer_cert->os_cert_handle(),
+ &issuer_der);
+ std::string hashed = base::SHA1HashString(issuer_der);
+ std::string cert_base =
+ "cert/" + base::HexEncode(hashed.data(), hashed.size());
scoped_refptr<net::X509Certificate> cert(ReadTestCertificate("test_cn.pem"));
ASSERT_TRUE(cert.get());

Powered by Google App Engine
This is Rietveld 408576698