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

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: 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
« net/test/ct_test_util.h ('K') | « 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..b84c84a67958fb3c57d3331039a32dd077fdb36a 100644
--- a/net/test/ct_test_util.cc
+++ b/net/test/ct_test_util.cc
@@ -131,26 +131,32 @@ 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) {
+ scoped_refptr<SignedCertificateTimestamp> ret(
+ new SignedCertificateTimestamp());
+ ret->log_id = HexToBytes(kTestKeyId);
+ ret->timestamp = base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(GG_UINT64_C(1365181456089));
- sct->extensions.clear();
+ ret->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);
+ ret->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
+ ret->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
+ ret->signature.signature_data = HexToBytes(kTestSCTSignatureData);
+ sct->swap(ret);
wtc 2013/11/19 01:57:40 I think the "swap" idiom is only used by functions
alcutter 2013/11/19 15:51:34 no problem, done.
}
-void GetPrecertSCT(SignedCertificateTimestamp* sct) {
- sct->log_id = HexToBytes(kTestKeyId);
- sct->timestamp = base::Time::UnixEpoch() +
+void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct) {
+ scoped_refptr<SignedCertificateTimestamp> ret(
+ new SignedCertificateTimestamp());
+ ret->log_id = HexToBytes(kTestKeyId);
+ ret->timestamp = base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(GG_UINT64_C(1365181456275));
- sct->extensions.clear();
+ ret->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);
+ ret->signature.hash_algorithm = ct::DigitallySigned::HASH_ALGO_SHA256;
+ ret->signature.signature_algorithm = ct::DigitallySigned::SIG_ALGO_ECDSA;
+ ret->signature.signature_data = HexToBytes(kTestSCTPrecertSignatureData);
+ sct->swap(ret);
}
} // namespace ct
« net/test/ct_test_util.h ('K') | « net/test/ct_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698