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

Side by Side Diff: net/cert/internal/nist_pkits_unittest.cc

Issue 2903283002: Add policies support to VerifyCertificateChain(). (Closed)
Patch Set: improve comments, and null policy tree when anyPolicy is incorrectly mapped Created 3 years, 6 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/cert/internal/nist_pkits_unittest.h ('k') | net/cert/internal/path_builder.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 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/internal/nist_pkits_unittest.h" 5 #include "net/cert/internal/nist_pkits_unittest.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "net/cert/internal/certificate_policies.h" 8 #include "net/cert/internal/certificate_policies.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 PkitsTestInfo::PkitsTestInfo() { 54 PkitsTestInfo::PkitsTestInfo() {
55 SetInitialPolicySet("anyPolicy"); 55 SetInitialPolicySet("anyPolicy");
56 SetUserConstrainedPolicySet("NIST-test-policy-1"); 56 SetUserConstrainedPolicySet("NIST-test-policy-1");
57 } 57 }
58 58
59 void PkitsTestInfo::SetInitialExplicitPolicy(bool b) { 59 void PkitsTestInfo::SetInitialExplicitPolicy(bool b) {
60 initial_explicit_policy = b; 60 initial_explicit_policy =
61 b ? InitialExplicitPolicy::kTrue : InitialExplicitPolicy::kFalse;
61 } 62 }
62 63
63 void PkitsTestInfo::SetInitialPolicyMappingInhibit(bool b) { 64 void PkitsTestInfo::SetInitialPolicyMappingInhibit(bool b) {
64 initial_policy_mapping_inhibit = b; 65 initial_policy_mapping_inhibit = b ? InitialPolicyMappingInhibit::kTrue
66 : InitialPolicyMappingInhibit::kFalse;
65 } 67 }
66 68
67 void PkitsTestInfo::SetInitialInhibitAnyPolicy(bool b) { 69 void PkitsTestInfo::SetInitialInhibitAnyPolicy(bool b) {
68 initial_inhibit_any_policy = b; 70 initial_inhibit_any_policy =
71 b ? InitialAnyPolicyInhibit::kTrue : InitialAnyPolicyInhibit::kFalse;
69 } 72 }
70 73
71 PkitsTestInfo::~PkitsTestInfo() = default; 74 PkitsTestInfo::~PkitsTestInfo() = default;
72 75
73 void PkitsTestInfo::SetInitialPolicySet(const char* const policy_names) { 76 void PkitsTestInfo::SetInitialPolicySet(const char* const policy_names) {
74 SetPolicySetFromString(policy_names, &initial_policy_set); 77 SetPolicySetFromString(policy_names, &initial_policy_set);
75 } 78 }
76 79
77 void PkitsTestInfo::SetUserConstrainedPolicySet( 80 void PkitsTestInfo::SetUserConstrainedPolicySet(
78 const char* const policy_names) { 81 const char* const policy_names) {
79 SetPolicySetFromString(policy_names, &user_constrained_policy_set); 82 SetPolicySetFromString(policy_names, &user_constrained_policy_set);
80 } 83 }
81 84
82 } // namespace net 85 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/nist_pkits_unittest.h ('k') | net/cert/internal/path_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698