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 "net/cert/internal/parsed_certificate.h" | 8 #include "net/cert/internal/parsed_certificate.h" |
9 #include "net/cert/internal/trust_store_in_memory.h" | 9 #include "net/cert/internal/trust_store_in_memory.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 net::TrustAnchor::CreateFromCertificateWithConstraints( | 101 net::TrustAnchor::CreateFromCertificateWithConstraints( |
102 std::move(root))); | 102 std::move(root))); |
103 } | 103 } |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 std::unique_ptr<CertVerificationContext> context; | 107 std::unique_ptr<CertVerificationContext> context; |
108 CastDeviceCertPolicy policy; | 108 CastDeviceCertPolicy policy; |
109 | 109 |
110 bool result; | 110 bool result; |
111 if (trust_store.get()) { | 111 if (trust_store) { |
112 result = | 112 result = VerifyDeviceCertUsingCustomTrustStore( |
113 VerifyDeviceCertForTest(certs, time, &context, &policy, nullptr, | 113 certs, time, &context, &policy, nullptr, CRLPolicy::CRL_OPTIONAL, |
114 CRLPolicy::CRL_OPTIONAL, trust_store.get()); | 114 trust_store.get()); |
115 } else { | 115 } else { |
116 result = VerifyDeviceCert(certs, time, &context, &policy, nullptr, | 116 result = VerifyDeviceCert(certs, time, &context, &policy, nullptr, |
117 CRLPolicy::CRL_OPTIONAL); | 117 CRLPolicy::CRL_OPTIONAL); |
118 } | 118 } |
119 | 119 |
120 if (expected_result == RESULT_FAIL) { | 120 if (expected_result == RESULT_FAIL) { |
121 ASSERT_FALSE(result); | 121 ASSERT_FALSE(result); |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 auto context = | 550 auto context = |
551 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki)); | 551 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki)); |
552 | 552 |
553 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature), | 553 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature), |
554 CreateString(kEx2Message))); | 554 CreateString(kEx2Message))); |
555 } | 555 } |
556 | 556 |
557 } // namespace | 557 } // namespace |
558 | 558 |
559 } // namespace cast_certificate | 559 } // namespace cast_certificate |
OLD | NEW |