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

Unified Diff: net/cert/internal/parse_certificate.cc

Issue 2093223002: Allow Cast certificates to have serial numbers greater than 20 bytes, as well as non-minimal INTEGE… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/parse_certificate.h ('k') | net/cert/internal/parse_certificate_fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/parse_certificate.cc
diff --git a/net/cert/internal/parse_certificate.cc b/net/cert/internal/parse_certificate.cc
index 6bf3e3ae623eb685024e621b4689af94fd97f1c5..64f729a765e318087fda2591de89a8234972e2bc 100644
--- a/net/cert/internal/parse_certificate.cc
+++ b/net/cert/internal/parse_certificate.cc
@@ -218,7 +218,9 @@ bool ParseCertificate(const der::Input& certificate_tlv,
// extensions [3] EXPLICIT Extensions OPTIONAL
// -- If present, version MUST be v3
// }
-bool ParseTbsCertificate(const der::Input& tbs_tlv, ParsedTbsCertificate* out) {
+bool ParseTbsCertificate(const der::Input& tbs_tlv,
+ const ParseCertificateOptions& options,
+ ParsedTbsCertificate* out) {
der::Parser parser(tbs_tlv);
// Certificate ::= SEQUENCE {
@@ -248,8 +250,10 @@ bool ParseTbsCertificate(const der::Input& tbs_tlv, ParsedTbsCertificate* out) {
// serialNumber CertificateSerialNumber,
if (!tbs_parser.ReadTag(der::kInteger, &out->serial_number))
return false;
- if (!VerifySerialNumber(out->serial_number))
+ if (!options.allow_invalid_serial_numbers &&
+ !VerifySerialNumber(out->serial_number)) {
return false;
+ }
// signature AlgorithmIdentifier,
if (!ReadSequenceTLV(&tbs_parser, &out->signature_algorithm_tlv))
« no previous file with comments | « net/cert/internal/parse_certificate.h ('k') | net/cert/internal/parse_certificate_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698