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

Unified Diff: net/data/parse_certificate_unittest/tbs_serial_number_21_octets_leading_0.pem

Issue 1279963003: Add a function for parsing RFC 5280's "TBSCertificate". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_mapper
Patch Set: one more comment fix Created 5 years, 4 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
Index: net/data/parse_certificate_unittest/tbs_serial_number_21_octets_leading_0.pem
diff --git a/net/data/parse_certificate_unittest/tbs_serial_number_21_octets_leading_0.pem b/net/data/parse_certificate_unittest/tbs_serial_number_21_octets_leading_0.pem
new file mode 100644
index 0000000000000000000000000000000000000000..e647313d01a6f2d630ce0b7783a254537c08dc60
--- /dev/null
+++ b/net/data/parse_certificate_unittest/tbs_serial_number_21_octets_leading_0.pem
@@ -0,0 +1,26 @@
+This is a TBSCertificate where the serial number is more than 20 octets (21
+octets, where first octet is a 0). This violates the rules in RFC 5280.
+
+
+
+-----BEGIN TBS CERTIFICATE-----
+MDWgAwIBAAIVANjDfk2H+cjIK68m71NQHfH886UgMAMEAQEwAwQBBTADBAEIMAMEAQowAwQB8w=
+=
+-----END TBS CERTIFICATE-----
+
+$ openssl asn1parse -i < [TBS CERTIFICATE]
+ 0:d=0 hl=2 l= 53 cons: SEQUENCE
+ 2:d=1 hl=2 l= 3 cons: cont [ 0 ]
+ 4:d=2 hl=2 l= 1 prim: INTEGER :00
+ 7:d=1 hl=2 l= 21 prim: INTEGER :D8C37E4D87F9C8C82BAF26EF53501DF1FCF3A520
+ 30:d=1 hl=2 l= 3 cons: SEQUENCE
+ 32:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
+ 35:d=1 hl=2 l= 3 cons: SEQUENCE
+ 37:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
+ 40:d=1 hl=2 l= 3 cons: SEQUENCE
+ 42:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08
+ 45:d=1 hl=2 l= 3 cons: SEQUENCE
+ 47:d=2 hl=2 l= 1 prim: OCTET STRING :
+
+ 50:d=1 hl=2 l= 3 cons: SEQUENCE
+ 52:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3

Powered by Google App Engine
This is Rietveld 408576698