 Chromium Code Reviews
 Chromium Code Reviews Issue 2000503002:
  Remove the fingerprint and ca_fingerprint from X509Certificate  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
    
  
    Issue 2000503002:
  Remove the fingerprint and ca_fingerprint from X509Certificate  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache| Index: chromeos/network/onc/onc_certificate_importer_impl_unittest.cc | 
| diff --git a/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc b/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc | 
| index fedf6d54f91ea9e0b69d4146be228fefba363f21..aa148e4257f183f89e0ad616cc654b90d965e3eb 100644 | 
| --- a/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc | 
| +++ b/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc | 
| @@ -20,6 +20,7 @@ | 
| #include "components/onc/onc_constants.h" | 
| #include "crypto/scoped_test_nss_db.h" | 
| #include "net/base/crypto_module.h" | 
| +#include "net/base/hash_value.h" | 
| #include "net/cert/cert_type.h" | 
| #include "net/cert/nss_cert_database_chromeos.h" | 
| #include "net/cert/x509_certificate.h" | 
| @@ -182,8 +183,15 @@ class ONCCertificateImporterImplTest : public testing::Test { | 
| } | 
| CERT_DestroyCertList(cert_list); | 
| - // Sort the result so that test comparisons can be deterministic. | 
| - std::sort(result.begin(), result.end(), net::X509Certificate::LessThan()); | 
| + std::sort(result.begin(), result.end(), | 
| + [](const scoped_refptr<net::X509Certificate>& lhs, | 
| + const scoped_refptr<net::X509Certificate>& rhs) { | 
| + return net::SHA256HashValueLessThan()( | 
| + net::X509Certificate::CalculateFingerprint256( | 
| + lhs->os_cert_handle()), | 
| + net::X509Certificate::CalculateFingerprint256( | 
| + rhs->os_cert_handle())); | 
| + }); | 
| 
stevenjb
2016/06/16 16:39:23
This seems potentially expensive since we recalcul
 
Ryan Sleevi
2016/06/16 21:16:45
Right. If it was outside unittests, memoizing the
 | 
| return result; | 
| } | 
| }; |