OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ | 5 #ifndef NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ |
6 #define NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ | 6 #define NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // the OCTET STRING tag). |is_critical| should be true if the extension was | 79 // the OCTET STRING tag). |is_critical| should be true if the extension was |
80 // marked critical. Returns nullptr if parsing the the extension failed. | 80 // marked critical. Returns nullptr if parsing the the extension failed. |
81 // The object lifetime is not bound to the lifetime of |extension_value| data. | 81 // The object lifetime is not bound to the lifetime of |extension_value| data. |
82 static scoped_ptr<NameConstraints> CreateFromDer( | 82 static scoped_ptr<NameConstraints> CreateFromDer( |
83 const der::Input& extension_value, | 83 const der::Input& extension_value, |
84 bool is_critical); | 84 bool is_critical); |
85 | 85 |
86 // Tests if a certificate is allowed by the name constraints. | 86 // Tests if a certificate is allowed by the name constraints. |
87 // |subject_rdn_sequence| should be the DER-encoded value of the subject's | 87 // |subject_rdn_sequence| should be the DER-encoded value of the subject's |
88 // RDNSequence (not including Sequence tag), and may be an empty ASN.1 | 88 // RDNSequence (not including Sequence tag), and may be an empty ASN.1 |
89 // sequence. |subject_alt_name_extnvalue_tlv| should be the extnValue of the | 89 // sequence. |subject_alt_name_extnvalue_tlv| should be the extnValue of the |
eroman
2016/02/10 17:30:09
Update this line to reflect new variable name.
mattm
2016/02/10 22:48:40
Done.
| |
90 // subjectAltName extension (including the OCTET STRING tag & length), or | 90 // subjectAltName extension (not including the OCTET STRING tag & length), or |
91 // empty if the cert did not have a subjectAltName extension. | 91 // empty if the cert did not have a subjectAltName extension. |
eroman
2016/02/10 17:30:09
This line also needs updating (since that is now c
mattm
2016/02/10 22:48:40
Done.
| |
92 // Note that this method does not check hostname or IP address in commonName, | 92 // Note that this method does not check hostname or IP address in commonName, |
93 // which is deprecated (crbug.com/308330). | 93 // which is deprecated (crbug.com/308330). |
94 bool IsPermittedCert(const der::Input& subject_rdn_sequence, | 94 bool IsPermittedCert(const der::Input& subject_rdn_sequence, |
95 const der::Input& subject_alt_name_extnvalue_tlv) const; | 95 bool has_subject_alt_name, |
96 const der::Input& subject_alt_name_tlv) const; | |
96 | 97 |
97 // Returns true if the ASCII hostname |name| is permitted. | 98 // Returns true if the ASCII hostname |name| is permitted. |
98 // |name| may be a wildcard hostname (starts with "*."). Eg, "*.bar.com" | 99 // |name| may be a wildcard hostname (starts with "*."). Eg, "*.bar.com" |
99 // would not be permitted if "bar.com" is permitted and "foo.bar.com" is | 100 // would not be permitted if "bar.com" is permitted and "foo.bar.com" is |
100 // excluded, while "*.baz.com" would only be permitted if "baz.com" is | 101 // excluded, while "*.baz.com" would only be permitted if "baz.com" is |
101 // permitted. | 102 // permitted. |
102 bool IsPermittedDNSName(const std::string& name) const; | 103 bool IsPermittedDNSName(const std::string& name) const; |
103 | 104 |
104 // Returns true if the directoryName |name_rdn_sequence| is permitted. | 105 // Returns true if the directoryName |name_rdn_sequence| is permitted. |
105 // |name_rdn_sequence| should be the DER-encoded RDNSequence value (not | 106 // |name_rdn_sequence| should be the DER-encoded RDNSequence value (not |
(...skipping 23 matching lines...) Expand all Loading... | |
129 bool Parse(const der::Input& extension_value, | 130 bool Parse(const der::Input& extension_value, |
130 bool is_critical) WARN_UNUSED_RESULT; | 131 bool is_critical) WARN_UNUSED_RESULT; |
131 | 132 |
132 GeneralNames permitted_subtrees_; | 133 GeneralNames permitted_subtrees_; |
133 GeneralNames excluded_subtrees_; | 134 GeneralNames excluded_subtrees_; |
134 }; | 135 }; |
135 | 136 |
136 } // namespace net | 137 } // namespace net |
137 | 138 |
138 #endif // NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ | 139 #endif // NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_ |
OLD | NEW |