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

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

Issue 2225223002: Certificate Transparency: Change CTVerifyResult to have a single list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 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 <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 result, ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION)); 229 result, ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION));
230 } 230 }
231 231
232 TEST_F(MultiLogCTVerifierTest, IdentifiesSCTFromUnknownLog) { 232 TEST_F(MultiLogCTVerifierTest, IdentifiesSCTFromUnknownLog) {
233 std::string sct_list = ct::GetSCTListWithInvalidSCT(); 233 std::string sct_list = ct::GetSCTListWithInvalidSCT();
234 ct::CTVerifyResult result; 234 ct::CTVerifyResult result;
235 235
236 EXPECT_NE(OK, 236 EXPECT_NE(OK,
237 verifier_->Verify( 237 verifier_->Verify(
238 chain_.get(), std::string(), sct_list, &result, BoundNetLog())); 238 chain_.get(), std::string(), sct_list, &result, BoundNetLog()));
239 EXPECT_EQ(1U, result.unknown_logs_scts.size()); 239 EXPECT_EQ(1U, result.scts.size());
240 EXPECT_EQ("", result.unknown_logs_scts[0]->log_description); 240 EXPECT_EQ("", result.scts[0].sct->log_description);
241 EXPECT_EQ(ct::SCT_STATUS_LOG_UNKNOWN, result.scts[0].status);
241 } 242 }
242 243
243 TEST_F(MultiLogCTVerifierTest, CountsValidSCTsInStatusHistogram) { 244 TEST_F(MultiLogCTVerifierTest, CountsValidSCTsInStatusHistogram) {
244 int num_valid_scts = NumValidSCTsInStatusHistogram(); 245 int num_valid_scts = NumValidSCTsInStatusHistogram();
245 246
246 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); 247 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_));
247 248
248 EXPECT_EQ(num_valid_scts + 1, NumValidSCTsInStatusHistogram()); 249 EXPECT_EQ(num_valid_scts + 1, NumValidSCTsInStatusHistogram());
249 } 250 }
250 251
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 Mock::VerifyAndClearExpectations(&observer); 302 Mock::VerifyAndClearExpectations(&observer);
302 303
303 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0); 304 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0);
304 verifier_->SetObserver(nullptr); 305 verifier_->SetObserver(nullptr);
305 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); 306 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_));
306 } 307 }
307 308
308 } // namespace 309 } // namespace
309 310
310 } // namespace net 311 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698