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

Unified Diff: net/data/parse_certificate_unittest/tbs_negative_serial_number.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_negative_serial_number.pem
diff --git a/net/data/parse_certificate_unittest/tbs_negative_serial_number.pem b/net/data/parse_certificate_unittest/tbs_negative_serial_number.pem
new file mode 100644
index 0000000000000000000000000000000000000000..143394065a5e00c19f30b920b3dfdc6009624e27
--- /dev/null
+++ b/net/data/parse_certificate_unittest/tbs_negative_serial_number.pem
@@ -0,0 +1,81 @@
+This is a valid TBSCertificate. However the Serial Number is negative (which
+strictly speaking is not correct).
+
+
+
+-----BEGIN TBS CERTIFICATE-----
+MCigAwIBAgIIiR6QqQAANUAwAwQBATADBAEFMAMEAQgwAwQBCjADBAHz
+-----END TBS CERTIFICATE-----
+
+$ openssl asn1parse -i < [TBS CERTIFICATE]
+ 0:d=0 hl=2 l= 40 cons: SEQUENCE
+ 2:d=1 hl=2 l= 3 cons: cont [ 0 ]
+ 4:d=2 hl=2 l= 1 prim: INTEGER :02
+ 7:d=1 hl=2 l= 8 prim: INTEGER :-76E16F56FFFFCAC0
+ 17:d=1 hl=2 l= 3 cons: SEQUENCE
+ 19:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
+ 22:d=1 hl=2 l= 3 cons: SEQUENCE
+ 24:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
+ 27:d=1 hl=2 l= 3 cons: SEQUENCE
+ 29:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08
+ 32:d=1 hl=2 l= 3 cons: SEQUENCE
+ 34:d=2 hl=2 l= 1 prim: OCTET STRING :
+
+ 37:d=1 hl=2 l= 3 cons: SEQUENCE
+ 39:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
+
+
+
+-----BEGIN SERIAL NUMBER-----
+iR6QqQAANUA=
+-----END SERIAL NUMBER-----
+
+
+
+-----BEGIN SIGNATURE ALGORITHM-----
+MAMEAQE=
+-----END SIGNATURE ALGORITHM-----
+
+$ openssl asn1parse -i < [SIGNATURE ALGORITHM]
+ 0:d=0 hl=2 l= 3 cons: SEQUENCE
+ 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
+
+
+
+-----BEGIN ISSUER-----
+MAMEAQU=
+-----END ISSUER-----
+
+$ openssl asn1parse -i < [ISSUER]
+ 0:d=0 hl=2 l= 3 cons: SEQUENCE
+ 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
+
+
+
+-----BEGIN VALIDITY-----
+MAMEAQg=
+-----END VALIDITY-----
+
+$ openssl asn1parse -i < [VALIDITY]
+ 0:d=0 hl=2 l= 3 cons: SEQUENCE
+ 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08
+
+
+
+-----BEGIN SUBJECT-----
+MAMEAQo=
+-----END SUBJECT-----
+
+$ openssl asn1parse -i < [SUBJECT]
+ 0:d=0 hl=2 l= 3 cons: SEQUENCE
+ 2:d=1 hl=2 l= 1 prim: OCTET STRING :
+
+
+
+-----BEGIN SPKI-----
+MAMEAfM=
+-----END SPKI-----
+
+$ openssl asn1parse -i < [SPKI]
+ 0:d=0 hl=2 l= 3 cons: SEQUENCE
+ 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3

Powered by Google App Engine
This is Rietveld 408576698