| Index: net/test/ct_test_util.cc
|
| diff --git a/net/test/ct_test_util.cc b/net/test/ct_test_util.cc
|
| index 9bc6f958da7575a5d8f85d0ec33e09c8e99a63b3..aba7b9a50e4d7bfc62091616c48099f8e213bf79 100644
|
| --- a/net/test/ct_test_util.cc
|
| +++ b/net/test/ct_test_util.cc
|
| @@ -205,7 +205,7 @@ void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct_ref) {
|
| *sct_ref = new SignedCertificateTimestamp();
|
| SignedCertificateTimestamp *const sct(sct_ref->get());
|
| sct->version = ct::SignedCertificateTimestamp::SCT_VERSION_1;
|
| - sct->log_id = HexToBytes(kTestKeyId);
|
| + sct->log_id = GetTestPublicKeyId();
|
| // Time the log issued a SCT for this certificate, which is
|
| // Fri Apr 5 10:04:16.089 2013
|
| sct->timestamp = base::Time::UnixEpoch() +
|
| @@ -222,7 +222,7 @@ void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct_ref) {
|
| *sct_ref = new SignedCertificateTimestamp();
|
| SignedCertificateTimestamp *const sct(sct_ref->get());
|
| sct->version = ct::SignedCertificateTimestamp::SCT_VERSION_1;
|
| - sct->log_id = HexToBytes(kTestKeyId);
|
| + sct->log_id = GetTestPublicKeyId();
|
| // Time the log issued a SCT for this Precertificate, which is
|
| // Fri Apr 5 10:04:16.275 2013
|
| sct->timestamp = base::Time::UnixEpoch() +
|
| @@ -257,6 +257,7 @@ std::string GetDerEncodedFakeOCSPResponseIssuerCert() {
|
| // A sample, valid STH
|
| bool GetSampleSignedTreeHead(SignedTreeHead* sth) {
|
| sth->version = SignedTreeHead::V1;
|
| + sth->log_id = GetTestPublicKeyId();
|
| sth->timestamp = base::Time::UnixEpoch() +
|
| base::TimeDelta::FromMilliseconds(kSampleSTHTimestamp);
|
| sth->tree_size = kSampleSTHTreeSize;
|
| @@ -312,6 +313,21 @@ bool GetSampleSTHTreeHeadDecodedSignature(DigitallySigned* signature) {
|
| return DecodeDigitallySigned(&sp, signature) && sp.empty();
|
| }
|
|
|
| +std::string GetSampleSTH() {
|
| + const std::string log_id = ct::GetTestPublicKeyId();
|
| + const std::string timestamp("\x0\x0\x1\x45\x3c\x5f\xb8\x35", 8);
|
| + const std::string tree_size("\x0\x0\x0\x0\x0\x0\x0\x15", 8);
|
| +
|
| + std::string expected_output;
|
| + expected_output += log_id;
|
| + expected_output += timestamp;
|
| + expected_output += tree_size;
|
| + expected_output += ct::GetSampleSTHSHA256RootHash();
|
| + expected_output += ct::GetSampleSTHTreeHeadSignature();
|
| +
|
| + return expected_output;
|
| +}
|
| +
|
| std::string GetSampleSTHAsJson() {
|
| return CreateSignedTreeHeadJsonString(kSampleSTHTreeSize, kSampleSTHTimestamp,
|
| GetSampleSTHSHA256RootHash(),
|
|
|