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

Side by Side Diff: net/test/ct_test_util.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: NetLog int to string 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
« no previous file with comments | « net/ssl/ssl_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/ct_test_util.h" 5 #include "net/test/ct_test_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // log used in the tests. 392 // log used in the tests.
393 sct[15] = 't'; 393 sct[15] = 't';
394 394
395 std::string sct_list; 395 std::string sct_list;
396 ct::EncodeSCTListForTesting(sct, &sct_list); 396 ct::EncodeSCTListForTesting(sct, &sct_list);
397 return sct_list; 397 return sct_list;
398 } 398 }
399 399
400 bool CheckForSingleVerifiedSCTInResult(const ct::CTVerifyResult& result, 400 bool CheckForSingleVerifiedSCTInResult(const ct::CTVerifyResult& result,
401 const std::string& log_description) { 401 const std::string& log_description) {
402 return (result.verified_scts.size() == 1U) && result.invalid_scts.empty() && 402 return (result.scts.size() == 1 &&
403 result.unknown_logs_scts.empty() && 403 result.scts[0].status == ct::SCT_STATUS_OK &&
404 result.verified_scts[0]->log_description == log_description; 404 result.scts[0].sct->log_description == log_description);
405 } 405 }
406 406
407 bool CheckForSCTOrigin(const ct::CTVerifyResult& result, 407 bool CheckForSCTOrigin(const ct::CTVerifyResult& result,
408 ct::SignedCertificateTimestamp::Origin origin) { 408 ct::SignedCertificateTimestamp::Origin origin) {
409 return (result.verified_scts.size() > 0) && 409 for (const auto& sct_and_status : result.scts)
410 (result.verified_scts[0]->origin == origin); 410 if (sct_and_status.status == SCT_STATUS_OK &&
411 sct_and_status.sct->origin == origin)
412 return true;
413
414 return false;
411 } 415 }
412 416
413 } // namespace ct 417 } // namespace ct
414 418
415 } // namespace net 419 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698