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

Unified Diff: net/cert/nss_profile_filter_chromeos_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: Fix IDN test Created 4 years, 6 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
« no previous file with comments | « net/cert/nss_cert_database_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_profile_filter_chromeos_unittest.cc
diff --git a/net/cert/nss_profile_filter_chromeos_unittest.cc b/net/cert/nss_profile_filter_chromeos_unittest.cc
index f0243d843daf758eabce506a797ff272ffb44f63..cf446665925c26d7e6229e72c1269f7511d884b7 100644
--- a/net/cert/nss_profile_filter_chromeos_unittest.cc
+++ b/net/cert/nss_profile_filter_chromeos_unittest.cc
@@ -7,12 +7,15 @@
#include <cert.h>
#include <pk11pub.h>
#include <secmod.h>
+
+#include <algorithm>
#include <utility>
#include "crypto/nss_util_internal.h"
#include "crypto/scoped_nss_types.h"
#include "crypto/scoped_test_nss_chromeos_user.h"
#include "crypto/scoped_test_nss_db.h"
+#include "net/base/hash_value.h"
#include "net/base/test_data_directory.h"
#include "net/test/cert_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -49,7 +52,14 @@ CertificateList ListCertsInSlot(PK11SlotInfo* slot) {
CERT_DestroyCertList(cert_list);
// Sort the result so that test comparisons can be deterministic.
- std::sort(result.begin(), result.end(), X509Certificate::LessThan());
+ std::sort(
+ result.begin(), result.end(),
+ [](const scoped_refptr<X509Certificate>& lhs,
+ const scoped_refptr<X509Certificate>& rhs) {
+ return SHA256HashValueLessThan()(
+ X509Certificate::CalculateFingerprint256(lhs->os_cert_handle()),
+ X509Certificate::CalculateFingerprint256(rhs->os_cert_handle()));
+ });
return result;
}
« no previous file with comments | « net/cert/nss_cert_database_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698