]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-15-certificate.c
Security-57337.20.44.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-15-certificate.c
1 /*
2 * Copyright (c) 2008-2010,2012 Apple Inc. All Rights Reserved.
3 */
4
5 #include <CoreFoundation/CoreFoundation.h>
6 #include <Security/SecCertificatePriv.h>
7 #include <Security/SecPolicy.h>
8 #include <Security/SecTrust.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11
12 #include "Security_regressions.h"
13
14 /*
15 Apple Inc. CA
16 */
17 static const uint8_t _c0[] = {
18 0x30, 0x82, 0x04, 0xbb, 0x30, 0x82, 0x03, 0xa3,
19 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02,
20 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
21 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30,
22 0x62, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
23 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
24 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
25 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
26 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
27 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70,
28 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
29 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
30 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
31 0x69, 0x74, 0x79, 0x31, 0x16, 0x30, 0x14, 0x06,
32 0x03, 0x55, 0x04, 0x03, 0x13, 0x0d, 0x41, 0x70,
33 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74,
34 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30,
35 0x36, 0x30, 0x34, 0x32, 0x35, 0x32, 0x31, 0x34,
36 0x30, 0x33, 0x36, 0x5a, 0x17, 0x0d, 0x33, 0x35,
37 0x30, 0x32, 0x30, 0x39, 0x32, 0x31, 0x34, 0x30,
38 0x33, 0x36, 0x5a, 0x30, 0x62, 0x31, 0x0b, 0x30,
39 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
40 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
41 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
42 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31,
43 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x0b,
44 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
45 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
46 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
47 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31,
48 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03,
49 0x13, 0x0d, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
50 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x30,
51 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a,
52 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
53 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30,
54 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00,
55 0xe4, 0x91, 0xa9, 0x09, 0x1f, 0x91, 0xdb, 0x1e,
56 0x47, 0x50, 0xeb, 0x05, 0xed, 0x5e, 0x79, 0x84,
57 0x2d, 0xeb, 0x36, 0xa2, 0x57, 0x4c, 0x55, 0xec,
58 0x8b, 0x19, 0x89, 0xde, 0xf9, 0x4b, 0x6c, 0xf5,
59 0x07, 0xab, 0x22, 0x30, 0x02, 0xe8, 0x18, 0x3e,
60 0xf8, 0x50, 0x09, 0xd3, 0x7f, 0x41, 0xa8, 0x98,
61 0xf9, 0xd1, 0xca, 0x66, 0x9c, 0x24, 0x6b, 0x11,
62 0xd0, 0xa3, 0xbb, 0xe4, 0x1b, 0x2a, 0xc3, 0x1f,
63 0x95, 0x9e, 0x7a, 0x0c, 0xa4, 0x47, 0x8b, 0x5b,
64 0xd4, 0x16, 0x37, 0x33, 0xcb, 0xc4, 0x0f, 0x4d,
65 0xce, 0x14, 0x69, 0xd1, 0xc9, 0x19, 0x72, 0xf5,
66 0x5d, 0x0e, 0xd5, 0x7f, 0x5f, 0x9b, 0xf2, 0x25,
67 0x03, 0xba, 0x55, 0x8f, 0x4d, 0x5d, 0x0d, 0xf1,
68 0x64, 0x35, 0x23, 0x15, 0x4b, 0x15, 0x59, 0x1d,
69 0xb3, 0x94, 0xf7, 0xf6, 0x9c, 0x9e, 0xcf, 0x50,
70 0xba, 0xc1, 0x58, 0x50, 0x67, 0x8f, 0x08, 0xb4,
71 0x20, 0xf7, 0xcb, 0xac, 0x2c, 0x20, 0x6f, 0x70,
72 0xb6, 0x3f, 0x01, 0x30, 0x8c, 0xb7, 0x43, 0xcf,
73 0x0f, 0x9d, 0x3d, 0xf3, 0x2b, 0x49, 0x28, 0x1a,
74 0xc8, 0xfe, 0xce, 0xb5, 0xb9, 0x0e, 0xd9, 0x5e,
75 0x1c, 0xd6, 0xcb, 0x3d, 0xb5, 0x3a, 0xad, 0xf4,
76 0x0f, 0x0e, 0x00, 0x92, 0x0b, 0xb1, 0x21, 0x16,
77 0x2e, 0x74, 0xd5, 0x3c, 0x0d, 0xdb, 0x62, 0x16,
78 0xab, 0xa3, 0x71, 0x92, 0x47, 0x53, 0x55, 0xc1,
79 0xaf, 0x2f, 0x41, 0xb3, 0xf8, 0xfb, 0xe3, 0x70,
80 0xcd, 0xe6, 0xa3, 0x4c, 0x45, 0x7e, 0x1f, 0x4c,
81 0x6b, 0x50, 0x96, 0x41, 0x89, 0xc4, 0x74, 0x62,
82 0x0b, 0x10, 0x83, 0x41, 0x87, 0x33, 0x8a, 0x81,
83 0xb1, 0x30, 0x58, 0xec, 0x5a, 0x04, 0x32, 0x8c,
84 0x68, 0xb3, 0x8f, 0x1d, 0xde, 0x65, 0x73, 0xff,
85 0x67, 0x5e, 0x65, 0xbc, 0x49, 0xd8, 0x76, 0x9f,
86 0x33, 0x14, 0x65, 0xa1, 0x77, 0x94, 0xc9, 0x2d,
87 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01,
88 0x7a, 0x30, 0x82, 0x01, 0x76, 0x30, 0x0e, 0x06,
89 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04,
90 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0f, 0x06,
91 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
92 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d,
93 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
94 0x14, 0x2b, 0xd0, 0x69, 0x47, 0x94, 0x76, 0x09,
95 0xfe, 0xf4, 0x6b, 0x8d, 0x2e, 0x40, 0xa6, 0xf7,
96 0x47, 0x4d, 0x7f, 0x08, 0x5e, 0x30, 0x1f, 0x06,
97 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
98 0x80, 0x14, 0x2b, 0xd0, 0x69, 0x47, 0x94, 0x76,
99 0x09, 0xfe, 0xf4, 0x6b, 0x8d, 0x2e, 0x40, 0xa6,
100 0xf7, 0x47, 0x4d, 0x7f, 0x08, 0x5e, 0x30, 0x82,
101 0x01, 0x11, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04,
102 0x82, 0x01, 0x08, 0x30, 0x82, 0x01, 0x04, 0x30,
103 0x82, 0x01, 0x00, 0x06, 0x09, 0x2a, 0x86, 0x48,
104 0x86, 0xf7, 0x63, 0x64, 0x05, 0x01, 0x30, 0x81,
105 0xf2, 0x30, 0x2a, 0x06, 0x08, 0x2b, 0x06, 0x01,
106 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1e, 0x68,
107 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77,
108 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65,
109 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x70,
110 0x6c, 0x65, 0x63, 0x61, 0x2f, 0x30, 0x81, 0xc3,
111 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
112 0x02, 0x02, 0x30, 0x81, 0xb6, 0x1a, 0x81, 0xb3,
113 0x52, 0x65, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65,
114 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
115 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
116 0x63, 0x61, 0x74, 0x65, 0x20, 0x62, 0x79, 0x20,
117 0x61, 0x6e, 0x79, 0x20, 0x70, 0x61, 0x72, 0x74,
118 0x79, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65,
119 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74,
120 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20,
121 0x74, 0x68, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e,
122 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
123 0x62, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x61, 0x6e,
124 0x64, 0x61, 0x72, 0x64, 0x20, 0x74, 0x65, 0x72,
125 0x6d, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63,
126 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
127 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65,
128 0x2c, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66,
129 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x70, 0x6f,
130 0x6c, 0x69, 0x63, 0x79, 0x20, 0x61, 0x6e, 0x64,
131 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
132 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70,
133 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x20,
134 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e,
135 0x74, 0x73, 0x2e, 0x30, 0x0d, 0x06, 0x09, 0x2a,
136 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
137 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x5c,
138 0x36, 0x99, 0x4c, 0x2d, 0x78, 0xb7, 0xed, 0x8c,
139 0x9b, 0xdc, 0xf3, 0x77, 0x9b, 0xf2, 0x76, 0xd2,
140 0x77, 0x30, 0x4f, 0xc1, 0x1f, 0x85, 0x83, 0x85,
141 0x1b, 0x99, 0x3d, 0x47, 0x37, 0xf2, 0xa9, 0x9b,
142 0x40, 0x8e, 0x2c, 0xd4, 0xb1, 0x90, 0x12, 0xd8,
143 0xbe, 0xf4, 0x73, 0x9b, 0xee, 0xd2, 0x64, 0x0f,
144 0xcb, 0x79, 0x4f, 0x34, 0xd8, 0xa2, 0x3e, 0xf9,
145 0x78, 0xff, 0x6b, 0xc8, 0x07, 0xec, 0x7d, 0x39,
146 0x83, 0x8b, 0x53, 0x20, 0xd3, 0x38, 0xc4, 0xb1,
147 0xbf, 0x9a, 0x4f, 0x0a, 0x6b, 0xff, 0x2b, 0xfc,
148 0x59, 0xa7, 0x05, 0x09, 0x7c, 0x17, 0x40, 0x56,
149 0x11, 0x1e, 0x74, 0xd3, 0xb7, 0x8b, 0x23, 0x3b,
150 0x47, 0xa3, 0xd5, 0x6f, 0x24, 0xe2, 0xeb, 0xd1,
151 0xb7, 0x70, 0xdf, 0x0f, 0x45, 0xe1, 0x27, 0xca,
152 0xf1, 0x6d, 0x78, 0xed, 0xe7, 0xb5, 0x17, 0x17,
153 0xa8, 0xdc, 0x7e, 0x22, 0x35, 0xca, 0x25, 0xd5,
154 0xd9, 0x0f, 0xd6, 0x6b, 0xd4, 0xa2, 0x24, 0x23,
155 0x11, 0xf7, 0xa1, 0xac, 0x8f, 0x73, 0x81, 0x60,
156 0xc6, 0x1b, 0x5b, 0x09, 0x2f, 0x92, 0xb2, 0xf8,
157 0x44, 0x48, 0xf0, 0x60, 0x38, 0x9e, 0x15, 0xf5,
158 0x3d, 0x26, 0x67, 0x20, 0x8a, 0x33, 0x6a, 0xf7,
159 0x0d, 0x82, 0xcf, 0xde, 0xeb, 0xa3, 0x2f, 0xf9,
160 0x53, 0x6a, 0x5b, 0x64, 0xc0, 0x63, 0x33, 0x77,
161 0xf7, 0x3a, 0x07, 0x2c, 0x56, 0xeb, 0xda, 0x0f,
162 0x21, 0x0e, 0xda, 0xba, 0x73, 0x19, 0x4f, 0xb5,
163 0xd9, 0x36, 0x7f, 0xc1, 0x87, 0x55, 0xd9, 0xa7,
164 0x99, 0xb9, 0x32, 0x42, 0xfb, 0xd8, 0xd5, 0x71,
165 0x9e, 0x7e, 0xa1, 0x52, 0xb7, 0x1b, 0xbd, 0x93,
166 0x42, 0x24, 0x12, 0x2a, 0xc7, 0x0f, 0x1d, 0xb6,
167 0x4d, 0x9c, 0x5e, 0x63, 0xc8, 0x4b, 0x80, 0x17,
168 0x50, 0xaa, 0x8a, 0xd5, 0xda, 0xe4, 0xfc, 0xd0,
169 0x09, 0x07, 0x37, 0xb0, 0x75, 0x75, 0x21,
170 };
171
172 /*
173 subject= /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
174 issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
175 serial=254B8A853842CCE358F8C5DDAE226EA4
176 */
177 static const uint8_t _c1[] = {
178 0x30, 0x82, 0x03, 0x83, 0x30, 0x82, 0x02, 0xec,
179 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x25,
180 0x4b, 0x8a, 0x85, 0x38, 0x42, 0xcc, 0xe3, 0x58,
181 0xf8, 0xc5, 0xdd, 0xae, 0x22, 0x6e, 0xa4, 0x30,
182 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
183 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x5f,
184 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
185 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30,
186 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e,
187 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e,
188 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37,
189 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
190 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33,
191 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
192 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20,
193 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
194 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
195 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30,
196 0x1e, 0x17, 0x0d, 0x39, 0x37, 0x30, 0x34, 0x31,
197 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a,
198 0x17, 0x0d, 0x31, 0x31, 0x31, 0x30, 0x32, 0x34,
199 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30,
200 0x81, 0xba, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03,
201 0x55, 0x04, 0x0a, 0x13, 0x16, 0x56, 0x65, 0x72,
202 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x54, 0x72,
203 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77,
204 0x6f, 0x72, 0x6b, 0x31, 0x17, 0x30, 0x15, 0x06,
205 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0e, 0x56, 0x65,
206 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20,
207 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x33, 0x30, 0x31,
208 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2a, 0x56,
209 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20,
210 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74,
211 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65,
212 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x41, 0x20,
213 0x2d, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20,
214 0x33, 0x31, 0x49, 0x30, 0x47, 0x06, 0x03, 0x55,
215 0x04, 0x0b, 0x13, 0x40, 0x77, 0x77, 0x77, 0x2e,
216 0x76, 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e,
217 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x50, 0x53,
218 0x20, 0x49, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e,
219 0x62, 0x79, 0x20, 0x52, 0x65, 0x66, 0x2e, 0x20,
220 0x4c, 0x49, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54,
221 0x59, 0x20, 0x4c, 0x54, 0x44, 0x2e, 0x28, 0x63,
222 0x29, 0x39, 0x37, 0x20, 0x56, 0x65, 0x72, 0x69,
223 0x53, 0x69, 0x67, 0x6e, 0x30, 0x81, 0x9f, 0x30,
224 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
225 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
226 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81,
227 0x00, 0xd8, 0x82, 0x80, 0xe8, 0xd6, 0x19, 0x02,
228 0x7d, 0x1f, 0x85, 0x18, 0x39, 0x25, 0xa2, 0x65,
229 0x2b, 0xe1, 0xbf, 0xd4, 0x05, 0xd3, 0xbc, 0xe6,
230 0x36, 0x3b, 0xaa, 0xf0, 0x4c, 0x6c, 0x5b, 0xb6,
231 0xe7, 0xaa, 0x3c, 0x73, 0x45, 0x55, 0xb2, 0xf1,
232 0xbd, 0xea, 0x97, 0x42, 0xed, 0x9a, 0x34, 0x0a,
233 0x15, 0xd4, 0xa9, 0x5c, 0xf5, 0x40, 0x25, 0xdd,
234 0xd9, 0x07, 0xc1, 0x32, 0xb2, 0x75, 0x6c, 0xc4,
235 0xca, 0xbb, 0xa3, 0xfe, 0x56, 0x27, 0x71, 0x43,
236 0xaa, 0x63, 0xf5, 0x30, 0x3e, 0x93, 0x28, 0xe5,
237 0xfa, 0xf1, 0x09, 0x3b, 0xf3, 0xb7, 0x4d, 0x4e,
238 0x39, 0xf7, 0x5c, 0x49, 0x5a, 0xb8, 0xc1, 0x1d,
239 0xd3, 0xb2, 0x8a, 0xfe, 0x70, 0x30, 0x95, 0x42,
240 0xcb, 0xfe, 0x2b, 0x51, 0x8b, 0x5a, 0x3c, 0x3a,
241 0xf9, 0x22, 0x4f, 0x90, 0xb2, 0x02, 0xa7, 0x53,
242 0x9c, 0x4f, 0x34, 0xe7, 0xab, 0x04, 0xb2, 0x7b,
243 0x6f, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81,
244 0xe3, 0x30, 0x81, 0xe0, 0x30, 0x0f, 0x06, 0x03,
245 0x55, 0x1d, 0x13, 0x04, 0x08, 0x30, 0x06, 0x01,
246 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x44, 0x06,
247 0x03, 0x55, 0x1d, 0x20, 0x04, 0x3d, 0x30, 0x3b,
248 0x30, 0x39, 0x06, 0x0b, 0x60, 0x86, 0x48, 0x01,
249 0x86, 0xf8, 0x45, 0x01, 0x07, 0x01, 0x01, 0x30,
250 0x2a, 0x30, 0x28, 0x06, 0x08, 0x2b, 0x06, 0x01,
251 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1c, 0x68,
252 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77,
253 0x77, 0x77, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x73,
254 0x69, 0x67, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
255 0x43, 0x50, 0x53, 0x30, 0x34, 0x06, 0x03, 0x55,
256 0x1d, 0x25, 0x04, 0x2d, 0x30, 0x2b, 0x06, 0x08,
257 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01,
258 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
259 0x03, 0x02, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
260 0x86, 0xf8, 0x42, 0x04, 0x01, 0x06, 0x0a, 0x60,
261 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45, 0x01, 0x08,
262 0x01, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f,
263 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x11,
264 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8,
265 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x01,
266 0x06, 0x30, 0x31, 0x06, 0x03, 0x55, 0x1d, 0x1f,
267 0x04, 0x2a, 0x30, 0x28, 0x30, 0x26, 0xa0, 0x24,
268 0xa0, 0x22, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70,
269 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x76,
270 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e, 0x2e,
271 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x63, 0x61, 0x33,
272 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x0d, 0x06, 0x09,
273 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
274 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x08,
275 0x01, 0xec, 0xe4, 0x68, 0x94, 0x03, 0x42, 0xf1,
276 0x73, 0xf1, 0x23, 0xa2, 0x3a, 0xde, 0xe9, 0xf1,
277 0xda, 0xc6, 0x54, 0xc4, 0x23, 0x3e, 0x86, 0xea,
278 0xcf, 0x6a, 0x3a, 0x33, 0xab, 0xea, 0x9c, 0x04,
279 0x14, 0x07, 0x36, 0x06, 0x0b, 0xf9, 0x88, 0x6f,
280 0xd5, 0x13, 0xee, 0x29, 0x2b, 0xc3, 0xe4, 0x72,
281 0x8d, 0x44, 0xed, 0xd1, 0xac, 0x20, 0x09, 0x2d,
282 0xe1, 0xf6, 0xe1, 0x19, 0x05, 0x38, 0xb0, 0x3d,
283 0x0f, 0x9f, 0x7f, 0xf8, 0x9e, 0x02, 0xdc, 0x86,
284 0x02, 0x86, 0x61, 0x4e, 0x26, 0x5f, 0x5e, 0x9f,
285 0x92, 0x1e, 0x0c, 0x24, 0xa4, 0xf5, 0xd0, 0x70,
286 0x13, 0xcf, 0x26, 0xc3, 0x43, 0x3d, 0x49, 0x1d,
287 0x9e, 0x82, 0x2e, 0x52, 0x5f, 0xbc, 0x3e, 0xc6,
288 0x66, 0x29, 0x01, 0x8e, 0x4e, 0x92, 0x2c, 0xbc,
289 0x46, 0x75, 0x03, 0x82, 0xac, 0x73, 0xe9, 0xd9,
290 0x7e, 0x0b, 0x67, 0xef, 0x54, 0x52, 0x1a
291 };
292
293
294 /*
295 subject= /C=US/O=University of Virginia/OU=UVA Standard PKI User/emailAddress=kmm6b@Virginia.EDU/CN=Keith M. Moores 10
296 issuer= /C=US/ST=Virginia/L=Charlottesville/O=University of Virginia/emailAddress=pkimaster@virginia.edu/CN=UVA Standard Assurance SKP 1
297 serial=0C6D
298 */
299 static const uint8_t _c2[] = {
300 0x30, 0x82, 0x05, 0x56, 0x30, 0x82, 0x04, 0xbf,
301 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x0c,
302 0x6d, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
303 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
304 0x30, 0x81, 0xa9, 0x31, 0x0b, 0x30, 0x09, 0x06,
305 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
306 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04,
307 0x08, 0x13, 0x08, 0x56, 0x69, 0x72, 0x67, 0x69,
308 0x6e, 0x69, 0x61, 0x31, 0x18, 0x30, 0x16, 0x06,
309 0x03, 0x55, 0x04, 0x07, 0x13, 0x0f, 0x43, 0x68,
310 0x61, 0x72, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x73,
311 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x31, 0x1f, 0x30,
312 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x16,
313 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69,
314 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x56, 0x69,
315 0x72, 0x67, 0x69, 0x6e, 0x69, 0x61, 0x31, 0x25,
316 0x30, 0x23, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
317 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x16, 0x70,
318 0x6b, 0x69, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
319 0x40, 0x76, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69,
320 0x61, 0x2e, 0x65, 0x64, 0x75, 0x31, 0x25, 0x30,
321 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1c,
322 0x55, 0x56, 0x41, 0x20, 0x53, 0x74, 0x61, 0x6e,
323 0x64, 0x61, 0x72, 0x64, 0x20, 0x41, 0x73, 0x73,
324 0x75, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x53,
325 0x4b, 0x50, 0x20, 0x31, 0x30, 0x1e, 0x17, 0x0d,
326 0x30, 0x34, 0x30, 0x31, 0x30, 0x38, 0x31, 0x37,
327 0x32, 0x35, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x30,
328 0x35, 0x30, 0x31, 0x30, 0x38, 0x31, 0x37, 0x32,
329 0x35, 0x30, 0x30, 0x5a, 0x30, 0x81, 0x8e, 0x31,
330 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
331 0x13, 0x02, 0x55, 0x53, 0x31, 0x1f, 0x30, 0x1d,
332 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x16, 0x55,
333 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69, 0x74,
334 0x79, 0x20, 0x6f, 0x66, 0x20, 0x56, 0x69, 0x72,
335 0x67, 0x69, 0x6e, 0x69, 0x61, 0x31, 0x1e, 0x30,
336 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15,
337 0x55, 0x56, 0x41, 0x20, 0x53, 0x74, 0x61, 0x6e,
338 0x64, 0x61, 0x72, 0x64, 0x20, 0x50, 0x4b, 0x49,
339 0x20, 0x55, 0x73, 0x65, 0x72, 0x31, 0x21, 0x30,
340 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
341 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x6b, 0x6d,
342 0x6d, 0x36, 0x62, 0x40, 0x56, 0x69, 0x72, 0x67,
343 0x69, 0x6e, 0x69, 0x61, 0x2e, 0x45, 0x44, 0x55,
344 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04,
345 0x03, 0x13, 0x12, 0x4b, 0x65, 0x69, 0x74, 0x68,
346 0x20, 0x4d, 0x2e, 0x20, 0x4d, 0x6f, 0x6f, 0x72,
347 0x65, 0x73, 0x20, 0x31, 0x30, 0x30, 0x81, 0x9f,
348 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
349 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
350 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81,
351 0x81, 0x00, 0xb4, 0xf9, 0x1b, 0xda, 0x10, 0x01,
352 0x47, 0x96, 0xb4, 0xea, 0xb2, 0x35, 0xbb, 0x7e,
353 0x69, 0x69, 0xd9, 0x49, 0x2c, 0x36, 0x3a, 0x27,
354 0x55, 0x6e, 0x11, 0xb1, 0xdf, 0x13, 0x54, 0xf2,
355 0x66, 0xa5, 0x98, 0x3a, 0xfd, 0x7e, 0xda, 0x6d,
356 0x12, 0xb7, 0x06, 0xaa, 0xde, 0x55, 0x50, 0x04,
357 0xf5, 0x91, 0x27, 0xc7, 0x4d, 0x85, 0x91, 0xd9,
358 0xc5, 0xd6, 0x88, 0xc6, 0x33, 0x40, 0x83, 0xc0,
359 0xe4, 0x83, 0xe2, 0x9f, 0x49, 0xfb, 0xc1, 0x1f,
360 0xdb, 0xd9, 0xf4, 0xd4, 0x32, 0x2e, 0x3a, 0xe9,
361 0xb4, 0x12, 0x5d, 0x58, 0x2a, 0x65, 0x4e, 0xc7,
362 0x09, 0x59, 0xfc, 0x2b, 0x0d, 0xda, 0x6a, 0xc3,
363 0x9f, 0x32, 0x7d, 0xf2, 0xfc, 0xf4, 0x3e, 0xb8,
364 0x63, 0xbc, 0x13, 0x74, 0xc6, 0x0e, 0x76, 0x3a,
365 0x7a, 0xe9, 0x93, 0x97, 0x7f, 0xc8, 0x2b, 0x33,
366 0x9f, 0xd8, 0x59, 0xef, 0xc0, 0x0a, 0x2e, 0xd3,
367 0xd9, 0x69, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
368 0x82, 0x02, 0xa4, 0x30, 0x82, 0x02, 0xa0, 0x30,
369 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04,
370 0x03, 0x02, 0x05, 0xa0, 0x30, 0x1d, 0x06, 0x03,
371 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06,
372 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03,
373 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05,
374 0x07, 0x03, 0x04, 0x30, 0x1d, 0x06, 0x03, 0x55,
375 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x4d, 0xe0,
376 0xe1, 0x57, 0xb6, 0x91, 0x7a, 0x34, 0x99, 0x7a,
377 0xe5, 0x2a, 0xd6, 0xae, 0x0a, 0x75, 0x05, 0x73,
378 0x5d, 0x30, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d,
379 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1f, 0x06,
380 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
381 0x80, 0x14, 0x2c, 0xb7, 0xe3, 0xa6, 0x09, 0x68,
382 0x85, 0x90, 0x58, 0x8e, 0x2d, 0xd5, 0x3a, 0xef,
383 0x93, 0x02, 0x2a, 0x4c, 0x85, 0x62, 0x30, 0x41,
384 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x3a, 0x30,
385 0x38, 0xa0, 0x22, 0x06, 0x0a, 0x2b, 0x06, 0x01,
386 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x03, 0xa0,
387 0x14, 0x0c, 0x12, 0x6b, 0x6d, 0x6d, 0x36, 0x62,
388 0x40, 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69,
389 0x61, 0x2e, 0x45, 0x44, 0x55, 0x81, 0x12, 0x6b,
390 0x6d, 0x6d, 0x36, 0x62, 0x40, 0x56, 0x69, 0x72,
391 0x67, 0x69, 0x6e, 0x69, 0x61, 0x2e, 0x45, 0x44,
392 0x55, 0x30, 0x2f, 0x06, 0x03, 0x55, 0x1d, 0x12,
393 0x04, 0x28, 0x30, 0x26, 0x81, 0x16, 0x70, 0x6b,
394 0x69, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x40,
395 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69, 0x61,
396 0x2e, 0x45, 0x44, 0x55, 0x82, 0x0c, 0x56, 0x69,
397 0x72, 0x67, 0x69, 0x6e, 0x69, 0x61, 0x2e, 0x45,
398 0x44, 0x55, 0x30, 0x82, 0x01, 0x5c, 0x06, 0x03,
399 0x55, 0x1d, 0x1f, 0x04, 0x82, 0x01, 0x53, 0x30,
400 0x82, 0x01, 0x4f, 0x30, 0x74, 0xa0, 0x72, 0xa0,
401 0x70, 0x86, 0x6e, 0x6c, 0x64, 0x61, 0x70, 0x3a,
402 0x2f, 0x2f, 0x6c, 0x64, 0x61, 0x70, 0x2e, 0x70,
403 0x6b, 0x69, 0x2e, 0x76, 0x69, 0x72, 0x67, 0x69,
404 0x6e, 0x69, 0x61, 0x2e, 0x65, 0x64, 0x75, 0x2f,
405 0x63, 0x3d, 0x55, 0x53, 0x2c, 0x6f, 0x3d, 0x55,
406 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69, 0x74,
407 0x79, 0x25, 0x32, 0x30, 0x6f, 0x66, 0x25, 0x32,
408 0x30, 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69,
409 0x61, 0x2c, 0x6f, 0x75, 0x3d, 0x55, 0x56, 0x41,
410 0x25, 0x32, 0x30, 0x53, 0x74, 0x61, 0x6e, 0x64,
411 0x61, 0x72, 0x64, 0x25, 0x32, 0x30, 0x41, 0x73,
412 0x73, 0x75, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x25,
413 0x32, 0x30, 0x53, 0x4b, 0x50, 0x25, 0x32, 0x30,
414 0x31, 0x2c, 0x63, 0x6e, 0x3d, 0x30, 0x43, 0x36,
415 0x44, 0x30, 0x74, 0xa0, 0x72, 0xa0, 0x70, 0x86,
416 0x6e, 0x6c, 0x64, 0x61, 0x70, 0x3a, 0x2f, 0x2f,
417 0x6c, 0x64, 0x61, 0x70, 0x2e, 0x70, 0x6b, 0x69,
418 0x2e, 0x76, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69,
419 0x61, 0x2e, 0x65, 0x64, 0x75, 0x2f, 0x63, 0x6e,
420 0x3d, 0x30, 0x43, 0x36, 0x44, 0x2c, 0x6f, 0x75,
421 0x3d, 0x55, 0x56, 0x41, 0x25, 0x32, 0x30, 0x53,
422 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x25,
423 0x32, 0x30, 0x41, 0x73, 0x73, 0x75, 0x72, 0x61,
424 0x6e, 0x63, 0x65, 0x25, 0x32, 0x30, 0x53, 0x4b,
425 0x50, 0x25, 0x32, 0x30, 0x31, 0x2c, 0x6f, 0x3d,
426 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69,
427 0x74, 0x79, 0x25, 0x32, 0x30, 0x6f, 0x66, 0x25,
428 0x32, 0x30, 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e,
429 0x69, 0x61, 0x2c, 0x63, 0x3d, 0x55, 0x53, 0x30,
430 0x61, 0xa0, 0x5f, 0xa0, 0x5d, 0x86, 0x5b, 0x68,
431 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77,
432 0x77, 0x2e, 0x70, 0x6b, 0x69, 0x2e, 0x76, 0x69,
433 0x72, 0x67, 0x69, 0x6e, 0x69, 0x61, 0x2e, 0x65,
434 0x64, 0x75, 0x2f, 0x63, 0x67, 0x69, 0x2d, 0x62,
435 0x69, 0x6e, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x63,
436 0x72, 0x6c, 0x3f, 0x6f, 0x75, 0x3d, 0x55, 0x56,
437 0x41, 0x25, 0x32, 0x30, 0x53, 0x74, 0x61, 0x6e,
438 0x64, 0x61, 0x72, 0x64, 0x25, 0x32, 0x30, 0x41,
439 0x73, 0x73, 0x75, 0x72, 0x61, 0x6e, 0x63, 0x65,
440 0x25, 0x32, 0x30, 0x53, 0x4b, 0x50, 0x25, 0x32,
441 0x30, 0x31, 0x26, 0x63, 0x6e, 0x3d, 0x30, 0x43,
442 0x36, 0x44, 0x30, 0x53, 0x06, 0x03, 0x55, 0x1d,
443 0x20, 0x04, 0x4c, 0x30, 0x4a, 0x30, 0x48, 0x06,
444 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xb4, 0x76,
445 0x01, 0x01, 0x30, 0x3b, 0x30, 0x39, 0x06, 0x08,
446 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01,
447 0x16, 0x2d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
448 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x6b, 0x69,
449 0x2e, 0x76, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x69,
450 0x61, 0x2e, 0x65, 0x64, 0x75, 0x2f, 0x73, 0x74,
451 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x2f, 0x63,
452 0x70, 0x73, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30,
453 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
454 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
455 0x81, 0x00, 0x9f, 0xf2, 0x7f, 0x51, 0x97, 0x2c,
456 0xe6, 0x8f, 0x50, 0xba, 0x75, 0xd8, 0x9c, 0x77,
457 0x5e, 0x2a, 0xe9, 0xbe, 0x18, 0x37, 0x7f, 0x18,
458 0x86, 0xbb, 0x9d, 0x22, 0xf2, 0xf9, 0x3e, 0x22,
459 0x00, 0x0b, 0xf2, 0x41, 0x6b, 0x08, 0x17, 0xbc,
460 0x7a, 0xc4, 0xc9, 0x99, 0xa0, 0xbd, 0x53, 0x8d,
461 0x52, 0xdb, 0xcc, 0xd0, 0x88, 0x14, 0x2a, 0x05,
462 0x93, 0xcd, 0xf3, 0xa0, 0xf3, 0xb9, 0xdb, 0x35,
463 0x5c, 0xec, 0x24, 0xe8, 0x08, 0xbe, 0x4e, 0xa1,
464 0xa2, 0x54, 0x41, 0xbc, 0xbe, 0x7b, 0x22, 0xf4,
465 0x03, 0x7d, 0xd0, 0xfb, 0x25, 0x8d, 0xf5, 0xa9,
466 0x04, 0x14, 0xe9, 0xe3, 0x3e, 0x3f, 0x13, 0x6f,
467 0x89, 0x72, 0x76, 0x41, 0x67, 0x8a, 0x48, 0x2a,
468 0x36, 0xf0, 0xe6, 0xb9, 0x33, 0x35, 0x88, 0xda,
469 0x27, 0x9d, 0xf9, 0x5d, 0x42, 0x04, 0x6f, 0x7d,
470 0x60, 0x53, 0x86, 0xf2, 0xf4, 0x3b, 0x3d, 0xbe,
471 0x1d, 0x99,
472 };
473
474 /* subject:/C=US/O=Apple Computer, Inc./OU=mac.com/CN=phased/description=.Mac Sharing Certificate */
475 /* issuer :/C=US/O=Apple Computer, Inc./OU=Apple Computer Certificate Authority/CN=Apple .Mac Certificate Authority */
476 static unsigned char _phased_c3[1376]={
477 0x30,0x82,0x05,0x5C,0x30,0x82,0x04,0x44,0xA0,0x03,0x02,0x01,0x02,0x02,0x03,0x20,
478 0x7D,0xC7,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,
479 0x00,0x30,0x81,0x86,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,
480 0x53,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0A,0x13,0x14,0x41,0x70,0x70,0x6C,
481 0x65,0x20,0x43,0x6F,0x6D,0x70,0x75,0x74,0x65,0x72,0x2C,0x20,0x49,0x6E,0x63,0x2E,
482 0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x41,0x70,0x70,0x6C,0x65,
483 0x20,0x43,0x6F,0x6D,0x70,0x75,0x74,0x65,0x72,0x20,0x43,0x65,0x72,0x74,0x69,0x66,
484 0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,
485 0x29,0x30,0x27,0x06,0x03,0x55,0x04,0x03,0x13,0x20,0x41,0x70,0x70,0x6C,0x65,0x20,
486 0x2E,0x4D,0x61,0x63,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,
487 0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x37,
488 0x31,0x30,0x32,0x38,0x31,0x38,0x35,0x34,0x35,0x33,0x5A,0x17,0x0D,0x30,0x38,0x31,
489 0x30,0x32,0x38,0x31,0x38,0x35,0x34,0x35,0x33,0x5A,0x30,0x72,0x31,0x0B,0x30,0x09,
490 0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,
491 0x04,0x0A,0x13,0x14,0x41,0x70,0x70,0x6C,0x65,0x20,0x43,0x6F,0x6D,0x70,0x75,0x74,
492 0x65,0x72,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,
493 0x0B,0x13,0x07,0x6D,0x61,0x63,0x2E,0x63,0x6F,0x6D,0x31,0x0F,0x30,0x0D,0x06,0x03,
494 0x55,0x04,0x03,0x13,0x06,0x70,0x68,0x61,0x73,0x65,0x64,0x31,0x21,0x30,0x1F,0x06,
495 0x03,0x55,0x04,0x0D,0x13,0x18,0x2E,0x4D,0x61,0x63,0x20,0x53,0x68,0x61,0x72,0x69,
496 0x6E,0x67,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x30,0x81,
497 0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,
498 0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xC0,0xFB,0x0E,0x62,0xD3,
499 0xE2,0xCC,0xC7,0x54,0x6A,0x4F,0x9C,0x4E,0x40,0x9D,0x30,0x3D,0x60,0x86,0x00,0x7C,
500 0x33,0x0C,0x2E,0x2E,0x45,0xDF,0xBE,0xEB,0x94,0xE7,0xD6,0xBE,0x6B,0x0F,0x7B,0x88,
501 0x3C,0x02,0xA7,0x25,0x5E,0x18,0xC6,0x97,0xF0,0x0C,0xDD,0x89,0x22,0x27,0x9C,0x85,
502 0x25,0x36,0x95,0x61,0x26,0xE7,0x6C,0x7E,0x41,0xDE,0xFF,0x5D,0x77,0xCB,0xE6,0x05,
503 0xB0,0xAD,0x77,0xC9,0xFC,0xA5,0xF1,0x82,0x1A,0xB4,0xE4,0x26,0x8D,0x1B,0xC3,0xE2,
504 0xEF,0x6A,0xE0,0xEE,0xF3,0x38,0x27,0xE1,0x73,0x9E,0xD0,0x93,0x6A,0xA6,0xD5,0xD1,
505 0xEC,0xE5,0x0D,0x4B,0x3A,0x42,0x8C,0xF1,0xE1,0x24,0x0A,0x02,0x0D,0x22,0xAE,0xEC,
506 0x47,0xDA,0xFA,0x6B,0x12,0x50,0x47,0x2E,0x4A,0xD8,0x9F,0x02,0x03,0x01,0x00,0x01,
507 0xA3,0x82,0x02,0x68,0x30,0x82,0x02,0x64,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x01,
508 0x01,0xFF,0x04,0x02,0x30,0x00,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,
509 0x04,0x04,0x03,0x02,0x03,0x88,0x30,0x28,0x06,0x03,0x55,0x1D,0x25,0x04,0x21,0x30,
510 0x1F,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,0x06,0x0A,0x2A,0x86,0x48,
511 0x86,0xF7,0x63,0x64,0x03,0x02,0x01,0x06,0x07,0x2B,0x06,0x01,0x05,0x02,0x03,0x04,
512 0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x3D,0xD9,0xDD,0x8F,0x5B,
513 0x5E,0xA3,0x3A,0x8C,0x89,0x7F,0x8A,0x85,0x26,0xA7,0x84,0x0E,0xF3,0x0D,0x82,0x30,
514 0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x7A,0x7D,0x90,0xB1,
515 0x30,0x59,0x08,0x92,0x91,0xF9,0x53,0xB9,0x71,0x1D,0x35,0x33,0x67,0x34,0x8B,0xD5,
516 0x30,0x81,0xAD,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01,0x04,0x81,0xA0,
517 0x30,0x81,0x9D,0x30,0x28,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x86,
518 0x1C,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x65,0x72,0x74,0x69,0x6E,0x66,0x6F,
519 0x2E,0x6D,0x61,0x63,0x2E,0x63,0x6F,0x6D,0x2F,0x6F,0x63,0x73,0x70,0x30,0x44,0x06,
520 0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,0x86,0x38,0x68,0x74,0x74,0x70,0x3A,
521 0x2F,0x2F,0x77,0x77,0x77,0x2E,0x61,0x70,0x70,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x2F,
522 0x63,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x61,0x75,0x74,0x68,0x6F,
523 0x72,0x69,0x74,0x79,0x2F,0x63,0x61,0x73,0x69,0x67,0x6E,0x65,0x72,0x73,0x2E,0x68,
524 0x74,0x6D,0x6C,0x30,0x2B,0x06,0x03,0x55,0x1D,0x12,0x86,0x24,0x68,0x74,0x74,0x70,
525 0x3A,0x2F,0x2F,0x63,0x65,0x72,0x74,0x69,0x6E,0x66,0x6F,0x2E,0x6D,0x61,0x63,0x2E,
526 0x63,0x6F,0x6D,0x2F,0x64,0x6F,0x74,0x4D,0x61,0x63,0x43,0x41,0x2E,0x63,0x65,0x72,
527 0x30,0x82,0x01,0x28,0x06,0x03,0x55,0x1D,0x20,0x04,0x82,0x01,0x1F,0x30,0x82,0x01,
528 0x1B,0x30,0x82,0x01,0x17,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x63,0x64,0x05,0x02,
529 0x30,0x82,0x01,0x08,0x30,0x40,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,
530 0x16,0x34,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x61,0x70,0x70,
531 0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x2F,0x63,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,
532 0x74,0x65,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x2F,0x74,0x65,0x72,0x6D,
533 0x73,0x2E,0x68,0x74,0x6D,0x6C,0x30,0x81,0xC3,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,
534 0x07,0x02,0x02,0x30,0x81,0xB6,0x1A,0x81,0xB3,0x52,0x65,0x6C,0x69,0x61,0x6E,0x63,
535 0x65,0x20,0x6F,0x6E,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x65,0x72,0x74,0x69,0x66,
536 0x69,0x63,0x61,0x74,0x65,0x20,0x62,0x79,0x20,0x61,0x6E,0x79,0x20,0x70,0x61,0x72,
537 0x74,0x79,0x20,0x61,0x73,0x73,0x75,0x6D,0x65,0x73,0x20,0x61,0x63,0x63,0x65,0x70,
538 0x74,0x61,0x6E,0x63,0x65,0x20,0x6F,0x66,0x20,0x74,0x68,0x65,0x20,0x74,0x68,0x65,
539 0x6E,0x20,0x61,0x70,0x70,0x6C,0x69,0x63,0x61,0x62,0x6C,0x65,0x20,0x73,0x74,0x61,
540 0x6E,0x64,0x61,0x72,0x64,0x20,0x74,0x65,0x72,0x6D,0x73,0x20,0x61,0x6E,0x64,0x20,
541 0x63,0x6F,0x6E,0x64,0x69,0x74,0x69,0x6F,0x6E,0x73,0x20,0x6F,0x66,0x20,0x75,0x73,
542 0x65,0x2C,0x20,0x63,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x70,
543 0x6F,0x6C,0x69,0x63,0x79,0x20,0x61,0x6E,0x64,0x20,0x63,0x65,0x72,0x74,0x69,0x66,
544 0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x70,0x72,0x61,0x63,0x74,0x69,0x63,0x65,
545 0x20,0x73,0x74,0x61,0x74,0x65,0x6D,0x65,0x6E,0x74,0x73,0x2E,0x30,0x0D,0x06,0x09,
546 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,
547 0x30,0x48,0x04,0xA8,0x63,0x5A,0x7A,0xF9,0xEA,0x8B,0xF7,0x7F,0xF6,0x27,0x21,0x02,
548 0xE2,0x83,0xC8,0x64,0x99,0xB3,0x40,0x71,0x97,0x30,0xE2,0x92,0xD4,0x58,0xB8,0xD8,
549 0xF1,0xAA,0x30,0x59,0x75,0x4C,0x67,0x16,0xF8,0x38,0xBD,0xD7,0xF4,0xEA,0x03,0xB5,
550 0xE6,0x42,0xF8,0x95,0xBA,0x5B,0xE4,0x3C,0xA8,0x75,0x6C,0x05,0xFB,0x3C,0x3C,0xE3,
551 0x08,0x90,0x5F,0x6D,0x7E,0x3A,0xEA,0xBD,0x19,0x52,0x82,0x3B,0x9C,0x7F,0x64,0x15,
552 0x3A,0xCA,0x54,0x52,0x57,0xEB,0x53,0x09,0xE8,0x05,0x53,0x79,0xB9,0x7D,0x51,0xA3,
553 0x8E,0x31,0xF1,0xE5,0x5E,0xC6,0xA6,0x81,0x11,0x68,0x0A,0x17,0xD5,0xA0,0xBB,0x49,
554 0xF3,0x4E,0x59,0x1D,0xCB,0xCA,0x3E,0x09,0x64,0x2F,0x27,0x6C,0xCA,0x39,0x50,0x73,
555 0x42,0x5C,0x9D,0xE2,0x92,0x45,0x37,0x7F,0x02,0xF0,0x2B,0xA0,0xDD,0x1C,0x02,0xDC,
556 0x77,0xA9,0x0C,0xEA,0x14,0xAE,0xDE,0x81,0xDF,0x3E,0x31,0x59,0xF6,0xF7,0xE5,0x7F,
557 0xBC,0x7C,0xFD,0xE8,0x22,0xBE,0x9A,0x78,0xDD,0xFD,0x32,0x7F,0xE0,0xEC,0x0F,0x8D,
558 0x4D,0xB5,0xDE,0xF6,0x91,0x4B,0xAD,0xDB,0x7D,0xF9,0x07,0xB8,0x2B,0x0E,0xB5,0x58,
559 0x05,0xA2,0x85,0xF6,0x72,0x0E,0xCB,0x63,0x4E,0x8F,0xBF,0xD6,0x33,0x6F,0xF3,0xC2,
560 0x53,0xFA,0x67,0x5D,0x19,0xA8,0x49,0x1C,0x05,0x5D,0xAF,0x6C,0xDC,0x14,0x37,0xD5,
561 0x65,0x42,0x24,0x3B,0x69,0xC9,0x78,0x3F,0x4B,0x0E,0xAF,0x13,0x37,0x00,0x1E,0x6B,
562 0xCE,0xB9,0xCC,0xAA,0x99,0x1A,0xB7,0x5A,0x27,0xB9,0xE9,0xD6,0x87,0x0A,0xEB,0x77,
563 };
564
565 static unsigned char pem[] = "\n"
566 "-----BEGIN CERTIFICATE-----\n"
567 "MIIDSzCCAjOgAwIBAgIJAPsB+wAAAAABMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNV\n"
568 "BAYTAlVTMRMwEQYDVQQKEwpBcHBsZSBJbmMuMSYwJAYDVQQLEx1BcHBsZSBDZXJ0\n"
569 "aWZpY2F0aW9uIEF1dGhvcml0eTEyMDAGA1UEAxMpQXBwbGUgU2VjdXJlIEJvb3Qg\n"
570 "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDcwMTA2MDUyMDUyWhcNMTcwMTA2\n"
571 "MDUyMDUyWjB0MQswCQYDVQQGEwJVUzETMBEGA1UEChMKQXBwbGUgSW5jLjEyMDAG\n"
572 "A1UECxMpQXBwbGUgU2VjdXJlIEJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx\n"
573 "HDAaBgNVBAMTE1M1TDg5MDAgU2VjdXJlIEJvb3QwgZ8wDQYJKoZIhvcNAQEBBQAD\n"
574 "gY0AMIGJAoGBAMSrg/5uSm6EaOPbN2sedX5F31i+4x5BLd8cVbopszz/9OJZz/RD\n"
575 "tWbVkSh2O7PZbvfYwwHB6D3pebAA1S9rakwaKO7hKyKzHqpHeiqu+ECdmPGBRhFf\n"
576 "16zQL/pXzEnHn4IBfHcG5O49VqI8TK9pMZiqOQ4nh5H5mYIBImcaQ7frAgMBAAGj\n"
577 "WjBYMAsGA1UdDwQEAwIHgDAJBgNVHRMEAjAAMB0GA1UdDgQWBBQZ39dDpsNXFu2G\n"
578 "Qt2ylAihau3f3jAfBgNVHSMEGDAWgBRJPTZTydcV4YZhTqyrqxhWY13DxjANBgkq\n"
579 "hkiG9w0BAQUFAAOCAQEAlAHI8JncOxR8kSzIuN6jCY22DgiZYahvO7H3f68w3QO3\n"
580 "NE8Cp/UCECv+pQmlMuJPMAYzfLwGtoLhpq6BlCQXEc4KYhjGh5aicdXBkZDf+rA0\n"
581 "p1KphAd8c2UEIAWBbqU87q1FbDSJBw3YKN7C/I4qGnzUrWSpBbq6musM0QzO/uUZ\n"
582 "3R1QsfpicZ+nT/1WmlJSAwtoQsBjNAgMauhRLAJc/fCPi8TqONju/xxbGDYJ/cQs\n"
583 "bCGfszrUSeGYu4ryxeyNuu2L8gluHUKbhfZ7J1XYgIsvoCnk5E5hWJDhpIyywylb\n"
584 "9F/uRNib8zb0L80S64vAWC4m4QUJ3iLmTfIsk+NYPQ==\n"
585 "-----END CERTIFICATE-----\n";
586
587 static unsigned char _elektron_v1_cert_der[] = {
588 0x30, 0x82, 0x02, 0x71, 0x30, 0x82, 0x01, 0xda, 0x02, 0x01, 0x01, 0x30,
589 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
590 0x05, 0x00, 0x30, 0x81, 0x80, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
591 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03,
592 0x55, 0x04, 0x08, 0x13, 0x02, 0x63, 0x61, 0x31, 0x11, 0x30, 0x0f, 0x06,
593 0x03, 0x55, 0x04, 0x07, 0x13, 0x08, 0x73, 0x61, 0x6e, 0x20, 0x6a, 0x6f,
594 0x73, 0x65, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
595 0x04, 0x62, 0x72, 0x61, 0x64, 0x31, 0x27, 0x30, 0x25, 0x06, 0x03, 0x55,
596 0x04, 0x0b, 0x13, 0x1e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64,
597 0x20, 0x62, 0x79, 0x20, 0x45, 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e,
598 0x20, 0x76, 0x32, 0x2e, 0x30, 0x2e, 0x31, 0x38, 0x35, 0x32, 0x31, 0x19,
599 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x10, 0x62, 0x72, 0x61,
600 0x64, 0x20, 0x45, 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x20, 0x43,
601 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x33, 0x31, 0x32, 0x32, 0x33, 0x31,
602 0x31, 0x34, 0x36, 0x30, 0x37, 0x5a, 0x17, 0x0d, 0x31, 0x33, 0x31, 0x32,
603 0x32, 0x32, 0x31, 0x31, 0x34, 0x36, 0x30, 0x37, 0x5a, 0x30, 0x81, 0x80,
604 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
605 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x02,
606 0x63, 0x61, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13,
607 0x08, 0x73, 0x61, 0x6e, 0x20, 0x6a, 0x6f, 0x73, 0x65, 0x31, 0x0d, 0x30,
608 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x62, 0x72, 0x61, 0x64,
609 0x31, 0x27, 0x30, 0x25, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1e, 0x50,
610 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x45,
611 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x20, 0x76, 0x32, 0x2e, 0x30,
612 0x2e, 0x31, 0x38, 0x35, 0x32, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55,
613 0x04, 0x03, 0x13, 0x10, 0x62, 0x72, 0x61, 0x64, 0x20, 0x45, 0x6c, 0x65,
614 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x20, 0x43, 0x41, 0x30, 0x81, 0x9f, 0x30,
615 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
616 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81,
617 0x00, 0xe0, 0xab, 0x3a, 0x05, 0x8d, 0xed, 0x81, 0x73, 0xa8, 0x76, 0x9c,
618 0x14, 0x07, 0x50, 0x4b, 0x56, 0x8f, 0xfe, 0x88, 0xba, 0xec, 0xde, 0xab,
619 0x9a, 0x5d, 0x49, 0x23, 0x3b, 0x87, 0x4f, 0x50, 0x59, 0x8d, 0x0f, 0x78,
620 0xd0, 0x61, 0x98, 0x28, 0x9d, 0x1d, 0x39, 0xbf, 0x92, 0x62, 0xda, 0x21,
621 0xf7, 0xb1, 0x32, 0x6a, 0x5d, 0x73, 0x1c, 0x1d, 0x36, 0xba, 0xf7, 0x3c,
622 0xff, 0xda, 0xd9, 0xff, 0xf0, 0xbd, 0x62, 0x1d, 0xde, 0x6d, 0xc7, 0x76,
623 0x93, 0xdd, 0x3a, 0x90, 0x2b, 0x97, 0xab, 0x86, 0xea, 0x48, 0xb5, 0x70,
624 0xe7, 0xe1, 0xa2, 0x5c, 0x61, 0x1a, 0x7d, 0x48, 0x4d, 0x83, 0x42, 0x73,
625 0x70, 0xaf, 0x5d, 0xcf, 0x8c, 0x26, 0xb4, 0x83, 0xff, 0x77, 0xd5, 0x64,
626 0xe0, 0x14, 0x52, 0x20, 0xa2, 0xe9, 0xc5, 0x8c, 0x70, 0xb5, 0x6f, 0xf5,
627 0x6d, 0x31, 0x2b, 0xcb, 0x1d, 0xad, 0xf4, 0xb2, 0x27, 0x02, 0x03, 0x01,
628 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
629 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x74, 0x49, 0x79,
630 0x14, 0xc0, 0x68, 0xd7, 0x9d, 0xfd, 0x35, 0x6a, 0xda, 0xa0, 0x1d, 0x46,
631 0x0a, 0xc6, 0x1b, 0x51, 0x4b, 0xdf, 0x27, 0xd6, 0x14, 0x1a, 0xcf, 0xf1,
632 0xd0, 0xe2, 0x1b, 0x92, 0x39, 0x33, 0x98, 0x13, 0xc2, 0x6e, 0x97, 0xed,
633 0x2b, 0x1b, 0xfc, 0x28, 0x8a, 0x93, 0xf9, 0xe5, 0xe1, 0xf0, 0xbf, 0xf8,
634 0xa3, 0x5e, 0x08, 0x9c, 0x9f, 0x61, 0x7d, 0xb9, 0xe7, 0x14, 0x0e, 0x6d,
635 0x07, 0x3e, 0x35, 0x12, 0xd4, 0x98, 0x2e, 0x0a, 0x9c, 0x5c, 0xb9, 0xbf,
636 0x20, 0x29, 0x01, 0x55, 0x82, 0x86, 0xa7, 0xcb, 0x97, 0x8f, 0xbb, 0xd8,
637 0x2b, 0xbd, 0x40, 0xd3, 0x1a, 0xa7, 0xb1, 0x66, 0x5c, 0xe5, 0x9a, 0x7b,
638 0x39, 0xb7, 0x73, 0x49, 0x2c, 0x44, 0x8c, 0x79, 0x5b, 0xb5, 0x18, 0x41,
639 0xd0, 0xf1, 0x4b, 0x6d, 0xc5, 0x1a, 0xf8, 0x51, 0xea, 0x99, 0x0d, 0x85,
640 0x1b, 0xbe, 0x16, 0x56, 0x18
641 };
642
643 #if 0 // currently unused.
644 static unsigned int _elektron_v1_cert_der_len = 629;
645 #endif
646
647 static unsigned char _wapi_as_der[] = {
648 0x30, 0x82, 0x01, 0xb7, 0x30, 0x82, 0x01, 0x6c, 0xa0, 0x03, 0x02, 0x01,
649 0x02, 0x02, 0x01, 0x12, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x81, 0x1c, 0xd7,
650 0x63, 0x01, 0x01, 0x01, 0x05, 0x00, 0x30, 0x1d, 0x31, 0x0c, 0x30, 0x0a,
651 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x03, 0x54, 0x4d, 0x43, 0x31, 0x0d,
652 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x04, 0x57, 0x41, 0x50,
653 0x49, 0x30, 0x1e, 0x17, 0x0d, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30,
654 0x30, 0x30, 0x30, 0x31, 0x38, 0x5a, 0x17, 0x0d, 0x39, 0x30, 0x30, 0x31,
655 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x31, 0x38, 0x5a, 0x30, 0x1d, 0x31,
656 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x03, 0x54, 0x4d,
657 0x43, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x04,
658 0x57, 0x41, 0x50, 0x49, 0x30, 0x4a, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86,
659 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x09, 0x2a, 0x81, 0x1c, 0xd7, 0x63,
660 0x01, 0x01, 0x02, 0x01, 0x03, 0x32, 0x00, 0x04, 0x74, 0xd9, 0x78, 0x91,
661 0xc4, 0xd3, 0xb5, 0x9e, 0xb0, 0xa9, 0x9e, 0xf1, 0x01, 0x5b, 0xd7, 0x7f,
662 0x79, 0x9a, 0x02, 0xe5, 0x87, 0x65, 0xa1, 0x0d, 0x04, 0xc9, 0x06, 0xdb,
663 0xf6, 0x12, 0x24, 0x05, 0x9d, 0x1c, 0x51, 0x00, 0x75, 0x58, 0x46, 0x11,
664 0xe3, 0xdc, 0x71, 0x02, 0x69, 0x43, 0x37, 0x61, 0xa3, 0x81, 0xa9, 0x30,
665 0x81, 0xa6, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
666 0x14, 0x08, 0xa9, 0x47, 0x65, 0xf2, 0x39, 0xa9, 0xe8, 0x8b, 0xd1, 0x75,
667 0x43, 0xce, 0x8c, 0x1c, 0xc0, 0xec, 0x99, 0xae, 0xad, 0x30, 0x45, 0x06,
668 0x03, 0x55, 0x1d, 0x23, 0x04, 0x3e, 0x30, 0x3c, 0x80, 0x14, 0x08, 0xa9,
669 0x47, 0x65, 0xf2, 0x39, 0xa9, 0xe8, 0x8b, 0xd1, 0x75, 0x43, 0xce, 0x8c,
670 0x1c, 0xc0, 0xec, 0x99, 0xae, 0xad, 0xa1, 0x21, 0xa4, 0x1f, 0x30, 0x1d,
671 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x03, 0x54,
672 0x4d, 0x43, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
673 0x04, 0x57, 0x41, 0x50, 0x49, 0x82, 0x01, 0x12, 0x30, 0x31, 0x06, 0x03,
674 0x55, 0x1d, 0x1f, 0x04, 0x2a, 0x30, 0x28, 0x30, 0x26, 0xa0, 0x24, 0xa0,
675 0x22, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x31, 0x39,
676 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x31, 0x2e, 0x32, 0x30, 0x30, 0x3a,
677 0x38, 0x30, 0x38, 0x30, 0x2f, 0x61, 0x73, 0x2e, 0x63, 0x72, 0x6c, 0x30,
678 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80,
679 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x81, 0x1c, 0xd7, 0x63, 0x01, 0x01, 0x01,
680 0x05, 0x00, 0x03, 0x37, 0x00, 0x30, 0x34, 0x02, 0x18, 0x23, 0xc5, 0x39,
681 0xc9, 0x91, 0x89, 0x3d, 0xe5, 0xae, 0x95, 0x75, 0x88, 0x68, 0xf6, 0x11,
682 0x64, 0xb1, 0x71, 0xe7, 0x67, 0x1f, 0xa1, 0x58, 0x77, 0x02, 0x18, 0x15,
683 0xef, 0x5a, 0x62, 0x7f, 0x7d, 0x9d, 0x6e, 0x6d, 0x91, 0x2b, 0x61, 0x15,
684 0x4d, 0x5a, 0xbe, 0xc8, 0x8d, 0xdc, 0x85, 0x00, 0xa9, 0x7d, 0x99
685 };
686
687 #if 0 // currently unused.
688 static unsigned int _wapi_as_der_len = 443;
689 #endif
690
691 #define CFReleaseSafe(CF) { CFTypeRef _cf = (CF); if (_cf) CFRelease(_cf); }
692 #define CFReleaseNull(CF) { CFTypeRef _cf = (CF); if (_cf) CFRelease(_cf); (CF) = NULL; }
693
694 /* Test basic add delete update copy matching stuff. */
695 static void tests(void)
696 {
697 SecCertificateRef cert0, cert1, cert2, cert3, cert4, cert5, cert6;
698 isnt(cert0 = SecCertificateCreateWithBytes(NULL, _c0, sizeof(_c0)),
699 NULL, "create cert0");
700 isnt(cert1 = SecCertificateCreateWithBytes(NULL, _c1, sizeof(_c1)),
701 NULL, "create cert1");
702
703 CFDataRef cert2Data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
704 _c2, sizeof(_c2), kCFAllocatorNull);
705 isnt(cert2 = SecCertificateCreateWithData(kCFAllocatorDefault, cert2Data),
706 NULL, "create cert2");
707 CFReleaseNull(cert2Data);
708
709 isnt(cert3 = SecCertificateCreateWithBytes(NULL, _phased_c3, sizeof(_phased_c3)),
710 NULL, "create cert3");
711
712 CFDataRef cert4data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
713 pem, sizeof(pem), kCFAllocatorNull);
714 ok(cert4 = SecCertificateCreateWithPEM(NULL, cert4data), "create cert from pem");
715 CFReleaseNull(cert4data);
716
717 isnt(cert5 = SecCertificateCreateWithBytes(NULL, _elektron_v1_cert_der,
718 sizeof(_elektron_v1_cert_der)), NULL, "create cert5");
719
720 isnt(cert6 = SecCertificateCreateWithBytes(NULL, _wapi_as_der,
721 sizeof(_wapi_as_der)), NULL, "create cert6");
722
723 ok(SecCertificateIsSelfSignedCA(cert0), "cert0 is CA");
724 ok(!SecCertificateIsSelfSignedCA(cert1), "cert1 is not CA");
725 ok(SecCertificateIsSelfSignedCA(cert5), "cert5 is v1 CA");
726
727 CFStringRef subjectSummary, issuerSummary;
728 isnt(subjectSummary = SecCertificateCopySubjectSummary(cert1), NULL,
729 "cert1 has a subject summary");
730 isnt(issuerSummary = SecCertificateCopyIssuerSummary(cert1), NULL,
731 "cert1 has an issuer summary");
732
733 ok(subjectSummary && CFEqual(subjectSummary, CFSTR("www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, VeriSign International Server CA - Class 3, VeriSign, Inc.")),
734 "subject summary is \"www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, VeriSign International Server CA - Class 3, VeriSign, Inc.\"");
735 ok(issuerSummary && CFEqual(issuerSummary,
736 CFSTR("Class 3 Public Primary Certification Authority")),
737 "issuer summary is \"Class 3 Public Primary Certification Authority\"");
738
739 CFArrayRef ntPrincipalNames;
740 ok(ntPrincipalNames = SecCertificateCopyNTPrincipalNames(cert2),
741 "SecCertificateCopyNTPrincipalNames");
742 is(CFArrayGetCount(ntPrincipalNames), 1, "we got 1 princialname back");
743 CFStringRef principal = (CFStringRef)CFArrayGetValueAtIndex(ntPrincipalNames, 0);
744 ok(CFEqual(principal, CFSTR("kmm6b@Virginia.EDU")),
745 "first principal is kmm6b@Virginia.EDU");
746 CFReleaseSafe(ntPrincipalNames);
747
748 CFReleaseSafe(subjectSummary);
749 CFReleaseSafe(issuerSummary);
750
751 isnt(subjectSummary = SecCertificateCopySubjectSummary(cert3), NULL,
752 "cert3 has a subject summary");
753 /* @@@ this causes a double free without an extra retain in obtainSummaryFromX501Name():
754 summary->description = string = copyDERThingDescription(kCFAllocatorDefault, value, true); */
755 CFReleaseSafe(subjectSummary);
756
757 isnt(subjectSummary = SecCertificateCopySubjectSummary(cert4), NULL,
758 "cert4 has a subject summary");
759 ok(subjectSummary && CFEqual(subjectSummary, CFSTR("S5L8900 Secure Boot")),
760 "cert4 is S5L8900 Secure Boot");
761 CFReleaseSafe(subjectSummary);
762
763 CFStringRef desc = NULL;
764 ok(desc = CFCopyDescription(cert4), "cert4 CFCopyDescription works");
765
766 CFReleaseSafe(cert0);
767 CFReleaseSafe(cert1);
768 CFReleaseSafe(cert2);
769 CFReleaseSafe(cert3);
770 CFReleaseSafe(cert4);
771 CFReleaseSafe(cert5);
772 CFReleaseSafe(cert6);
773 CFReleaseNull(desc);
774 }
775
776 int si_15_certificate(int argc, char *const *argv)
777 {
778 plan_tests(21);
779
780 tests();
781
782 return 0;
783 }