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

Side by Side Diff: net/data/parse_certificate_unittest/tbs_v3_extensions.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 very basic TBSCertificate. It is valid from the perspective of 1 This is a very basic TBSCertificate. It is valid from the perspective of
2 ParseTbsCertificate(), however its sub-fields are mainly bogus. This 2 ParseTbsCertificate(), however its sub-fields are mainly bogus. This
3 TBSCertificate contains no optional fields (no issuerUniqueID, subjectUniqueID, 3 TBSCertificate contains extensions.
4 extensions)
5
6 4
7 5
8 -----BEGIN TBS CERTIFICATE----- 6 -----BEGIN TBS CERTIFICATE-----
9 MCigAwIBAgIBATADBAEBMAMEAQUwAwQBCDADBAEKMAMEAfOjBTADBAHd 7 MEOgAwIBAgIBATADBAEBMAMEAQUwHhcNMTIxMDE4MDMxMjAwWhcNMTMxMDE4MTQ1OTU5WjADBAG
8 DMAMEAfOjBTADBAHd
10 -----END TBS CERTIFICATE----- 9 -----END TBS CERTIFICATE-----
11 10
12 $ openssl asn1parse -i < [TBS CERTIFICATE] 11 $ openssl asn1parse -i < [TBS CERTIFICATE]
13 0:d=0 hl=2 l= 40 cons: SEQUENCE 12 0:d=0 hl=2 l= 67 cons: SEQUENCE
14 2:d=1 hl=2 l= 3 cons: cont [ 0 ] 13 2:d=1 hl=2 l= 3 cons: cont [ 0 ]
15 4:d=2 hl=2 l= 1 prim: INTEGER :02 14 4:d=2 hl=2 l= 1 prim: INTEGER :02
16 7:d=1 hl=2 l= 1 prim: INTEGER :01 15 7:d=1 hl=2 l= 1 prim: INTEGER :01
17 10:d=1 hl=2 l= 3 cons: SEQUENCE 16 10:d=1 hl=2 l= 3 cons: SEQUENCE
18 12:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 17 12:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
19 15:d=1 hl=2 l= 3 cons: SEQUENCE 18 15:d=1 hl=2 l= 3 cons: SEQUENCE
20 17:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 19 17:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
21 20:d=1 hl=2 l= 3 cons: SEQUENCE 20 20:d=1 hl=2 l= 30 cons: SEQUENCE
22 22:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 21 22:d=2 hl=2 l= 13 prim: UTCTIME :121018031200Z
23 25:d=1 hl=2 l= 3 cons: SEQUENCE 22 37:d=2 hl=2 l= 13 prim: UTCTIME :131018145959Z
24 27:d=2 hl=2 l= 1 prim: OCTET STRING : 23 52:d=1 hl=2 l= 3 cons: SEQUENCE
25 24 54:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
26 30:d=1 hl=2 l= 3 cons: SEQUENCE 25 57:d=1 hl=2 l= 3 cons: SEQUENCE
27 32:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 26 59:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
28 35:d=1 hl=2 l= 5 cons: cont [ 3 ] 27 62:d=1 hl=2 l= 5 cons: cont [ 3 ]
29 37:d=2 hl=2 l= 3 cons: SEQUENCE 28 64:d=2 hl=2 l= 3 cons: SEQUENCE
30 39:d=3 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:DD 29 66:d=3 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:DD
31 30
32 31
33 32
34 -----BEGIN SERIAL NUMBER----- 33 -----BEGIN SERIAL NUMBER-----
35 AQ== 34 AQ==
36 -----END SERIAL NUMBER----- 35 -----END SERIAL NUMBER-----
37 36
38 37
39 38
40 -----BEGIN SIGNATURE ALGORITHM----- 39 -----BEGIN SIGNATURE ALGORITHM-----
41 MAMEAQE= 40 MAMEAQE=
42 -----END SIGNATURE ALGORITHM----- 41 -----END SIGNATURE ALGORITHM-----
43 42
44 $ openssl asn1parse -i < [SIGNATURE ALGORITHM] 43 $ openssl asn1parse -i < [SIGNATURE ALGORITHM]
45 0:d=0 hl=2 l= 3 cons: SEQUENCE 44 0:d=0 hl=2 l= 3 cons: SEQUENCE
46 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 45 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
47 46
48 47
49 48
50 -----BEGIN ISSUER----- 49 -----BEGIN ISSUER-----
51 MAMEAQU= 50 MAMEAQU=
52 -----END ISSUER----- 51 -----END ISSUER-----
53 52
54 $ openssl asn1parse -i < [ISSUER] 53 $ openssl asn1parse -i < [ISSUER]
55 0:d=0 hl=2 l= 3 cons: SEQUENCE 54 0:d=0 hl=2 l= 3 cons: SEQUENCE
56 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 55 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
57 56
58 57
59 58
60 -----BEGIN VALIDITY----- 59 -----BEGIN VALIDITY NOTBEFORE-----
61 MAMEAQg= 60 eWVhcj0yMDEyLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0zLCBtaW51dGVzPTEyLCBzZWNvbmR
62 -----END VALIDITY----- 61 zPTA=
62 -----END VALIDITY NOTBEFORE-----
63 63
64 $ openssl asn1parse -i < [VALIDITY] 64 VALIDITY NOTBEFORE: year=2012, month=10, day=18, hours=3, minutes=12, seconds=0
65 0:d=0 hl=2 l= 3 cons: SEQUENCE 65
66 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 66
67
68 -----BEGIN VALIDITY NOTAFTER-----
69 eWVhcj0yMDEzLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0xNCwgbWludXRlcz01OSwgc2Vjb25
70 kcz01OQ==
71 -----END VALIDITY NOTAFTER-----
72
73 VALIDITY NOTAFTER: year=2013, month=10, day=18, hours=14, minutes=59, seconds=59
67 74
68 75
69 76
70 -----BEGIN SUBJECT----- 77 -----BEGIN SUBJECT-----
71 MAMEAQo= 78 MAMEAYM=
72 -----END SUBJECT----- 79 -----END SUBJECT-----
73 80
74 $ openssl asn1parse -i < [SUBJECT] 81 $ openssl asn1parse -i < [SUBJECT]
75 0:d=0 hl=2 l= 3 cons: SEQUENCE 82 0:d=0 hl=2 l= 3 cons: SEQUENCE
76 2:d=1 hl=2 l= 1 prim: OCTET STRING : 83 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
77 84
78 85
79 86
80 -----BEGIN SPKI----- 87 -----BEGIN SPKI-----
81 MAMEAfM= 88 MAMEAfM=
82 -----END SPKI----- 89 -----END SPKI-----
83 90
84 $ openssl asn1parse -i < [SPKI] 91 $ openssl asn1parse -i < [SPKI]
85 0:d=0 hl=2 l= 3 cons: SEQUENCE 92 0:d=0 hl=2 l= 3 cons: SEQUENCE
86 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 93 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
87 94
88 95
89 96
90 -----BEGIN EXTENSIONS----- 97 -----BEGIN EXTENSIONS-----
91 MAMEAd0= 98 MAMEAd0=
92 -----END EXTENSIONS----- 99 -----END EXTENSIONS-----
93 100
94 $ openssl asn1parse -i < [EXTENSIONS] 101 $ openssl asn1parse -i < [EXTENSIONS]
95 0:d=0 hl=2 l= 3 cons: SEQUENCE 102 0:d=0 hl=2 l= 3 cons: SEQUENCE
96 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:DD 103 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:DD
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698