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

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

Issue 2453093004: Remove dependence on a message loop for net::PathBuilder. (Closed)
Patch Set: remove unnecessary forward decl Created 4 years 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 | « no previous file | components/cast_certificate/cast_crl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // Do path building and RFC 5280 compatible certificate verification using the 303 // Do path building and RFC 5280 compatible certificate verification using the
304 // two Cast trust anchors and Cast signature policy. 304 // two Cast trust anchors and Cast signature policy.
305 net::der::GeneralizedTime verification_time; 305 net::der::GeneralizedTime verification_time;
306 if (!net::der::EncodeTimeAsGeneralizedTime(time, &verification_time)) 306 if (!net::der::EncodeTimeAsGeneralizedTime(time, &verification_time))
307 return false; 307 return false;
308 net::CertPathBuilder::Result result; 308 net::CertPathBuilder::Result result;
309 net::CertPathBuilder path_builder(target_cert.get(), trust_store, 309 net::CertPathBuilder path_builder(target_cert.get(), trust_store,
310 signature_policy.get(), verification_time, 310 signature_policy.get(), verification_time,
311 &result); 311 &result);
312 path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source); 312 path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source);
313 net::CompletionStatus rv = path_builder.Run(base::Closure()); 313 path_builder.Run();
314 DCHECK_EQ(rv, net::CompletionStatus::SYNC);
315 if (!result.HasValidPath()) { 314 if (!result.HasValidPath()) {
316 // TODO(crbug.com/634443): Log error information. 315 // TODO(crbug.com/634443): Log error information.
317 return false; 316 return false;
318 } 317 }
319 318
320 // Check properties of the leaf certificate (key usage, policy), and construct 319 // Check properties of the leaf certificate (key usage, policy), and construct
321 // a CertVerificationContext that uses its public key. 320 // a CertVerificationContext that uses its public key.
322 if (!CheckTargetCertificate(target_cert.get(), context, policy)) 321 if (!CheckTargetCertificate(target_cert.get(), context, policy))
323 return false; 322 return false;
324 323
(...skipping 12 matching lines...) Expand all
337 336
338 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest( 337 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest(
339 const base::StringPiece& spki) { 338 const base::StringPiece& spki) {
340 // Use a bogus CommonName, since this is just exposed for testing signature 339 // Use a bogus CommonName, since this is just exposed for testing signature
341 // verification by unittests. 340 // verification by unittests.
342 return base::MakeUnique<CertVerificationContextImpl>(net::der::Input(spki), 341 return base::MakeUnique<CertVerificationContextImpl>(net::der::Input(spki),
343 "CommonName"); 342 "CommonName");
344 } 343 }
345 344
346 } // namespace cast_certificate 345 } // namespace cast_certificate
OLDNEW
« no previous file with comments | « no previous file | components/cast_certificate/cast_crl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698