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

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

Issue 2036033002: Add CertIssuerSourceAia: authorityInfoAccess fetching for CertPathBuilder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-parsing-path-building
Patch Set: remove orphaned kw_args change, remove g_cur_path_id change from this cl Created 4 years, 6 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_certificate.cc ('k') | net/cert/internal/parsed_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 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "net/cert/internal/certificate_policies.h" 9 #include "net/cert/internal/certificate_policies.h"
10 #include "net/cert/internal/extended_key_usage.h" 10 #include "net/cert/internal/extended_key_usage.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 RDNSequence subject; 46 RDNSequence subject;
47 ignore_result(ParseName(tbs.subject_tlv, &subject)); 47 ignore_result(ParseName(tbs.subject_tlv, &subject));
48 48
49 std::map<der::Input, ParsedExtension> extensions; 49 std::map<der::Input, ParsedExtension> extensions;
50 if (tbs.has_extensions && ParseExtensions(tbs.extensions_tlv, &extensions)) { 50 if (tbs.has_extensions && ParseExtensions(tbs.extensions_tlv, &extensions)) {
51 ParsedExtension extension; 51 ParsedExtension extension;
52 ParsedBasicConstraints basic_constraints; 52 ParsedBasicConstraints basic_constraints;
53 der::BitString key_usage; 53 der::BitString key_usage;
54 std::vector<der::Input> policies; 54 std::vector<der::Input> policies;
55 std::vector<der::Input> eku_oids; 55 std::vector<der::Input> eku_oids;
56 std::vector<base::StringPiece> ca_issuers_uris;
57 std::vector<base::StringPiece> ocsp_uris;
56 if (FindExtension(BasicConstraintsOid(), &extensions, &extension)) 58 if (FindExtension(BasicConstraintsOid(), &extensions, &extension))
57 ignore_result(ParseBasicConstraints(extension.value, &basic_constraints)); 59 ignore_result(ParseBasicConstraints(extension.value, &basic_constraints));
58 if (FindExtension(KeyUsageOid(), &extensions, &extension)) 60 if (FindExtension(KeyUsageOid(), &extensions, &extension))
59 ignore_result(ParseKeyUsage(extension.value, &key_usage)); 61 ignore_result(ParseKeyUsage(extension.value, &key_usage));
60 if (FindExtension(SubjectAltNameOid(), &extensions, &extension)) 62 if (FindExtension(SubjectAltNameOid(), &extensions, &extension))
61 GeneralNames::CreateFromDer(extension.value); 63 GeneralNames::CreateFromDer(extension.value);
62 if (FindExtension(CertificatePoliciesOid(), &extensions, &extension)) 64 if (FindExtension(CertificatePoliciesOid(), &extensions, &extension))
63 ParseCertificatePoliciesExtension(extension.value, &policies); 65 ParseCertificatePoliciesExtension(extension.value, &policies);
64 if (FindExtension(ExtKeyUsageOid(), &extensions, &extension)) 66 if (FindExtension(ExtKeyUsageOid(), &extensions, &extension))
65 ParseEKUExtension(extension.value, &eku_oids); 67 ParseEKUExtension(extension.value, &eku_oids);
68 if (FindExtension(AuthorityInfoAccessOid(), &extensions, &extension))
69 ignore_result(ParseAuthorityInfoAccess(extension.value, &ca_issuers_uris,
70 &ocsp_uris));
66 } 71 }
67 } 72 }
68 73
69 } // namespace 74 } // namespace
70 } // namespace net 75 } // namespace net
71 76
72 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 77 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
73 net::der::Input in(data, size); 78 net::der::Input in(data, size);
74 net::ParseCertificateForFuzzer(in); 79 net::ParseCertificateForFuzzer(in);
75 return 0; 80 return 0;
76 } 81 }
OLDNEW
« no previous file with comments | « net/cert/internal/parse_certificate.cc ('k') | net/cert/internal/parsed_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698