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

Side by Side Diff: net/data/parse_certificate_unittest/tbs_negative_serial_number.pem

Issue 1285593003: Add parsing code for TBSCertificate's "validity" field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_parsing
Patch Set: rebase Created 5 years, 3 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
OLDNEW
1 This is a valid TBSCertificate. However the Serial Number is negative (which 1 This is a valid TBSCertificate. However the Serial Number is negative (which
2 strictly speaking is not correct). 2 strictly speaking is not correct).
3 3
4 4
5 5
6 -----BEGIN TBS CERTIFICATE----- 6 -----BEGIN TBS CERTIFICATE-----
7 MCigAwIBAgIIiR6QqQAANUAwAwQBATADBAEFMAMEAQgwAwQBCjADBAHz 7 MEOgAwIBAgIIiR6QqQAANUAwAwQBATADBAEFMB4XDTEyMTAxODAzMTIwMFoXDTEzMTAxODE0NTk
8 1OVowAwQBgzADBAHz
8 -----END TBS CERTIFICATE----- 9 -----END TBS CERTIFICATE-----
9 10
10 $ openssl asn1parse -i < [TBS CERTIFICATE] 11 $ openssl asn1parse -i < [TBS CERTIFICATE]
11 0:d=0 hl=2 l= 40 cons: SEQUENCE 12 0:d=0 hl=2 l= 67 cons: SEQUENCE
12 2:d=1 hl=2 l= 3 cons: cont [ 0 ] 13 2:d=1 hl=2 l= 3 cons: cont [ 0 ]
13 4:d=2 hl=2 l= 1 prim: INTEGER :02 14 4:d=2 hl=2 l= 1 prim: INTEGER :02
14 7:d=1 hl=2 l= 8 prim: INTEGER :-76E16F56FFFFCAC0 15 7:d=1 hl=2 l= 8 prim: INTEGER :-76E16F56FFFFCAC0
15 17:d=1 hl=2 l= 3 cons: SEQUENCE 16 17:d=1 hl=2 l= 3 cons: SEQUENCE
16 19:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 17 19:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
17 22:d=1 hl=2 l= 3 cons: SEQUENCE 18 22:d=1 hl=2 l= 3 cons: SEQUENCE
18 24:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 19 24:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
19 27:d=1 hl=2 l= 3 cons: SEQUENCE 20 27:d=1 hl=2 l= 30 cons: SEQUENCE
20 29:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 21 29:d=2 hl=2 l= 13 prim: UTCTIME :121018031200Z
21 32:d=1 hl=2 l= 3 cons: SEQUENCE 22 44:d=2 hl=2 l= 13 prim: UTCTIME :131018145959Z
22 34:d=2 hl=2 l= 1 prim: OCTET STRING : 23 59:d=1 hl=2 l= 3 cons: SEQUENCE
23 24 61:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
24 37:d=1 hl=2 l= 3 cons: SEQUENCE 25 64:d=1 hl=2 l= 3 cons: SEQUENCE
25 39:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 26 66:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
26 27
27 28
28 29
29 -----BEGIN SERIAL NUMBER----- 30 -----BEGIN SERIAL NUMBER-----
30 iR6QqQAANUA= 31 iR6QqQAANUA=
31 -----END SERIAL NUMBER----- 32 -----END SERIAL NUMBER-----
32 33
33 34
34 35
35 -----BEGIN SIGNATURE ALGORITHM----- 36 -----BEGIN SIGNATURE ALGORITHM-----
36 MAMEAQE= 37 MAMEAQE=
37 -----END SIGNATURE ALGORITHM----- 38 -----END SIGNATURE ALGORITHM-----
38 39
39 $ openssl asn1parse -i < [SIGNATURE ALGORITHM] 40 $ openssl asn1parse -i < [SIGNATURE ALGORITHM]
40 0:d=0 hl=2 l= 3 cons: SEQUENCE 41 0:d=0 hl=2 l= 3 cons: SEQUENCE
41 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 42 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
42 43
43 44
44 45
45 -----BEGIN ISSUER----- 46 -----BEGIN ISSUER-----
46 MAMEAQU= 47 MAMEAQU=
47 -----END ISSUER----- 48 -----END ISSUER-----
48 49
49 $ openssl asn1parse -i < [ISSUER] 50 $ openssl asn1parse -i < [ISSUER]
50 0:d=0 hl=2 l= 3 cons: SEQUENCE 51 0:d=0 hl=2 l= 3 cons: SEQUENCE
51 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 52 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
52 53
53 54
54 55
55 -----BEGIN VALIDITY----- 56 -----BEGIN VALIDITY NOTBEFORE-----
56 MAMEAQg= 57 eWVhcj0yMDEyLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0zLCBtaW51dGVzPTEyLCBzZWNvbmR
57 -----END VALIDITY----- 58 zPTA=
59 -----END VALIDITY NOTBEFORE-----
58 60
59 $ openssl asn1parse -i < [VALIDITY] 61 VALIDITY NOTBEFORE: year=2012, month=10, day=18, hours=3, minutes=12, seconds=0
60 0:d=0 hl=2 l= 3 cons: SEQUENCE 62
61 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 63
64
65 -----BEGIN VALIDITY NOTAFTER-----
66 eWVhcj0yMDEzLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0xNCwgbWludXRlcz01OSwgc2Vjb25
67 kcz01OQ==
68 -----END VALIDITY NOTAFTER-----
69
70 VALIDITY NOTAFTER: year=2013, month=10, day=18, hours=14, minutes=59, seconds=59
62 71
63 72
64 73
65 -----BEGIN SUBJECT----- 74 -----BEGIN SUBJECT-----
66 MAMEAQo= 75 MAMEAYM=
67 -----END SUBJECT----- 76 -----END SUBJECT-----
68 77
69 $ openssl asn1parse -i < [SUBJECT] 78 $ openssl asn1parse -i < [SUBJECT]
70 0:d=0 hl=2 l= 3 cons: SEQUENCE 79 0:d=0 hl=2 l= 3 cons: SEQUENCE
71 2:d=1 hl=2 l= 1 prim: OCTET STRING : 80 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
72 81
73 82
74 83
75 -----BEGIN SPKI----- 84 -----BEGIN SPKI-----
76 MAMEAfM= 85 MAMEAfM=
77 -----END SPKI----- 86 -----END SPKI-----
78 87
79 $ openssl asn1parse -i < [SPKI] 88 $ openssl asn1parse -i < [SPKI]
80 0:d=0 hl=2 l= 3 cons: SEQUENCE 89 0:d=0 hl=2 l= 3 cons: SEQUENCE
81 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 90 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698