OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/parsed_certificate.h" | 5 #include "net/cert/internal/parsed_certificate.h" |
6 | 6 |
7 #include "net/cert/internal/name_constraints.h" | 7 #include "net/cert/internal/name_constraints.h" |
8 #include "net/cert/internal/signature_algorithm.h" | 8 #include "net/cert/internal/signature_algorithm.h" |
9 #include "net/cert/internal/verify_name_match.h" | 9 #include "net/cert/internal/verify_name_match.h" |
10 #include "net/der/parser.h" | 10 #include "net/der/parser.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 errors)) { | 102 errors)) { |
103 return nullptr; | 103 return nullptr; |
104 } | 104 } |
105 | 105 |
106 // Attempt to parse the signature algorithm contained in the Certificate. | 106 // Attempt to parse the signature algorithm contained in the Certificate. |
107 // Do not give up on failure here, since SignatureAlgorithm::CreateFromDer | 107 // Do not give up on failure here, since SignatureAlgorithm::CreateFromDer |
108 // will fail on valid but unsupported signature algorithms. | 108 // will fail on valid but unsupported signature algorithms. |
109 // TODO(mattm): should distinguish between unsupported algorithms and parsing | 109 // TODO(mattm): should distinguish between unsupported algorithms and parsing |
110 // errors. | 110 // errors. |
111 result->signature_algorithm_ = | 111 result->signature_algorithm_ = |
112 SignatureAlgorithm::CreateFromDer(result->signature_algorithm_tlv_); | 112 SignatureAlgorithm::Create(result->signature_algorithm_tlv_, errors); |
113 | 113 |
114 der::Input subject_value; | 114 der::Input subject_value; |
115 if (!GetSequenceValue(result->tbs_.subject_tlv, &subject_value) || | 115 if (!GetSequenceValue(result->tbs_.subject_tlv, &subject_value) || |
116 !NormalizeName(subject_value, &result->normalized_subject_)) { | 116 !NormalizeName(subject_value, &result->normalized_subject_)) { |
117 return nullptr; | 117 return nullptr; |
118 } | 118 } |
119 der::Input issuer_value; | 119 der::Input issuer_value; |
120 if (!GetSequenceValue(result->tbs_.issuer_tlv, &issuer_value) || | 120 if (!GetSequenceValue(result->tbs_.issuer_tlv, &issuer_value) || |
121 !NormalizeName(issuer_value, &result->normalized_issuer_)) { | 121 !NormalizeName(issuer_value, &result->normalized_issuer_)) { |
122 return nullptr; | 122 return nullptr; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // NOTE: if additional extensions are consumed here, the verification code | 193 // NOTE: if additional extensions are consumed here, the verification code |
194 // must be updated to process those extensions, since the | 194 // must be updated to process those extensions, since the |
195 // VerifyNoUnconsumedCriticalExtensions uses the unparsed_extensions_ | 195 // VerifyNoUnconsumedCriticalExtensions uses the unparsed_extensions_ |
196 // variable to tell which extensions were processed. | 196 // variable to tell which extensions were processed. |
197 } | 197 } |
198 | 198 |
199 return result; | 199 return result; |
200 } | 200 } |
201 | 201 |
202 } // namespace net | 202 } // namespace net |
OLD | NEW |