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

Side by Side Diff: net/cert/cert_verify_proc_builtin.cc

Issue 2800993002: Add a key purpose parameter to Certificate PathBuilder. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « net/BUILD.gn ('k') | net/cert/cert_verify_proc_unittest.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 (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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/cert/cert_verify_proc_builtin.h" 5 #include "net/cert/cert_verify_proc_builtin.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #if defined(USE_NSS_CERTS) 10 #if defined(USE_NSS_CERTS)
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 &verification_time)) { 352 &verification_time)) {
353 // This really shouldn't be possible unless Time::Now() returned 353 // This really shouldn't be possible unless Time::Now() returned
354 // something crazy. 354 // something crazy.
355 verify_result->cert_status |= CERT_STATUS_DATE_INVALID; 355 verify_result->cert_status |= CERT_STATUS_DATE_INVALID;
356 return; 356 return;
357 } 357 }
358 358
359 // Initialize the path builder. 359 // Initialize the path builder.
360 CertPathBuilder::Result result; 360 CertPathBuilder::Result result;
361 CertPathBuilder path_builder(target, trust_store->GetTrustStore(), 361 CertPathBuilder path_builder(target, trust_store->GetTrustStore(),
362 &signature_policy, verification_time, &result); 362 &signature_policy, verification_time,
363 KeyPurpose::SERVER_AUTH, &result);
363 364
364 // Allow the path builder to discover intermediates from the trust store. 365 // Allow the path builder to discover intermediates from the trust store.
365 if (trust_store->GetCertIssuerSource()) 366 if (trust_store->GetCertIssuerSource())
366 path_builder.AddCertIssuerSource(trust_store->GetCertIssuerSource()); 367 path_builder.AddCertIssuerSource(trust_store->GetCertIssuerSource());
367 368
368 // Allow the path builder to discover the explicitly provided intermediates in 369 // Allow the path builder to discover the explicitly provided intermediates in
369 // |input_cert|. 370 // |input_cert|.
370 CertIssuerSourceStatic intermediates; 371 CertIssuerSourceStatic intermediates;
371 AddIntermediatesToIssuerSource(input_cert, &intermediates); 372 AddIntermediatesToIssuerSource(input_cert, &intermediates);
372 path_builder.AddCertIssuerSource(&intermediates); 373 path_builder.AddCertIssuerSource(&intermediates);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 : OK; 436 : OK;
436 } 437 }
437 438
438 } // namespace 439 } // namespace
439 440
440 scoped_refptr<CertVerifyProc> CreateCertVerifyProcBuiltin() { 441 scoped_refptr<CertVerifyProc> CreateCertVerifyProcBuiltin() {
441 return scoped_refptr<CertVerifyProc>(new CertVerifyProcBuiltin()); 442 return scoped_refptr<CertVerifyProc>(new CertVerifyProcBuiltin());
442 } 443 }
443 444
444 } // namespace net 445 } // namespace net
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/cert/cert_verify_proc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698