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

Side by Side Diff: components/cast_certificate/cast_cert_validator_unittest.cc

Issue 2303673004: Hook up Chrome Cast sender to Cast CRL. (Closed)
Patch Set: Fixed nit Created 4 years, 2 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 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/cert_errors.h" 8 #include "net/cert/internal/cert_errors.h"
9 #include "net/cert/internal/parsed_certificate.h" 9 #include "net/cert/internal/parsed_certificate.h"
10 #include "net/cert/internal/trust_store_in_memory.h" 10 #include "net/cert/internal/trust_store_in_memory.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 trust_store->AddTrustAnchor( 102 trust_store->AddTrustAnchor(
103 net::TrustAnchor::CreateFromCertificateWithConstraints( 103 net::TrustAnchor::CreateFromCertificateWithConstraints(
104 std::move(root))); 104 std::move(root)));
105 } 105 }
106 } 106 }
107 } 107 }
108 108
109 std::unique_ptr<CertVerificationContext> context; 109 std::unique_ptr<CertVerificationContext> context;
110 CastDeviceCertPolicy policy; 110 CastDeviceCertPolicy policy;
111 111
112 bool result; 112 bool result = VerifyDeviceCertUsingCustomTrustStore(
113 if (trust_store.get()) { 113 certs, time, &context, &policy, nullptr, CRLPolicy::CRL_OPTIONAL,
114 result = 114 trust_store.get());
115 VerifyDeviceCertForTest(certs, time, &context, &policy, nullptr,
116 CRLPolicy::CRL_OPTIONAL, trust_store.get());
117 } else {
118 result = VerifyDeviceCert(certs, time, &context, &policy, nullptr,
119 CRLPolicy::CRL_OPTIONAL);
120 }
121 115
122 if (expected_result == RESULT_FAIL) { 116 if (expected_result == RESULT_FAIL) {
123 ASSERT_FALSE(result); 117 ASSERT_FALSE(result);
124 return; 118 return;
125 } 119 }
126 120
127 ASSERT_TRUE(result); 121 ASSERT_TRUE(result);
128 EXPECT_EQ(expected_policy, policy); 122 EXPECT_EQ(expected_policy, policy);
129 ASSERT_TRUE(context.get()); 123 ASSERT_TRUE(context.get());
130 124
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 auto context = 546 auto context =
553 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki)); 547 CertVerificationContextImplForTest(CreateString(kEx2PublicKeySpki));
554 548
555 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature), 549 EXPECT_TRUE(context->VerifySignatureOverData(CreateString(kEx2Signature),
556 CreateString(kEx2Message))); 550 CreateString(kEx2Message)));
557 } 551 }
558 552
559 } // namespace 553 } // namespace
560 554
561 } // namespace cast_certificate 555 } // namespace cast_certificate
OLDNEW
« no previous file with comments | « components/cast_certificate/cast_cert_validator_test_helpers.cc ('k') | components/cast_certificate/cast_crl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698