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

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

Issue 2349093002: Change the interface for parsing SignatureAlgorithm to take a (Closed)
Patch Set: rebase Created 4 years, 3 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/parse_ocsp.cc ('k') | net/cert/internal/signature_algorithm.h » ('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 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
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
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
OLDNEW
« no previous file with comments | « net/cert/internal/parse_ocsp.cc ('k') | net/cert/internal/signature_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698