]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-22-sectrust-iap.c
Security-57336.10.29.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-22-sectrust-iap.c
1 /*
2 * Copyright (c) 2006-2010,2012-2014 Apple Inc. All Rights Reserved.
3 */
4
5 #include <CoreFoundation/CoreFoundation.h>
6 #include <Security/SecCertificate.h>
7 #include <Security/SecCertificatePriv.h>
8 #include <Security/SecPolicyPriv.h>
9 #include <Security/SecTrust.h>
10 #include <utilities/array_size.h>
11 #include <stdlib.h>
12 #include <unistd.h>
13
14 #include "Security_regressions.h"
15
16 /*
17 subject= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple iPod Accessories Certification Authority
18 issuer= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Root CA
19 serial=16
20 */
21 const uint8_t _iAP1CA[] = {
22 0x30, 0x82, 0x03, 0xfe, 0x30, 0x82, 0x02, 0xe6,
23 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x16,
24 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
25 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30,
26 0x62, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
27 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
28 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
29 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
30 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
31 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70,
32 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
33 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
34 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
35 0x69, 0x74, 0x79, 0x31, 0x16, 0x30, 0x14, 0x06,
36 0x03, 0x55, 0x04, 0x03, 0x13, 0x0d, 0x41, 0x70,
37 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74,
38 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30,
39 0x37, 0x30, 0x32, 0x31, 0x34, 0x32, 0x32, 0x31,
40 0x38, 0x30, 0x38, 0x5a, 0x17, 0x0d, 0x32, 0x32,
41 0x30, 0x32, 0x31, 0x34, 0x32, 0x32, 0x31, 0x38,
42 0x30, 0x38, 0x5a, 0x30, 0x81, 0x83, 0x31, 0x0b,
43 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
44 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06,
45 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70,
46 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e,
47 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04,
48 0x0b, 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65,
49 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
50 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41,
51 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79,
52 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04,
53 0x03, 0x13, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x65,
54 0x20, 0x69, 0x50, 0x6f, 0x64, 0x20, 0x41, 0x63,
55 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65,
56 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
57 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
58 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
59 0x79, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06,
60 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
61 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
62 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
63 0x01, 0x00, 0xa1, 0xf6, 0xca, 0xdb, 0x3d, 0x4a,
64 0x5a, 0x3e, 0xef, 0x74, 0x78, 0xf1, 0xb7, 0xb0,
65 0x32, 0x82, 0x1f, 0x90, 0xc6, 0x08, 0xdf, 0xaa,
66 0x3b, 0xd2, 0xcb, 0x0f, 0xe6, 0x37, 0x13, 0xf8,
67 0xff, 0x71, 0xfc, 0x28, 0x86, 0x24, 0x36, 0x85,
68 0x3f, 0xd0, 0x1d, 0x9c, 0xd0, 0x9c, 0xb2, 0x5d,
69 0x20, 0x41, 0xdc, 0xb0, 0xd8, 0xa8, 0x86, 0x3c,
70 0x42, 0x3c, 0xbe, 0x5a, 0x48, 0xdf, 0x34, 0x74,
71 0x9a, 0x61, 0x05, 0x0d, 0xce, 0xc8, 0x25, 0x14,
72 0xc8, 0x0a, 0xcd, 0xbd, 0xba, 0x12, 0x1b, 0x3b,
73 0x41, 0x13, 0x8e, 0x38, 0x65, 0x1d, 0xac, 0x1d,
74 0xd5, 0x38, 0x95, 0x9d, 0x3a, 0xd0, 0x79, 0x5c,
75 0x66, 0x9c, 0x47, 0x4b, 0x2c, 0xb8, 0x44, 0x3b,
76 0x7e, 0x8b, 0x68, 0x39, 0x3e, 0x46, 0xc1, 0xb8,
77 0xc0, 0x85, 0xd6, 0x84, 0xfb, 0x0e, 0xa6, 0xdd,
78 0x34, 0x06, 0xda, 0x1c, 0x78, 0xd9, 0xc4, 0x63,
79 0x11, 0x1b, 0xcf, 0x20, 0x15, 0xd2, 0x7a, 0xef,
80 0x60, 0x40, 0xdf, 0xba, 0xe0, 0x05, 0x45, 0x41,
81 0x82, 0x0e, 0x9b, 0x78, 0x2d, 0x2a, 0xb4, 0x94,
82 0xb5, 0xca, 0x79, 0xcd, 0xdb, 0xb5, 0x95, 0x02,
83 0xbe, 0x55, 0x2c, 0x36, 0x21, 0xaf, 0x6e, 0x39,
84 0xb6, 0x76, 0x5a, 0xec, 0x5d, 0x6a, 0xf3, 0xcc,
85 0xfa, 0x90, 0x8a, 0x15, 0x77, 0xbb, 0xba, 0x5c,
86 0x2b, 0xa1, 0x87, 0xf8, 0x0e, 0x70, 0x5d, 0x23,
87 0x01, 0x08, 0x79, 0xef, 0xab, 0xd7, 0x91, 0x38,
88 0x81, 0x35, 0xb3, 0x07, 0xd4, 0x79, 0xa2, 0x25,
89 0xa7, 0xf7, 0x90, 0x75, 0xeb, 0xeb, 0x71, 0xa2,
90 0xd0, 0xc1, 0xab, 0x02, 0x06, 0xf9, 0x07, 0x08,
91 0x97, 0x35, 0xda, 0x7e, 0x4d, 0x61, 0x51, 0x75,
92 0x92, 0xf6, 0x19, 0xf5, 0xdf, 0xfb, 0xc9, 0xa5,
93 0x4e, 0x9b, 0x8a, 0x14, 0x11, 0x4c, 0x10, 0x74,
94 0x83, 0xaf, 0x2f, 0xfc, 0xb6, 0xd6, 0x6b, 0x57,
95 0x46, 0x1d, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
96 0x81, 0x9c, 0x30, 0x81, 0x99, 0x30, 0x0e, 0x06,
97 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04,
98 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06,
99 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
100 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d,
101 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
102 0x14, 0xff, 0x4b, 0x1a, 0x43, 0x9a, 0xf5, 0x19,
103 0x96, 0xab, 0x18, 0x00, 0x2b, 0x61, 0xc9, 0xee,
104 0x40, 0x9d, 0x8e, 0xc7, 0x04, 0x30, 0x1f, 0x06,
105 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
106 0x80, 0x14, 0x2b, 0xd0, 0x69, 0x47, 0x94, 0x76,
107 0x09, 0xfe, 0xf4, 0x6b, 0x8d, 0x2e, 0x40, 0xa6,
108 0xf7, 0x47, 0x4d, 0x7f, 0x08, 0x5e, 0x30, 0x36,
109 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x2f, 0x30,
110 0x2d, 0x30, 0x2b, 0xa0, 0x29, 0xa0, 0x27, 0x86,
111 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
112 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c,
113 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70,
114 0x70, 0x6c, 0x65, 0x63, 0x61, 0x2f, 0x72, 0x6f,
115 0x6f, 0x74, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x0d,
116 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
117 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01,
118 0x01, 0x00, 0x9e, 0xb4, 0xaf, 0x3d, 0xb7, 0x61,
119 0xe0, 0x64, 0xc3, 0x86, 0x27, 0xd2, 0x3f, 0xe9,
120 0xe4, 0x08, 0x50, 0x77, 0xa2, 0x81, 0x09, 0x8c,
121 0x7d, 0xb7, 0xd0, 0x54, 0x52, 0xde, 0xfe, 0x8d,
122 0x48, 0xf2, 0x86, 0xc1, 0x17, 0xe5, 0x1a, 0x5d,
123 0x29, 0x20, 0xd3, 0x81, 0xca, 0xee, 0xc8, 0xa3,
124 0x61, 0xb3, 0x90, 0x9f, 0x73, 0xe8, 0xe3, 0xc8,
125 0xbc, 0xa7, 0x12, 0xb4, 0x8c, 0x2d, 0xaa, 0xf5,
126 0x39, 0x27, 0x19, 0xf5, 0xfb, 0xf9, 0x14, 0x7b,
127 0x3a, 0xb4, 0x78, 0x1a, 0x9a, 0x4c, 0x96, 0xeb,
128 0x36, 0xc7, 0xfe, 0xb5, 0xe7, 0x14, 0x7e, 0x6c,
129 0x4f, 0xa8, 0x22, 0xba, 0x23, 0x82, 0xf0, 0xce,
130 0xfa, 0x09, 0x7b, 0x8a, 0x0d, 0x5a, 0x61, 0x21,
131 0x74, 0x7a, 0xca, 0xc2, 0xca, 0x6b, 0xc2, 0x63,
132 0x40, 0x77, 0x23, 0x2b, 0x8f, 0xa0, 0x29, 0x5c,
133 0xeb, 0xad, 0xfc, 0xcc, 0xdc, 0x5a, 0x42, 0x42,
134 0x2e, 0xc8, 0x4f, 0xb4, 0x90, 0xd2, 0x6e, 0xfc,
135 0x4f, 0x8a, 0x0e, 0xa8, 0xb7, 0x83, 0x5c, 0x5c,
136 0x12, 0x02, 0x15, 0x17, 0xa8, 0x65, 0x7d, 0x5a,
137 0x28, 0x2b, 0x69, 0x5f, 0x76, 0x9e, 0x2f, 0xe0,
138 0x9e, 0xec, 0x41, 0x57, 0x97, 0xc5, 0x0f, 0x9a,
139 0xa0, 0x70, 0xb8, 0x2c, 0x8f, 0x6d, 0x80, 0xb5,
140 0x46, 0xec, 0xe8, 0x58, 0xb0, 0x04, 0x40, 0x3c,
141 0xc3, 0x62, 0x8a, 0x0a, 0xb7, 0xa9, 0x5b, 0x58,
142 0x7d, 0xea, 0x7b, 0x8c, 0xff, 0xf7, 0xf8, 0xbf,
143 0xd2, 0xc1, 0x95, 0x76, 0x05, 0xd7, 0x5d, 0x16,
144 0x4d, 0xf1, 0x1e, 0x7d, 0xb2, 0x81, 0x10, 0xe8,
145 0x47, 0x74, 0x12, 0xf1, 0xe6, 0x60, 0x3f, 0xe3,
146 0x6f, 0xb6, 0xa4, 0xc6, 0xe1, 0x08, 0xb3, 0xe4,
147 0x7d, 0x98, 0xf1, 0xfb, 0xd0, 0x42, 0xb2, 0x59,
148 0x26, 0x17, 0xfb, 0x72, 0x6b, 0x05, 0xa9, 0xac,
149 0x94, 0xbf, 0x88, 0x0a, 0x09, 0xef, 0xd2, 0xa5,
150 0x25, 0xae
151 };
152
153 /*
154 subject= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple iPod Accessories Certification Authority
155 issuer= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Root CA
156 serial=16
157 */
158 const uint8_t _iAP2CA[] = {
159 0x30, 0x82, 0x03, 0xfe, 0x30, 0x82, 0x02, 0xe6,
160 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x16,
161 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
162 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30,
163 0x62, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
164 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
165 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
166 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
167 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
168 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70,
169 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
170 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
171 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
172 0x69, 0x74, 0x79, 0x31, 0x16, 0x30, 0x14, 0x06,
173 0x03, 0x55, 0x04, 0x03, 0x13, 0x0d, 0x41, 0x70,
174 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74,
175 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30,
176 0x37, 0x30, 0x32, 0x31, 0x34, 0x32, 0x32, 0x31,
177 0x38, 0x30, 0x38, 0x5a, 0x17, 0x0d, 0x32, 0x32,
178 0x30, 0x32, 0x31, 0x34, 0x32, 0x32, 0x31, 0x38,
179 0x30, 0x38, 0x5a, 0x30, 0x81, 0x83, 0x31, 0x0b,
180 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
181 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06,
182 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70,
183 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e,
184 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04,
185 0x0b, 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65,
186 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
187 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41,
188 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79,
189 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04,
190 0x03, 0x13, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x65,
191 0x20, 0x69, 0x50, 0x6f, 0x64, 0x20, 0x41, 0x63,
192 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65,
193 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
194 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
195 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
196 0x79, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06,
197 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
198 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
199 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
200 0x01, 0x00, 0xa1, 0xf6, 0xca, 0xdb, 0x3d, 0x4a,
201 0x5a, 0x3e, 0xef, 0x74, 0x78, 0xf1, 0xb7, 0xb0,
202 0x32, 0x82, 0x1f, 0x90, 0xc6, 0x08, 0xdf, 0xaa,
203 0x3b, 0xd2, 0xcb, 0x0f, 0xe6, 0x37, 0x13, 0xf8,
204 0xff, 0x71, 0xfc, 0x28, 0x86, 0x24, 0x36, 0x85,
205 0x3f, 0xd0, 0x1d, 0x9c, 0xd0, 0x9c, 0xb2, 0x5d,
206 0x20, 0x41, 0xdc, 0xb0, 0xd8, 0xa8, 0x86, 0x3c,
207 0x42, 0x3c, 0xbe, 0x5a, 0x48, 0xdf, 0x34, 0x74,
208 0x9a, 0x61, 0x05, 0x0d, 0xce, 0xc8, 0x25, 0x14,
209 0xc8, 0x0a, 0xcd, 0xbd, 0xba, 0x12, 0x1b, 0x3b,
210 0x41, 0x13, 0x8e, 0x38, 0x65, 0x1d, 0xac, 0x1d,
211 0xd5, 0x38, 0x95, 0x9d, 0x3a, 0xd0, 0x79, 0x5c,
212 0x66, 0x9c, 0x47, 0x4b, 0x2c, 0xb8, 0x44, 0x3b,
213 0x7e, 0x8b, 0x68, 0x39, 0x3e, 0x46, 0xc1, 0xb8,
214 0xc0, 0x85, 0xd6, 0x84, 0xfb, 0x0e, 0xa6, 0xdd,
215 0x34, 0x06, 0xda, 0x1c, 0x78, 0xd9, 0xc4, 0x63,
216 0x11, 0x1b, 0xcf, 0x20, 0x15, 0xd2, 0x7a, 0xef,
217 0x60, 0x40, 0xdf, 0xba, 0xe0, 0x05, 0x45, 0x41,
218 0x82, 0x0e, 0x9b, 0x78, 0x2d, 0x2a, 0xb4, 0x94,
219 0xb5, 0xca, 0x79, 0xcd, 0xdb, 0xb5, 0x95, 0x02,
220 0xbe, 0x55, 0x2c, 0x36, 0x21, 0xaf, 0x6e, 0x39,
221 0xb6, 0x76, 0x5a, 0xec, 0x5d, 0x6a, 0xf3, 0xcc,
222 0xfa, 0x90, 0x8a, 0x15, 0x77, 0xbb, 0xba, 0x5c,
223 0x2b, 0xa1, 0x87, 0xf8, 0x0e, 0x70, 0x5d, 0x23,
224 0x01, 0x08, 0x79, 0xef, 0xab, 0xd7, 0x91, 0x38,
225 0x81, 0x35, 0xb3, 0x07, 0xd4, 0x79, 0xa2, 0x25,
226 0xa7, 0xf7, 0x90, 0x75, 0xeb, 0xeb, 0x71, 0xa2,
227 0xd0, 0xc1, 0xab, 0x02, 0x06, 0xf9, 0x07, 0x08,
228 0x97, 0x35, 0xda, 0x7e, 0x4d, 0x61, 0x51, 0x75,
229 0x92, 0xf6, 0x19, 0xf5, 0xdf, 0xfb, 0xc9, 0xa5,
230 0x4e, 0x9b, 0x8a, 0x14, 0x11, 0x4c, 0x10, 0x74,
231 0x83, 0xaf, 0x2f, 0xfc, 0xb6, 0xd6, 0x6b, 0x57,
232 0x46, 0x1d, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
233 0x81, 0x9c, 0x30, 0x81, 0x99, 0x30, 0x0e, 0x06,
234 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04,
235 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06,
236 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
237 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d,
238 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
239 0x14, 0xff, 0x4b, 0x1a, 0x43, 0x9a, 0xf5, 0x19,
240 0x96, 0xab, 0x18, 0x00, 0x2b, 0x61, 0xc9, 0xee,
241 0x40, 0x9d, 0x8e, 0xc7, 0x04, 0x30, 0x1f, 0x06,
242 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
243 0x80, 0x14, 0x2b, 0xd0, 0x69, 0x47, 0x94, 0x76,
244 0x09, 0xfe, 0xf4, 0x6b, 0x8d, 0x2e, 0x40, 0xa6,
245 0xf7, 0x47, 0x4d, 0x7f, 0x08, 0x5e, 0x30, 0x36,
246 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x2f, 0x30,
247 0x2d, 0x30, 0x2b, 0xa0, 0x29, 0xa0, 0x27, 0x86,
248 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
249 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c,
250 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70,
251 0x70, 0x6c, 0x65, 0x63, 0x61, 0x2f, 0x72, 0x6f,
252 0x6f, 0x74, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x0d,
253 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
254 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01,
255 0x01, 0x00, 0x9e, 0xb4, 0xaf, 0x3d, 0xb7, 0x61,
256 0xe0, 0x64, 0xc3, 0x86, 0x27, 0xd2, 0x3f, 0xe9,
257 0xe4, 0x08, 0x50, 0x77, 0xa2, 0x81, 0x09, 0x8c,
258 0x7d, 0xb7, 0xd0, 0x54, 0x52, 0xde, 0xfe, 0x8d,
259 0x48, 0xf2, 0x86, 0xc1, 0x17, 0xe5, 0x1a, 0x5d,
260 0x29, 0x20, 0xd3, 0x81, 0xca, 0xee, 0xc8, 0xa3,
261 0x61, 0xb3, 0x90, 0x9f, 0x73, 0xe8, 0xe3, 0xc8,
262 0xbc, 0xa7, 0x12, 0xb4, 0x8c, 0x2d, 0xaa, 0xf5,
263 0x39, 0x27, 0x19, 0xf5, 0xfb, 0xf9, 0x14, 0x7b,
264 0x3a, 0xb4, 0x78, 0x1a, 0x9a, 0x4c, 0x96, 0xeb,
265 0x36, 0xc7, 0xfe, 0xb5, 0xe7, 0x14, 0x7e, 0x6c,
266 0x4f, 0xa8, 0x22, 0xba, 0x23, 0x82, 0xf0, 0xce,
267 0xfa, 0x09, 0x7b, 0x8a, 0x0d, 0x5a, 0x61, 0x21,
268 0x74, 0x7a, 0xca, 0xc2, 0xca, 0x6b, 0xc2, 0x63,
269 0x40, 0x77, 0x23, 0x2b, 0x8f, 0xa0, 0x29, 0x5c,
270 0xeb, 0xad, 0xfc, 0xcc, 0xdc, 0x5a, 0x42, 0x42,
271 0x2e, 0xc8, 0x4f, 0xb4, 0x90, 0xd2, 0x6e, 0xfc,
272 0x4f, 0x8a, 0x0e, 0xa8, 0xb7, 0x83, 0x5c, 0x5c,
273 0x12, 0x02, 0x15, 0x17, 0xa8, 0x65, 0x7d, 0x5a,
274 0x28, 0x2b, 0x69, 0x5f, 0x76, 0x9e, 0x2f, 0xe0,
275 0x9e, 0xec, 0x41, 0x57, 0x97, 0xc5, 0x0f, 0x9a,
276 0xa0, 0x70, 0xb8, 0x2c, 0x8f, 0x6d, 0x80, 0xb5,
277 0x46, 0xec, 0xe8, 0x58, 0xb0, 0x04, 0x40, 0x3c,
278 0xc3, 0x62, 0x8a, 0x0a, 0xb7, 0xa9, 0x5b, 0x58,
279 0x7d, 0xea, 0x7b, 0x8c, 0xff, 0xf7, 0xf8, 0xbf,
280 0xd2, 0xc1, 0x95, 0x76, 0x05, 0xd7, 0x5d, 0x16,
281 0x4d, 0xf1, 0x1e, 0x7d, 0xb2, 0x81, 0x10, 0xe8,
282 0x47, 0x74, 0x12, 0xf1, 0xe6, 0x60, 0x3f, 0xe3,
283 0x6f, 0xb6, 0xa4, 0xc6, 0xe1, 0x08, 0xb3, 0xe4,
284 0x7d, 0x98, 0xf1, 0xfb, 0xd0, 0x42, 0xb2, 0x59,
285 0x26, 0x17, 0xfb, 0x72, 0x6b, 0x05, 0xa9, 0xac,
286 0x94, 0xbf, 0x88, 0x0a, 0x09, 0xef, 0xd2, 0xa5,
287 0x25, 0xae
288 };
289
290 /*
291 subject= /C=US/O=Apple Inc./OU=Apple iPod Accessories/CN=IPA_3333AA070313AA06AA0007AA000001
292 issuer= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple iPod Accessories Certification Authority
293 serial=3333AA070313AA06AA0007AA000001
294 */
295 const uint8_t _leaf0[] = {
296 0x30, 0x82, 0x03, 0x59, 0x30, 0x82, 0x02, 0x41,
297 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x0f, 0x33,
298 0x33, 0xaa, 0x07, 0x03, 0x13, 0xaa, 0x06, 0xaa,
299 0x00, 0x07, 0xaa, 0x00, 0x00, 0x01, 0x30, 0x0d,
300 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
301 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0x83,
302 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
303 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30,
304 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a,
305 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e,
306 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03,
307 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70, 0x70,
308 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69,
309 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
310 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
311 0x74, 0x79, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03,
312 0x55, 0x04, 0x03, 0x13, 0x2e, 0x41, 0x70, 0x70,
313 0x6c, 0x65, 0x20, 0x69, 0x50, 0x6f, 0x64, 0x20,
314 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
315 0x69, 0x65, 0x73, 0x20, 0x43, 0x65, 0x72, 0x74,
316 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
317 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
318 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x30,
319 0x37, 0x30, 0x33, 0x31, 0x33, 0x32, 0x31, 0x31,
320 0x37, 0x32, 0x36, 0x5a, 0x17, 0x0d, 0x31, 0x35,
321 0x30, 0x33, 0x31, 0x33, 0x32, 0x31, 0x31, 0x37,
322 0x32, 0x36, 0x5a, 0x30, 0x70, 0x31, 0x0b, 0x30,
323 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
324 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
325 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
326 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31,
327 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0b,
328 0x13, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
329 0x69, 0x50, 0x6f, 0x64, 0x20, 0x41, 0x63, 0x63,
330 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73,
331 0x31, 0x2b, 0x30, 0x29, 0x06, 0x03, 0x55, 0x04,
332 0x03, 0x14, 0x22, 0x49, 0x50, 0x41, 0x5f, 0x33,
333 0x33, 0x33, 0x33, 0x41, 0x41, 0x30, 0x37, 0x30,
334 0x33, 0x31, 0x33, 0x41, 0x41, 0x30, 0x36, 0x41,
335 0x41, 0x30, 0x30, 0x30, 0x37, 0x41, 0x41, 0x30,
336 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x81, 0x9f,
337 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
338 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
339 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81,
340 0x81, 0x00, 0xcb, 0x76, 0xe3, 0xa7, 0x3b, 0xf0,
341 0x42, 0xd5, 0x48, 0x93, 0x62, 0x0a, 0x10, 0x17,
342 0x37, 0xb9, 0xc8, 0x52, 0xdd, 0xde, 0x8a, 0x40,
343 0xa0, 0xf8, 0xda, 0xe8, 0x64, 0x0a, 0x67, 0xf5,
344 0x8f, 0x91, 0xa6, 0xb5, 0x93, 0xe8, 0xc2, 0x28,
345 0xb3, 0xac, 0xf4, 0xaf, 0x40, 0xc6, 0xbb, 0x49,
346 0x85, 0x5a, 0x7c, 0x1b, 0x42, 0xc3, 0x3c, 0xc8,
347 0x95, 0x36, 0x0b, 0x85, 0xbe, 0x36, 0x85, 0xb7,
348 0x0d, 0x04, 0x0e, 0x4e, 0x4c, 0x3c, 0x28, 0xfb,
349 0x03, 0x78, 0x42, 0xac, 0xf1, 0x9e, 0xad, 0x22,
350 0x7c, 0x86, 0xd3, 0xa6, 0x0e, 0xc8, 0x42, 0xbd,
351 0x9c, 0x7c, 0xd9, 0x2c, 0xe4, 0x1f, 0xd5, 0x91,
352 0x4e, 0x9d, 0xb7, 0xff, 0x83, 0x2e, 0x06, 0x3e,
353 0xd4, 0x95, 0xe4, 0x0e, 0x8e, 0x2d, 0x46, 0x8f,
354 0xcf, 0xe6, 0x32, 0xce, 0x47, 0x56, 0x57, 0x97,
355 0x1a, 0x87, 0xc8, 0xd4, 0xf3, 0x32, 0xf9, 0xd6,
356 0x80, 0x83, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
357 0x60, 0x30, 0x5e, 0x30, 0x0e, 0x06, 0x03, 0x55,
358 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03,
359 0x02, 0x03, 0xb8, 0x30, 0x0c, 0x06, 0x03, 0x55,
360 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30,
361 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e,
362 0x04, 0x16, 0x04, 0x14, 0x71, 0x53, 0x3f, 0x7f,
363 0x72, 0x47, 0xbb, 0xe3, 0x60, 0xd9, 0xd9, 0xd8,
364 0x39, 0x6d, 0x8d, 0x33, 0xa3, 0x74, 0xc3, 0x59,
365 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04,
366 0x18, 0x30, 0x16, 0x80, 0x14, 0xff, 0x4b, 0x1a,
367 0x43, 0x9a, 0xf5, 0x19, 0x96, 0xab, 0x18, 0x00,
368 0x2b, 0x61, 0xc9, 0xee, 0x40, 0x9d, 0x8e, 0xc7,
369 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
370 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
371 0x03, 0x82, 0x01, 0x01, 0x00, 0x0f, 0xd9, 0x40,
372 0x27, 0x1c, 0x00, 0x01, 0x2d, 0x4c, 0x67, 0xa6,
373 0x0d, 0x74, 0xa8, 0xbd, 0xf6, 0x97, 0x16, 0x46,
374 0xb1, 0x02, 0xd7, 0x51, 0xf6, 0x02, 0xc1, 0x0f,
375 0xb1, 0x34, 0x8a, 0xcb, 0xb7, 0x81, 0x29, 0xbd,
376 0x7b, 0x67, 0xa3, 0xe6, 0x49, 0x3d, 0xbb, 0x3e,
377 0x0d, 0x26, 0x75, 0x1d, 0xdc, 0x37, 0xa7, 0x38,
378 0x86, 0xd8, 0x81, 0x5a, 0xc5, 0xaf, 0xcd, 0xd6,
379 0xcb, 0x0e, 0xba, 0x53, 0x28, 0x57, 0x83, 0x16,
380 0x23, 0xcc, 0x11, 0x01, 0x0e, 0x18, 0x4d, 0xfe,
381 0x29, 0x1b, 0x7c, 0x3f, 0x33, 0xd5, 0x4b, 0x7c,
382 0x74, 0xb5, 0xfd, 0x62, 0xc5, 0x45, 0xec, 0x08,
383 0xe4, 0xc0, 0xd3, 0xce, 0xba, 0xb0, 0x04, 0x0d,
384 0x7c, 0xef, 0x5c, 0x3f, 0x92, 0xdc, 0x45, 0x24,
385 0xa3, 0x02, 0xfe, 0xa4, 0x60, 0x15, 0x28, 0x43,
386 0x1b, 0x46, 0x51, 0x1f, 0x9f, 0x0d, 0x89, 0x62,
387 0x6c, 0x30, 0xe2, 0x2b, 0xf7, 0x8c, 0x7b, 0xd6,
388 0xe3, 0x71, 0x11, 0xd1, 0xe5, 0xf5, 0x83, 0xae,
389 0xd8, 0xeb, 0x5a, 0x40, 0xb6, 0x09, 0x00, 0x53,
390 0x8f, 0xaf, 0x4d, 0xa7, 0x3d, 0x50, 0xb0, 0x1b,
391 0x88, 0x6b, 0x9d, 0x18, 0x79, 0x1e, 0xcb, 0xbf,
392 0x86, 0xba, 0xde, 0x48, 0x28, 0x3a, 0x53, 0x17,
393 0x59, 0x2d, 0xc2, 0x98, 0xe0, 0xe7, 0x54, 0x03,
394 0xd0, 0x1d, 0xfb, 0xc1, 0xca, 0x68, 0x43, 0x2d,
395 0x23, 0xc3, 0xa3, 0x12, 0x04, 0x89, 0x77, 0x41,
396 0xb8, 0x96, 0x3f, 0xdc, 0x00, 0x73, 0x07, 0xd0,
397 0xa6, 0x8c, 0x35, 0x45, 0xb4, 0x07, 0x69, 0xf8,
398 0x79, 0x6e, 0x7b, 0x04, 0x6d, 0x0f, 0x95, 0x20,
399 0x5b, 0x76, 0x17, 0x78, 0x91, 0x91, 0xa4, 0xbe,
400 0x6d, 0x5c, 0xe9, 0x71, 0x12, 0x68, 0x6c, 0xb7,
401 0xa4, 0x36, 0xc3, 0x82, 0xcf, 0x65, 0x7d, 0xe3,
402 0x50, 0x92, 0x02, 0x54, 0x3d, 0xfe, 0x16, 0x8d,
403 0x4f, 0xe0, 0x11, 0xe0, 0xb5
404 };
405
406 /*
407 subject= /C=US/O=Apple Computer, Inc./OU=Apple Computer iPod Accessories/CN=IPA_3333AA070313AA06AA0011AA000001
408 issuer= /C=US/O=Apple Computer, Inc./OU=Apple Computer Certificate Authority/CN=Apple iPod Accessories Certificate Authority
409 serial=3333AA070313AA06AA0011AA000001
410 */
411 const uint8_t _leaf1[] = {
412 0x30, 0x82, 0x03, 0x7c, 0x30, 0x82, 0x02, 0x64,
413 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x0f, 0x33,
414 0x33, 0xaa, 0x07, 0x03, 0x13, 0xaa, 0x06, 0xaa,
415 0x00, 0x11, 0xaa, 0x00, 0x00, 0x01, 0x30, 0x0d,
416 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
417 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0x92,
418 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
419 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x1d, 0x30,
420 0x1b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x14,
421 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f,
422 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x2c, 0x20,
423 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x2d, 0x30, 0x2b,
424 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x24, 0x41,
425 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6d,
426 0x70, 0x75, 0x74, 0x65, 0x72, 0x20, 0x43, 0x65,
427 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
428 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
429 0x69, 0x74, 0x79, 0x31, 0x35, 0x30, 0x33, 0x06,
430 0x03, 0x55, 0x04, 0x03, 0x13, 0x2c, 0x41, 0x70,
431 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x6f, 0x64,
432 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f,
433 0x72, 0x69, 0x65, 0x73, 0x20, 0x43, 0x65, 0x72,
434 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
435 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
436 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x37,
437 0x30, 0x33, 0x31, 0x33, 0x32, 0x31, 0x32, 0x37,
438 0x33, 0x35, 0x5a, 0x17, 0x0d, 0x31, 0x35, 0x30,
439 0x33, 0x31, 0x33, 0x32, 0x31, 0x32, 0x37, 0x33,
440 0x35, 0x5a, 0x30, 0x81, 0x83, 0x31, 0x0b, 0x30,
441 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
442 0x55, 0x53, 0x31, 0x1d, 0x30, 0x1b, 0x06, 0x03,
443 0x55, 0x04, 0x0a, 0x13, 0x14, 0x41, 0x70, 0x70,
444 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75,
445 0x74, 0x65, 0x72, 0x2c, 0x20, 0x49, 0x6e, 0x63,
446 0x2e, 0x31, 0x28, 0x30, 0x26, 0x06, 0x03, 0x55,
447 0x04, 0x0b, 0x13, 0x1f, 0x41, 0x70, 0x70, 0x6c,
448 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74,
449 0x65, 0x72, 0x20, 0x69, 0x50, 0x6f, 0x64, 0x20,
450 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
451 0x69, 0x65, 0x73, 0x31, 0x2b, 0x30, 0x29, 0x06,
452 0x03, 0x55, 0x04, 0x03, 0x14, 0x22, 0x49, 0x50,
453 0x41, 0x5f, 0x33, 0x33, 0x33, 0x33, 0x41, 0x41,
454 0x30, 0x37, 0x30, 0x33, 0x31, 0x33, 0x41, 0x41,
455 0x30, 0x36, 0x41, 0x41, 0x30, 0x30, 0x31, 0x31,
456 0x41, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31,
457 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a,
458 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
459 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81,
460 0x89, 0x02, 0x81, 0x81, 0x00, 0x91, 0x66, 0xdb,
461 0x40, 0x0e, 0xc4, 0xe5, 0x8d, 0xb3, 0x86, 0xfd,
462 0x36, 0x06, 0x38, 0xcc, 0x83, 0xa4, 0xd7, 0xff,
463 0x14, 0xa6, 0x77, 0x3b, 0x63, 0x7a, 0xae, 0xe8,
464 0x76, 0xdb, 0xd8, 0x2f, 0x7c, 0x70, 0x84, 0xe8,
465 0x0a, 0x63, 0x33, 0xa7, 0xcb, 0x0e, 0x17, 0x94,
466 0x80, 0x39, 0xb7, 0xe6, 0x16, 0x0c, 0xa7, 0x1f,
467 0x7d, 0x11, 0x02, 0x76, 0xda, 0x1d, 0x0b, 0xed,
468 0x8d, 0x2a, 0xeb, 0x60, 0xcf, 0x55, 0x85, 0xbd,
469 0x92, 0x32, 0xc9, 0xc9, 0xb2, 0x16, 0xea, 0xba,
470 0xa8, 0xc8, 0x8c, 0xe4, 0x93, 0x7a, 0x0a, 0xaa,
471 0x40, 0x24, 0x0f, 0x96, 0xc7, 0xc5, 0x95, 0x21,
472 0xd9, 0xb0, 0x98, 0x51, 0x8d, 0xe4, 0xc6, 0x63,
473 0x6e, 0x73, 0x92, 0xab, 0x77, 0xe9, 0x71, 0xaf,
474 0x0e, 0x50, 0xa3, 0xb4, 0x68, 0xa8, 0x82, 0x67,
475 0x88, 0xf9, 0xa5, 0xc8, 0x68, 0x7b, 0x49, 0x36,
476 0x72, 0xee, 0x06, 0x1a, 0x95, 0x02, 0x03, 0x01,
477 0x00, 0x01, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x0e,
478 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff,
479 0x04, 0x04, 0x03, 0x02, 0x03, 0xb8, 0x30, 0x0c,
480 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff,
481 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03,
482 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xde,
483 0x6a, 0x9d, 0x5e, 0x83, 0x77, 0xa6, 0xfe, 0xa9,
484 0x65, 0x30, 0x5f, 0x98, 0xe8, 0xa4, 0x7c, 0xde,
485 0x0a, 0xb3, 0x48, 0x30, 0x1f, 0x06, 0x03, 0x55,
486 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
487 0xc9, 0xaa, 0x84, 0x6b, 0x06, 0xb8, 0x76, 0xe2,
488 0x96, 0x4f, 0xe7, 0x27, 0x02, 0xd7, 0x2e, 0x3b,
489 0xda, 0xf7, 0xb0, 0x18, 0x30, 0x0d, 0x06, 0x09,
490 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
491 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00,
492 0x96, 0x07, 0x3b, 0x68, 0xe8, 0x2f, 0x97, 0xa5,
493 0x42, 0xff, 0x9d, 0x34, 0xfd, 0x3a, 0xd2, 0x01,
494 0x69, 0xd7, 0x67, 0x46, 0x9a, 0x7d, 0x56, 0xe0,
495 0x7f, 0x91, 0xee, 0xc3, 0x5c, 0xd2, 0x51, 0x54,
496 0xe3, 0xd2, 0x17, 0x08, 0xb2, 0xbc, 0xcd, 0x85,
497 0xf8, 0x8e, 0xad, 0x49, 0x53, 0xe1, 0x07, 0x5a,
498 0x9b, 0x03, 0xa2, 0x35, 0xca, 0xcf, 0xc6, 0xb6,
499 0xc9, 0x71, 0x53, 0xbc, 0x2e, 0xa3, 0x1b, 0x03,
500 0x5c, 0x55, 0x57, 0xa3, 0x10, 0xbc, 0x15, 0x81,
501 0xd5, 0xe6, 0xa3, 0xb8, 0x21, 0x50, 0x2e, 0x44,
502 0xd4, 0xea, 0x71, 0x17, 0xe5, 0xfc, 0x71, 0xc3,
503 0xf9, 0xe8, 0x99, 0x98, 0xf3, 0x5f, 0xff, 0xb2,
504 0x8e, 0xc7, 0x56, 0x74, 0x46, 0xec, 0x63, 0x3f,
505 0x4a, 0xa6, 0x9c, 0x85, 0x7c, 0x08, 0x61, 0x32,
506 0xb7, 0x35, 0x36, 0x01, 0x0c, 0xce, 0xd8, 0xe3,
507 0xc4, 0x6a, 0x0d, 0xf2, 0x25, 0x56, 0x59, 0xba,
508 0x88, 0x1b, 0xb4, 0x21, 0x80, 0xb9, 0x69, 0x9e,
509 0x93, 0xf7, 0xb1, 0x22, 0x19, 0x8b, 0x8b, 0xd8,
510 0xbd, 0xdc, 0x0c, 0xa7, 0x69, 0x4b, 0x5b, 0xe9,
511 0xd7, 0x7a, 0x1d, 0xef, 0x37, 0x0d, 0x24, 0xdc,
512 0xa7, 0x67, 0xbc, 0x0d, 0xe1, 0x0d, 0x28, 0xa0,
513 0xb8, 0x83, 0x28, 0x6a, 0x8a, 0xd6, 0x59, 0x40,
514 0x4a, 0xf1, 0x06, 0x0d, 0x75, 0xb9, 0x81, 0x4b,
515 0x4c, 0x2d, 0xcb, 0x57, 0xe0, 0x7a, 0x32, 0x5b,
516 0xe0, 0xea, 0xdd, 0x0c, 0xdc, 0xfd, 0x5e, 0x7e,
517 0xb0, 0x77, 0x07, 0x0d, 0xa7, 0x14, 0x0b, 0x41,
518 0x94, 0x4f, 0x10, 0x3e, 0xa5, 0x0c, 0x68, 0x3f,
519 0x8c, 0x70, 0x5c, 0x29, 0xb7, 0xe9, 0xfc, 0x09,
520 0x35, 0x5c, 0x2d, 0xb3, 0xa9, 0x4f, 0x51, 0xb0,
521 0xa7, 0xd5, 0xad, 0x3f, 0xe2, 0xa2, 0x4c, 0x73,
522 0xfc, 0x2f, 0x6e, 0x21, 0x38, 0xe5, 0xbb, 0x8b,
523 0x57, 0x51, 0xe5, 0x9b, 0x8b, 0xa6, 0xaa, 0x0b
524 };
525
526 #define CFReleaseSafe(CF) { CFTypeRef _cf = (CF); if (_cf) CFRelease(_cf); }
527
528 /* Test basic add delete update copy matching stuff. */
529 static void tests(void)
530 {
531 SecTrustRef trust;
532 SecCertificateRef iAP1CA, iAP2CA, leaf0, leaf1;
533 isnt(iAP1CA = SecCertificateCreateWithBytes(NULL, _iAP1CA, sizeof(_iAP1CA)),
534 NULL, "create iAP1CA");
535 isnt(iAP2CA = SecCertificateCreateWithBytes(NULL, _iAP2CA, sizeof(_iAP2CA)),
536 NULL, "create iAP2CA");
537 isnt(leaf0 = SecCertificateCreateWithBytes(NULL, _leaf0, sizeof(_leaf0)),
538 NULL, "create leaf0");
539 isnt(leaf1 = SecCertificateCreateWithBytes(NULL, _leaf1, sizeof(_leaf1)),
540 NULL, "create leaf1");
541 {
542 // temporarily grab some stack space and fill it with 0xFF;
543 // when we exit this scope, the stack pointer should shrink but leave the memory filled.
544 // this tests for a stack overflow bug inside SecPolicyCreateiAP (rdar://16056248)
545 char buf[2048];
546 memset(buf, 0xFF, sizeof(buf));
547 }
548 SecPolicyRef policy = SecPolicyCreateiAP();
549 const void *v_anchors[] = {
550 iAP1CA,
551 iAP2CA
552 };
553 CFArrayRef anchors = CFArrayCreate(NULL, v_anchors,
554 array_size(v_anchors), NULL);
555 CFArrayRef certs0 = CFArrayCreate(NULL, (const void **)&leaf0, 1, NULL);
556 CFArrayRef certs1 = CFArrayCreate(NULL, (const void **)&leaf1, 1, NULL);
557 ok_status(SecTrustCreateWithCertificates(certs0, policy, &trust), "create trust for leaf0");
558 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
559
560 /* Jan 1st 2008. */
561 CFDateRef date = CFDateCreate(NULL, 220752000.0);
562 ok_status(SecTrustSetVerifyDate(trust, date), "set date");
563
564 SecTrustResultType trustResult;
565 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
566 is_status(trustResult, kSecTrustResultUnspecified,
567 "trust is kSecTrustResultUnspecified");
568
569 is(SecTrustGetCertificateCount(trust), 2, "cert count is 2");
570
571 CFReleaseSafe(trust);
572 ok_status(SecTrustCreateWithCertificates(certs1, policy, &trust), "create trust for leaf1");
573 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
574 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
575 TODO:
576 {
577 todo("We need the actual iAP1 intermediate");
578 is_status(trustResult, kSecTrustResultUnspecified,
579 "trust is kSecTrustResultUnspecified");
580 }
581
582 CFReleaseSafe(anchors);
583 CFReleaseSafe(certs1);
584 CFReleaseSafe(certs0);
585 CFReleaseSafe(trust);
586 CFReleaseSafe(policy);
587 CFReleaseSafe(leaf0);
588 CFReleaseSafe(leaf1);
589 CFReleaseSafe(iAP1CA);
590 CFReleaseSafe(iAP2CA);
591 CFReleaseSafe(date);
592 }
593
594 int si_22_sectrust_iap(int argc, char *const *argv)
595 {
596 plan_tests(14);
597
598
599 tests();
600
601 return 0;
602 }