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

Unified Diff: net/test/ct_test_util.cc

Issue 72333007: Add an SignedCertificateTimetampStore, making SignedCertificateTimestamp be refcounted to aid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@piecewise
Patch Set: Fixes for wtc. Created 7 years, 1 month 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/test/ct_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/ct_test_util.cc
diff --git a/net/test/ct_test_util.cc b/net/test/ct_test_util.cc
index b588b135c34709f466886e80e38fc68714e804ab..8c15c6752ad265c45312b6eead294c240916544c 100644
--- a/net/test/ct_test_util.cc
+++ b/net/test/ct_test_util.cc
@@ -131,26 +131,30 @@ std::string GetTestPublicKeyId() {
return HexToBytes(kTestKeyId);
}
-void GetX509CertSCT(SignedCertificateTimestamp* sct) {
- sct->log_id = HexToBytes(kTestKeyId);
- sct->timestamp = base::Time::UnixEpoch() +
+void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct) {
+ CHECK(sct != NULL);
agl 2013/11/19 16:12:40 nit: it would also be fine to have the argument be
alcutter 2013/11/19 18:03:48 "My god, it's full of stars." Good idea, done.
+ *sct = new SignedCertificateTimestamp();
+ (*sct)->log_id = HexToBytes(kTestKeyId);
+ (*sct)->timestamp = base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(GG_UINT64_C(1365181456089));
- sct->extensions.clear();
+ (*sct)->extensions.clear();
- sct->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
- sct->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
- sct->signature.signature_data = HexToBytes(kTestSCTSignatureData);
+ (*sct)->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
+ (*sct)->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
+ (*sct)->signature.signature_data = HexToBytes(kTestSCTSignatureData);
}
-void GetPrecertSCT(SignedCertificateTimestamp* sct) {
- sct->log_id = HexToBytes(kTestKeyId);
- sct->timestamp = base::Time::UnixEpoch() +
+void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct) {
+ CHECK(sct != NULL);
+ *sct = new SignedCertificateTimestamp();
+ (*sct)->log_id = HexToBytes(kTestKeyId);
+ (*sct)->timestamp = base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(GG_UINT64_C(1365181456275));
- sct->extensions.clear();
+ (*sct)->extensions.clear();
- sct->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
- sct->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
- sct->signature.signature_data = HexToBytes(kTestSCTPrecertSignatureData);
+ (*sct)->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
+ (*sct)->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
+ (*sct)->signature.signature_data = HexToBytes(kTestSCTPrecertSignatureData);
}
} // namespace ct
« no previous file with comments | « net/test/ct_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698