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

Unified Diff: net/test/ct_test_util.h

Issue 1639483002: Revert "Revert of CT Verify test utilities change - Moved the following common functions (patchset … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/quic/crypto/proof_verifier_chromium_test.cc ('k') | net/test/ct_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/ct_test_util.h
diff --git a/net/test/ct_test_util.h b/net/test/ct_test_util.h
index e1d6cff6f0902e433ea4c7f6332de150557518af..d3df6e62d9baa1ec0174620739833549f7a35c92 100644
--- a/net/test/ct_test_util.h
+++ b/net/test/ct_test_util.h
@@ -12,14 +12,15 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "net/cert/signed_certificate_timestamp.h"
namespace net {
namespace ct {
+struct CTVerifyResult;
struct DigitallySigned;
struct LogEntry;
-struct SignedCertificateTimestamp;
struct SignedTreeHead;
// Note: unless specified otherwise, all test data is taken from Certificate
@@ -102,6 +103,23 @@ std::string CreateSignedTreeHeadJsonString(size_t tree_size,
// the provided raw nodes (i.e. the raw nodes will be base64-encoded).
std::string CreateConsistencyProofJsonString(
const std::vector<std::string>& raw_nodes);
+
+// Returns SCTList for testing.
+std::string GetSCTListForTesting();
+
+// Returns a corrupted SCTList. This is done by changing a byte inside the
+// Log ID part of the SCT so it does not match the log used in the tests.
+std::string GetSCTListWithInvalidSCT();
+
+// Returns true if |log_description| is in the |result|'s |verified_scts| and
+// number of |verified_scts| in |result| is equal to 1.
+bool CheckForSingleVerifiedSCTInResult(const CTVerifyResult& result,
+ const std::string& log_description);
+
+// Returns true if |origin| is in the |result|'s |verified_scts|.
+bool CheckForSCTOrigin(const CTVerifyResult& result,
+ SignedCertificateTimestamp::Origin origin);
+
} // namespace ct
} // namespace net
« no previous file with comments | « net/quic/crypto/proof_verifier_chromium_test.cc ('k') | net/test/ct_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698