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

Unified Diff: net/cert/x509_certificate_unittest.cc

Issue 421243003: Fixes to the SHA256 X509 Certificate fingerprint API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert variable names in unit test per wtc comment Created 6 years, 5 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/x509_certificate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_unittest.cc
diff --git a/net/cert/x509_certificate_unittest.cc b/net/cert/x509_certificate_unittest.cc
index 82cfa34e45ea1df706b45b3cde7a7ffa7c24ee42..fb16ed5cd90ea96fe0648949275c377a6324db3e 100644
--- a/net/cert/x509_certificate_unittest.cc
+++ b/net/cert/x509_certificate_unittest.cc
@@ -397,58 +397,58 @@ TEST(X509CertificateTest, CAFingerprints) {
0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52,
0xb8, 0x55
};
- SHA256HashValue ca_fingerprint_256_chain_1 =
+ SHA256HashValue ca_fingerprint_256_1 =
X509Certificate::CalculateCAFingerprint256(
cert_chain1->GetIntermediateCertificates());
- SHA256HashValue ca_fingerprint_256_chain_2 =
+ SHA256HashValue ca_fingerprint_256_2 =
X509Certificate::CalculateCAFingerprint256(
cert_chain2->GetIntermediateCertificates());
- SHA256HashValue ca_fingerprint_256_chain_3 =
+ SHA256HashValue ca_fingerprint_256_3 =
X509Certificate::CalculateCAFingerprint256(
cert_chain3->GetIntermediateCertificates());
- EXPECT_TRUE(memcmp(ca_fingerprint_256_chain_1.data,
+ EXPECT_TRUE(memcmp(ca_fingerprint_256_1.data,
cert_chain1_ca_fingerprint_256, 32) == 0);
- EXPECT_TRUE(memcmp(ca_fingerprint_256_chain_2.data,
+ EXPECT_TRUE(memcmp(ca_fingerprint_256_2.data,
cert_chain2_ca_fingerprint_256, 32) == 0);
- EXPECT_TRUE(memcmp(ca_fingerprint_256_chain_3.data,
+ EXPECT_TRUE(memcmp(ca_fingerprint_256_3.data,
cert_chain3_ca_fingerprint_256, 32) == 0);
- static const uint8 cert_chain1_full_chain_fingerprint_256[32] = {
+ static const uint8 cert_chain1_chain_fingerprint_256[32] = {
0xac, 0xff, 0xcc, 0x63, 0x0d, 0xd0, 0xa7, 0x19, 0x78, 0xb5,
0x8a, 0x47, 0x8b, 0x67, 0x97, 0xcb, 0x8d, 0xe1, 0x6a, 0x8a,
0x57, 0x70, 0xda, 0x9a, 0x53, 0x72, 0xe2, 0xa0, 0x08, 0xab,
0xcc, 0x8f
};
- static const uint8 cert_chain2_full_chain_fingerprint_256[32] = {
+ static const uint8 cert_chain2_chain_fingerprint_256[32] = {
0x67, 0x3a, 0x11, 0x20, 0xd6, 0x94, 0x14, 0xe4, 0x16, 0x9f,
0x58, 0xe2, 0x8b, 0xf7, 0x27, 0xed, 0xbb, 0xe8, 0xa7, 0xff,
0x1c, 0x8c, 0x0f, 0x21, 0x38, 0x16, 0x7c, 0xad, 0x1f, 0x22,
0x6f, 0x9b
};
- static const uint8 cert_chain3_full_chain_fingerprint_256[32] = {
+ static const uint8 cert_chain3_chain_fingerprint_256[32] = {
0x16, 0x7a, 0xbd, 0xb4, 0x57, 0x04, 0x65, 0x3c, 0x3b, 0xef,
0x6e, 0x6a, 0xa6, 0x02, 0x73, 0x30, 0x3e, 0x34, 0x1b, 0x43,
0xc2, 0x7c, 0x98, 0x52, 0x9f, 0x34, 0x7f, 0x55, 0x97, 0xe9,
0x1a, 0x10
};
- SHA256HashValue ca_fingerprint_256_full_chain_1 =
+ SHA256HashValue chain_fingerprint_256_1 =
X509Certificate::CalculateChainFingerprint256(
cert_chain1->os_cert_handle(),
cert_chain1->GetIntermediateCertificates());
- SHA256HashValue ca_fingerprint_256_full_chain_2 =
+ SHA256HashValue chain_fingerprint_256_2 =
X509Certificate::CalculateChainFingerprint256(
cert_chain2->os_cert_handle(),
cert_chain2->GetIntermediateCertificates());
- SHA256HashValue ca_fingerprint_256_full_chain_3 =
+ SHA256HashValue chain_fingerprint_256_3 =
X509Certificate::CalculateChainFingerprint256(
cert_chain3->os_cert_handle(),
cert_chain3->GetIntermediateCertificates());
- EXPECT_TRUE(memcmp(ca_fingerprint_256_full_chain_1.data,
- cert_chain1_full_chain_fingerprint_256, 32) == 0);
- EXPECT_TRUE(memcmp(ca_fingerprint_256_full_chain_2.data,
- cert_chain2_full_chain_fingerprint_256, 32) == 0);
- EXPECT_TRUE(memcmp(ca_fingerprint_256_full_chain_3.data,
- cert_chain3_full_chain_fingerprint_256, 32) == 0);
+ EXPECT_TRUE(memcmp(chain_fingerprint_256_1.data,
+ cert_chain1_chain_fingerprint_256, 32) == 0);
+ EXPECT_TRUE(memcmp(chain_fingerprint_256_2.data,
+ cert_chain2_chain_fingerprint_256, 32) == 0);
+ EXPECT_TRUE(memcmp(chain_fingerprint_256_3.data,
+ cert_chain3_chain_fingerprint_256, 32) == 0);
}
TEST(X509CertificateTest, ParseSubjectAltNames) {
« no previous file with comments | « net/cert/x509_certificate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698