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

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

Issue 2359783003: Convert tests that parse an Extension value to instead (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
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return CreateInternal(data, length, DataSource::EXTERNAL_REFERENCE, options, 72 return CreateInternal(data, length, DataSource::EXTERNAL_REFERENCE, options,
73 errors); 73 errors);
74 } 74 }
75 75
76 scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal( 76 scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal(
77 const uint8_t* data, 77 const uint8_t* data,
78 size_t length, 78 size_t length,
79 DataSource source, 79 DataSource source,
80 const ParseCertificateOptions& options, 80 const ParseCertificateOptions& options,
81 CertErrors* errors) { 81 CertErrors* errors) {
82 // TODO(crbug.com/634443): Add errors
82 scoped_refptr<ParsedCertificate> result(new ParsedCertificate); 83 scoped_refptr<ParsedCertificate> result(new ParsedCertificate);
83 84
84 switch (source) { 85 switch (source) {
85 case DataSource::INTERNAL_COPY: 86 case DataSource::INTERNAL_COPY:
86 result->cert_data_.assign(data, data + length); 87 result->cert_data_.assign(data, data + length);
87 result->cert_ = 88 result->cert_ =
88 der::Input(result->cert_data_.data(), result->cert_data_.size()); 89 der::Input(result->cert_data_.data(), result->cert_data_.size());
89 break; 90 break;
90 case DataSource::EXTERNAL_REFERENCE: 91 case DataSource::EXTERNAL_REFERENCE:
91 result->cert_ = der::Input(data, length); 92 result->cert_ = der::Input(data, length);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // NOTE: if additional extensions are consumed here, the verification code 194 // NOTE: if additional extensions are consumed here, the verification code
194 // must be updated to process those extensions, since the 195 // must be updated to process those extensions, since the
195 // VerifyNoUnconsumedCriticalExtensions uses the unparsed_extensions_ 196 // VerifyNoUnconsumedCriticalExtensions uses the unparsed_extensions_
196 // variable to tell which extensions were processed. 197 // variable to tell which extensions were processed.
197 } 198 }
198 199
199 return result; 200 return result;
200 } 201 }
201 202
202 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/parse_certificate_unittest.cc ('k') | net/data/parse_certificate_unittest/extension_critical.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698