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

Unified Diff: net/cert/ct_log_verifier_unittest.cc

Issue 2183073002: Improve documentation and readability of CTLogVerifier tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_log_verifier_unittest.cc
diff --git a/net/cert/ct_log_verifier_unittest.cc b/net/cert/ct_log_verifier_unittest.cc
index 24c704a8565545c4c6c3efc6a1d367a750646d82..91ddbc737e3becfecf9e589216b0cc0e685c20ec 100644
--- a/net/cert/ct_log_verifier_unittest.cc
+++ b/net/cert/ct_log_verifier_unittest.cc
@@ -55,8 +55,8 @@ const uint8_t kSHA256EmptyTreeHash[32] = {
0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b,
0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55};
-// Node hashes for a sample tree of size 8 (each element in this array is
-// a node hash, not leaf data; order represents order of the nodes in the tree).
+// Root hashes from building the sample tree of size 8 leaf-by-leaf.
+// The first entry is the root at size 0, the last is the root at size 8.
const char* const kSHA256Roots[8] = {
"6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d",
"fac54203e7cc696cf0dfcb42c92a1d9dbaf70ad9e621f4bd8d98662f00e3c125",
@@ -369,6 +369,7 @@ TEST_F(CTLogVerifierTest, VerifiesValidConsistencyProofs) {
// Known good proofs.
for (size_t i = 0; i < arraysize(kSHA256Proofs); ++i) {
+ SCOPED_TRACE(i);
proof.clear();
for (size_t j = 0; j < kSHA256Proofs[i].proof_length; ++j) {
const char* const v = kSHA256Proofs[i].proof[j];
@@ -475,6 +476,9 @@ class CTLogVerifierTestUsingReferenceGenerator
const uint64_t kReferenceTreeSize = 256;
+// Tests that every possible valid consistency proof for a tree of a given size
+// verifies correctly. Also checks that invalid variations of each proof fail to
+// verify (see VerifierConsistencyCheck).
TEST_P(CTLogVerifierTestUsingReferenceGenerator,
VerifiesValidConsistencyProof) {
std::vector<std::string> data;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698