| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/cast_certificate/cast_cert_validator.h" | 5 #include "components/cast_certificate/cast_cert_validator.h" |
| 6 | 6 |
| 7 #include "components/cast_certificate/cast_cert_validator_test_helpers.h" | 7 #include "components/cast_certificate/cast_cert_validator_test_helpers.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace cast_certificate { | 10 namespace cast_certificate { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const std::string& expected_common_name, | 39 const std::string& expected_common_name, |
| 40 CastDeviceCertPolicy expected_policy, | 40 CastDeviceCertPolicy expected_policy, |
| 41 const std::string& certs_file_name, | 41 const std::string& certs_file_name, |
| 42 const base::Time::Exploded& time, | 42 const base::Time::Exploded& time, |
| 43 const std::string& optional_signed_data_file_name) { | 43 const std::string& optional_signed_data_file_name) { |
| 44 auto certs = | 44 auto certs = |
| 45 cast_certificate::testing::ReadCertificateChainFromFile(certs_file_name); | 45 cast_certificate::testing::ReadCertificateChainFromFile(certs_file_name); |
| 46 | 46 |
| 47 std::unique_ptr<CertVerificationContext> context; | 47 std::unique_ptr<CertVerificationContext> context; |
| 48 CastDeviceCertPolicy policy; | 48 CastDeviceCertPolicy policy; |
| 49 bool result = VerifyDeviceCert(certs, time, &context, &policy); | 49 CRLOptions crl_options; |
| 50 crl_options.crl_required = false; |
| 51 bool result = |
| 52 VerifyDeviceCert(certs, time, &context, &policy, nullptr, crl_options); |
| 50 | 53 |
| 51 if (expected_result == RESULT_FAIL) { | 54 if (expected_result == RESULT_FAIL) { |
| 52 ASSERT_FALSE(result); | 55 ASSERT_FALSE(result); |
| 53 return; | 56 return; |
| 54 } | 57 } |
| 55 | 58 |
| 56 ASSERT_TRUE(result); | 59 ASSERT_TRUE(result); |
| 57 EXPECT_EQ(expected_policy, policy); | 60 EXPECT_EQ(expected_policy, policy); |
| 58 ASSERT_TRUE(context.get()); | 61 ASSERT_TRUE(context.get()); |
| 59 | 62 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 auto context = | 431 auto context = |
| 429 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki)); | 432 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki)); |
| 430 | 433 |
| 431 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature), | 434 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature), |
| 432 CreateString(kEx2Message))); | 435 CreateString(kEx2Message))); |
| 433 } | 436 } |
| 434 | 437 |
| 435 } // namespace | 438 } // namespace |
| 436 | 439 |
| 437 } // namespace cast_certificate | 440 } // namespace cast_certificate |
| OLD | NEW |