Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 return (result.scts.size() > 0) && (result.scts[0].status == SCT_STATUS_OK) && |
|
eroman
2016/08/10 19:00:40
What are the guarantees around ordering? For more
Eran Messeri
2016/08/10 22:05:07
No guarantees indeed - Changed the code to look fo
| |
| 410 (result.verified_scts[0]->origin == origin); | 410 (result.scts[0].sct->origin == origin); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace ct | 413 } // namespace ct |
| 414 | 414 |
| 415 } // namespace net | 415 } // namespace net |
| OLD | NEW |