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

Side by Side Diff: net/cert/multi_log_ct_verifier_unittest.cc

Issue 88643002: SignedCertificateTimestamp storing & serialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erans_patches
Patch Set: remove a spurious content:: Created 7 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/cert/multi_log_ct_verifier.h" 5 #include "net/cert/multi_log_ct_verifier.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 24 matching lines...) Expand all
35 verifier_->AddLog(log.Pass()); 35 verifier_->AddLog(log.Pass());
36 std::string der_test_cert(ct::GetDerEncodedX509Cert()); 36 std::string der_test_cert(ct::GetDerEncodedX509Cert());
37 chain_ = X509Certificate::CreateFromBytes( 37 chain_ = X509Certificate::CreateFromBytes(
38 der_test_cert.data(), 38 der_test_cert.data(),
39 der_test_cert.length()); 39 der_test_cert.length());
40 ASSERT_TRUE(chain_); 40 ASSERT_TRUE(chain_);
41 } 41 }
42 42
43 bool CheckForSingleVerifiedSCTInResult(const ct::CTVerifyResult& result) { 43 bool CheckForSingleVerifiedSCTInResult(const ct::CTVerifyResult& result) {
44 return (result.verified_scts.size() == 1U) && 44 return (result.verified_scts.size() == 1U) &&
45 result.unverified_scts.empty() && 45 result.invalid_scts.empty() &&
46 result.unknown_logs_scts.empty(); 46 result.unknown_logs_scts.empty();
47 } 47 }
48 48
49 bool CheckForSCTOrigin( 49 bool CheckForSCTOrigin(
50 const ct::CTVerifyResult& result, 50 const ct::CTVerifyResult& result,
51 ct::SignedCertificateTimestamp::Origin origin) { 51 ct::SignedCertificateTimestamp::Origin origin) {
52 return (result.verified_scts.size() > 0) && 52 return (result.verified_scts.size() > 0) &&
53 (result.verified_scts[0]->origin == origin); 53 (result.verified_scts[0]->origin == origin);
54 } 54 }
55 55
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ASSERT_TRUE(ct::EncodeSCTListForTesting(sct, &sct_list)); 129 ASSERT_TRUE(ct::EncodeSCTListForTesting(sct, &sct_list));
130 130
131 ct::CTVerifyResult result; 131 ct::CTVerifyResult result;
132 EXPECT_NE(OK, verifier_->Verify(chain_, sct_list, "", &result)); 132 EXPECT_NE(OK, verifier_->Verify(chain_, sct_list, "", &result));
133 EXPECT_EQ(1U, result.unknown_logs_scts.size()); 133 EXPECT_EQ(1U, result.unknown_logs_scts.size());
134 } 134 }
135 135
136 } // namespace 136 } // namespace
137 137
138 } // namespace net 138 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698