OLD | NEW |
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 Loading... |
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 = | 60 initial_explicit_policy = b; |
61 b ? InitialExplicitPolicy::kTrue : InitialExplicitPolicy::kFalse; | |
62 } | 61 } |
63 | 62 |
64 void PkitsTestInfo::SetInitialPolicyMappingInhibit(bool b) { | 63 void PkitsTestInfo::SetInitialPolicyMappingInhibit(bool b) { |
65 initial_policy_mapping_inhibit = b ? InitialPolicyMappingInhibit::kTrue | 64 initial_policy_mapping_inhibit = b; |
66 : InitialPolicyMappingInhibit::kFalse; | |
67 } | 65 } |
68 | 66 |
69 void PkitsTestInfo::SetInitialInhibitAnyPolicy(bool b) { | 67 void PkitsTestInfo::SetInitialInhibitAnyPolicy(bool b) { |
70 initial_inhibit_any_policy = | 68 initial_inhibit_any_policy = b; |
71 b ? InitialAnyPolicyInhibit::kTrue : InitialAnyPolicyInhibit::kFalse; | |
72 } | 69 } |
73 | 70 |
74 PkitsTestInfo::~PkitsTestInfo() = default; | 71 PkitsTestInfo::~PkitsTestInfo() = default; |
75 | 72 |
76 void PkitsTestInfo::SetInitialPolicySet(const char* const policy_names) { | 73 void PkitsTestInfo::SetInitialPolicySet(const char* const policy_names) { |
77 SetPolicySetFromString(policy_names, &initial_policy_set); | 74 SetPolicySetFromString(policy_names, &initial_policy_set); |
78 } | 75 } |
79 | 76 |
80 void PkitsTestInfo::SetUserConstrainedPolicySet( | 77 void PkitsTestInfo::SetUserConstrainedPolicySet( |
81 const char* const policy_names) { | 78 const char* const policy_names) { |
82 SetPolicySetFromString(policy_names, &user_constrained_policy_set); | 79 SetPolicySetFromString(policy_names, &user_constrained_policy_set); |
83 } | 80 } |
84 | 81 |
85 } // namespace net | 82 } // namespace net |
OLD | NEW |