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

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

Issue 2079273004: Allow Cast certificates to have serial numbers greater than 20 bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove allowance of invalid serial numbers for cast roots 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/parse_certificate_unittest.cc » ('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 21 matching lines...) Expand all
32 der::Input tbs_certificate_tlv; 32 der::Input tbs_certificate_tlv;
33 der::Input signature_algorithm_tlv; 33 der::Input signature_algorithm_tlv;
34 der::BitString signature_value; 34 der::BitString signature_value;
35 if (!ParseCertificate(in, &tbs_certificate_tlv, &signature_algorithm_tlv, 35 if (!ParseCertificate(in, &tbs_certificate_tlv, &signature_algorithm_tlv,
36 &signature_value)) 36 &signature_value))
37 return; 37 return;
38 std::unique_ptr<SignatureAlgorithm> sig_alg( 38 std::unique_ptr<SignatureAlgorithm> sig_alg(
39 SignatureAlgorithm::CreateFromDer(signature_algorithm_tlv)); 39 SignatureAlgorithm::CreateFromDer(signature_algorithm_tlv));
40 40
41 ParsedTbsCertificate tbs; 41 ParsedTbsCertificate tbs;
42 if (!ParseTbsCertificate(tbs_certificate_tlv, &tbs)) 42 if (!ParseTbsCertificate(tbs_certificate_tlv, {}, &tbs))
43 return; 43 return;
44 44
45 ignore_result(VerifySerialNumber(tbs.serial_number));
46 RDNSequence subject; 45 RDNSequence subject;
47 ignore_result(ParseName(tbs.subject_tlv, &subject)); 46 ignore_result(ParseName(tbs.subject_tlv, &subject));
48 47
49 std::map<der::Input, ParsedExtension> extensions; 48 std::map<der::Input, ParsedExtension> extensions;
50 if (tbs.has_extensions && ParseExtensions(tbs.extensions_tlv, &extensions)) { 49 if (tbs.has_extensions && ParseExtensions(tbs.extensions_tlv, &extensions)) {
51 ParsedExtension extension; 50 ParsedExtension extension;
52 ParsedBasicConstraints basic_constraints; 51 ParsedBasicConstraints basic_constraints;
53 der::BitString key_usage; 52 der::BitString key_usage;
54 std::vector<der::Input> policies; 53 std::vector<der::Input> policies;
55 std::vector<der::Input> eku_oids; 54 std::vector<der::Input> eku_oids;
(...skipping 16 matching lines...) Expand all
72 } 71 }
73 72
74 } // namespace 73 } // namespace
75 } // namespace net 74 } // namespace net
76 75
77 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 76 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
78 net::der::Input in(data, size); 77 net::der::Input in(data, size);
79 net::ParseCertificateForFuzzer(in); 78 net::ParseCertificateForFuzzer(in);
80 return 0; 79 return 0;
81 } 80 }
OLDNEW
« no previous file with comments | « net/cert/internal/parse_certificate.cc ('k') | net/cert/internal/parse_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698