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

Side by Side Diff: components/cast_certificate/cast_cert_validator.cc

Issue 1969293002: Remove net::ParsedCertificate struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | net/cert/internal/parse_certificate.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/cast_certificate/cast_cert_validator.h" 5 #include "components/cast_certificate/cast_cert_validator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // * THe Extended Key Usage must includ TLS Client Auth 170 // * THe Extended Key Usage must includ TLS Client Auth
171 // * May have the policy 1.3.6.1.4.1.11129.2.5.2 to indicate it 171 // * May have the policy 1.3.6.1.4.1.11129.2.5.2 to indicate it
172 // is an audio-only device. 172 // is an audio-only device.
173 WARN_UNUSED_RESULT bool CheckTargetCertificate( 173 WARN_UNUSED_RESULT bool CheckTargetCertificate(
174 const net::der::Input& cert_der, 174 const net::der::Input& cert_der,
175 std::unique_ptr<CertVerificationContext>* context, 175 std::unique_ptr<CertVerificationContext>* context,
176 CastDeviceCertPolicy* policy) { 176 CastDeviceCertPolicy* policy) {
177 // TODO(eroman): Simplify this. The certificate chain verification 177 // TODO(eroman): Simplify this. The certificate chain verification
178 // function already parses this stuff, awkward to re-do it here. 178 // function already parses this stuff, awkward to re-do it here.
179 179
180 net::ParsedCertificate cert; 180 net::der::Input tbs_certificate_tlv;
181 if (!net::ParseCertificate(cert_der, &cert)) 181 net::der::Input signature_algorithm_tlv;
182 net::der::BitString signature_value;
183 if (!net::ParseCertificate(cert_der, &tbs_certificate_tlv,
184 &signature_algorithm_tlv, &signature_value))
182 return false; 185 return false;
183 186
184 net::ParsedTbsCertificate tbs; 187 net::ParsedTbsCertificate tbs;
185 if (!net::ParseTbsCertificate(cert.tbs_certificate_tlv, &tbs)) 188 if (!net::ParseTbsCertificate(tbs_certificate_tlv, &tbs))
186 return false; 189 return false;
187 190
188 // Get the extensions. 191 // Get the extensions.
189 if (!tbs.has_extensions) 192 if (!tbs.has_extensions)
190 return false; 193 return false;
191 ExtensionsMap extensions; 194 ExtensionsMap extensions;
192 if (!net::ParseExtensions(tbs.extensions_tlv, &extensions)) 195 if (!net::ParseExtensions(tbs.extensions_tlv, &extensions))
193 return false; 196 return false;
194 197
195 net::der::Input extension_value; 198 net::der::Input extension_value;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 return base::WrapUnique( 291 return base::WrapUnique(
289 new CertVerificationContextImpl(net::der::Input(spki), "CommonName")); 292 new CertVerificationContextImpl(net::der::Input(spki), "CommonName"));
290 } 293 }
291 294
292 bool AddTrustAnchorForTest(const uint8_t* data, size_t length) { 295 bool AddTrustAnchorForTest(const uint8_t* data, size_t length) {
293 return CastTrustStore::Get().AddTrustedCertificateWithoutCopying(data, 296 return CastTrustStore::Get().AddTrustedCertificateWithoutCopying(data,
294 length); 297 length);
295 } 298 }
296 299
297 } // namespace cast_certificate 300 } // namespace cast_certificate
OLDNEW
« no previous file with comments | « no previous file | net/cert/internal/parse_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698