]> git.saurik.com Git - apple/security.git/blob - sec/Security/Regressions/secitem/si-20-sectrust-activation.c
Security-55471.tar.gz
[apple/security.git] / sec / Security / Regressions / secitem / si-20-sectrust-activation.c
1 /*
2 * Copyright (c) 2006-2010 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 <Security/SecTrustPriv.h>
11 #include <Security/SecInternal.h>
12 #include <utilities/array_size.h>
13 #include <stdlib.h>
14 #include <unistd.h>
15
16 #include "Security_regressions.h"
17
18 unsigned char certa[] = {
19 0x30, 0x82, 0x02, 0xba, 0x30, 0x82, 0x01, 0xa2, 0xa0, 0x03, 0x02, 0x01,
20 0x02, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
21 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x00, 0x30, 0x1e, 0x17,
22 0x0d, 0x31, 0x30, 0x30, 0x38, 0x32, 0x34, 0x32, 0x32, 0x35, 0x35, 0x31,
23 0x37, 0x5a, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x38, 0x32, 0x31, 0x32, 0x32,
24 0x35, 0x35, 0x31, 0x37, 0x5a, 0x30, 0x00, 0x30, 0x82, 0x01, 0x22, 0x30,
25 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
26 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02,
27 0x82, 0x01, 0x01, 0x00, 0xbe, 0xa4, 0x39, 0x73, 0x58, 0xca, 0xcc, 0x43,
28 0x1c, 0xb1, 0xce, 0x1e, 0xf3, 0x4b, 0xcd, 0x80, 0xb5, 0x90, 0x66, 0x06,
29 0xf7, 0x82, 0x08, 0xf8, 0xd6, 0x93, 0x6e, 0x06, 0x89, 0xed, 0x70, 0x66,
30 0xfb, 0xed, 0x96, 0xcd, 0xcb, 0x6a, 0x7b, 0x93, 0x74, 0x15, 0x8e, 0x37,
31 0x8b, 0x40, 0x6d, 0x29, 0xf7, 0x37, 0x4c, 0x44, 0x66, 0x73, 0xe4, 0xb2,
32 0x7f, 0x9b, 0x13, 0x73, 0x3a, 0x5d, 0x12, 0x1c, 0xa0, 0x39, 0x98, 0xdb,
33 0x26, 0xa1, 0x56, 0x2b, 0xf4, 0xc5, 0x39, 0xa3, 0xd8, 0x83, 0x2d, 0xa9,
34 0x6b, 0x73, 0xac, 0x42, 0xc0, 0xb8, 0xbf, 0xfb, 0xb7, 0x2e, 0xf2, 0x90,
35 0xa6, 0x96, 0xa4, 0x8c, 0xf5, 0xdf, 0xd4, 0x26, 0xff, 0x08, 0x30, 0x39,
36 0x1f, 0x59, 0xd4, 0xbf, 0x2f, 0x8f, 0x24, 0xab, 0x80, 0xff, 0x6c, 0x5a,
37 0x6b, 0xfd, 0x9b, 0xac, 0x10, 0x96, 0x86, 0x07, 0x04, 0x20, 0x1f, 0xb3,
38 0xf8, 0x0a, 0xdd, 0x09, 0x48, 0x04, 0x1e, 0x43, 0x66, 0x81, 0x96, 0xa4,
39 0x98, 0x3d, 0x50, 0x4e, 0xef, 0x29, 0x36, 0x3a, 0xad, 0x60, 0x70, 0xd3,
40 0x76, 0xee, 0xed, 0x6a, 0xd5, 0xf9, 0x6c, 0xac, 0x3f, 0x92, 0xff, 0x36,
41 0xe8, 0x96, 0x19, 0xfb, 0x6f, 0x8a, 0x68, 0xd0, 0x32, 0x2e, 0xc9, 0xe2,
42 0x47, 0xf7, 0x5d, 0xd3, 0xba, 0x84, 0x7f, 0x06, 0xaf, 0xa1, 0xa9, 0x7a,
43 0xb9, 0x02, 0xf3, 0x0a, 0x95, 0xe3, 0xef, 0x45, 0x99, 0x4d, 0x7d, 0xfb,
44 0xb0, 0x94, 0x5c, 0x14, 0xeb, 0x53, 0x15, 0x9b, 0xc9, 0x7b, 0x13, 0x13,
45 0xd3, 0x53, 0xb8, 0x42, 0xdd, 0x63, 0xbf, 0xaa, 0xe9, 0xff, 0x21, 0x86,
46 0x21, 0xef, 0xb4, 0x3c, 0x41, 0x38, 0xd8, 0x68, 0x6b, 0xd8, 0x75, 0x48,
47 0x15, 0x57, 0x39, 0x28, 0xf0, 0xe3, 0x1a, 0x5c, 0x02, 0x0f, 0x1d, 0xd6,
48 0x90, 0xd3, 0xd9, 0x78, 0x6d, 0xd4, 0xba, 0x2d, 0x02, 0x03, 0x01, 0x00,
49 0x01, 0xa3, 0x3f, 0x30, 0x3d, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
50 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55,
51 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa4, 0x9b, 0x02, 0x27, 0xdf, 0xb1,
52 0xc3, 0x84, 0x43, 0x44, 0x36, 0x3e, 0x5b, 0x7c, 0x43, 0x3b, 0x69, 0x9e,
53 0x35, 0x0b, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff,
54 0x04, 0x04, 0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
55 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01,
56 0x01, 0x00, 0x44, 0xb0, 0x0f, 0x9b, 0xc1, 0x93, 0x72, 0x0a, 0xdd, 0x68,
57 0x0a, 0x08, 0x78, 0xf0, 0xee, 0x95, 0x38, 0x31, 0x8c, 0x71, 0x96, 0x5d,
58 0xb3, 0xc2, 0xd6, 0xa3, 0xdb, 0xc3, 0xaa, 0x06, 0xa4, 0xf8, 0xb4, 0xb0,
59 0xd3, 0xb8, 0xcd, 0x3f, 0x22, 0xf0, 0xf1, 0x5c, 0xf5, 0xf8, 0x46, 0xa2,
60 0xf2, 0xd2, 0xd3, 0xa2, 0x2f, 0x30, 0xd8, 0x90, 0x9f, 0x1a, 0xb7, 0x9b,
61 0xc9, 0xf1, 0x72, 0xde, 0xb5, 0xfe, 0x62, 0xb6, 0x73, 0xe8, 0xb9, 0xe4,
62 0x3a, 0x77, 0xb6, 0xd5, 0x9f, 0x22, 0x06, 0x71, 0x31, 0x83, 0x5c, 0xd3,
63 0x06, 0x76, 0x7d, 0x67, 0x0e, 0x8e, 0xa5, 0x69, 0xb1, 0x4e, 0xe4, 0x5f,
64 0x67, 0x74, 0xe4, 0x56, 0xd8, 0x73, 0x35, 0x2e, 0x0d, 0x4f, 0xdd, 0x1a,
65 0xc1, 0x47, 0xb5, 0x16, 0xa1, 0x8c, 0x63, 0x7b, 0x0d, 0x95, 0xe8, 0x84,
66 0xce, 0x7e, 0xd4, 0xc6, 0xae, 0x8c, 0x7d, 0xfe, 0xc4, 0xe8, 0xb7, 0x09,
67 0xd9, 0x2b, 0xaa, 0xbe, 0x90, 0x9c, 0x86, 0xcb, 0xc8, 0xcc, 0x73, 0x3a,
68 0xaa, 0xd7, 0x19, 0x7d, 0x7f, 0xfc, 0x84, 0x5f, 0x31, 0x4e, 0xb7, 0xd0,
69 0xeb, 0x5c, 0xb7, 0x0b, 0x3a, 0x06, 0x0e, 0xeb, 0x80, 0x4d, 0x96, 0x85,
70 0x64, 0xbf, 0xf0, 0xc8, 0x6a, 0x5d, 0x0e, 0xd3, 0x26, 0x76, 0xbe, 0xb5,
71 0x36, 0x25, 0x68, 0x41, 0x10, 0x0a, 0x79, 0x58, 0x0f, 0x7f, 0x44, 0xf4,
72 0xf1, 0x9b, 0xeb, 0x00, 0xac, 0xbf, 0xa6, 0xaa, 0x3d, 0x88, 0x40, 0x70,
73 0x03, 0x7c, 0x5a, 0x45, 0x17, 0x8c, 0xf1, 0xe3, 0xf4, 0x61, 0x77, 0x56,
74 0x5f, 0xfc, 0x7a, 0xc8, 0x35, 0x5a, 0x95, 0xe3, 0x0c, 0xfb, 0x6d, 0x6d,
75 0x6c, 0xcc, 0x86, 0x47, 0x9d, 0xb3, 0xe1, 0xe2, 0x26, 0xcb, 0xb8, 0xa4,
76 0x91, 0xb6, 0x51, 0x4c, 0xf5, 0x37, 0x68, 0x29, 0xc1, 0xef, 0xba, 0xf0,
77 0x8b, 0x82, 0x17, 0x65, 0x81, 0xe9
78 };
79 unsigned int certa_len = 702;
80
81 unsigned char certb[] = {
82 0x30, 0x82, 0x02, 0xad, 0x30, 0x82, 0x01, 0x95, 0xa0, 0x03, 0x02, 0x01,
83 0x02, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
84 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x00, 0x30, 0x1e, 0x17,
85 0x0d, 0x31, 0x30, 0x30, 0x38, 0x32, 0x34, 0x32, 0x32, 0x35, 0x35, 0x31,
86 0x37, 0x5a, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x38, 0x32, 0x31, 0x32, 0x32,
87 0x35, 0x35, 0x31, 0x37, 0x5a, 0x30, 0x00, 0x30, 0x82, 0x01, 0x22, 0x30,
88 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
89 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02,
90 0x82, 0x01, 0x01, 0x00, 0xd7, 0x67, 0x3f, 0xf1, 0x88, 0xf8, 0x81, 0x9d,
91 0x6b, 0x8a, 0x5e, 0xc7, 0xc7, 0x1f, 0xfc, 0x04, 0x89, 0x81, 0x0a, 0x1a,
92 0x7f, 0x70, 0x63, 0x6f, 0x66, 0x8e, 0x1a, 0x7a, 0xb0, 0xf9, 0xb9, 0x71,
93 0x3d, 0xda, 0xcb, 0xd5, 0x84, 0xa8, 0x67, 0x4e, 0xde, 0x7e, 0x3e, 0xc8,
94 0x15, 0x01, 0xe2, 0x41, 0xb7, 0x82, 0x4a, 0x6e, 0x62, 0x12, 0xa1, 0xe7,
95 0x8b, 0x78, 0x5c, 0x50, 0x13, 0xd1, 0x0a, 0xbc, 0x6c, 0x6b, 0xad, 0xb6,
96 0x3b, 0x65, 0xd6, 0x89, 0x03, 0x76, 0x51, 0x2b, 0xee, 0xa1, 0x8b, 0x54,
97 0x41, 0xbb, 0x03, 0x6a, 0x55, 0xda, 0x06, 0xac, 0xf0, 0xd0, 0xa0, 0x39,
98 0xe5, 0x0e, 0x22, 0xe9, 0x44, 0x28, 0xfb, 0x03, 0xbd, 0x21, 0xc5, 0xb6,
99 0xd3, 0x11, 0x3b, 0x90, 0x78, 0xc3, 0xe7, 0x41, 0x8d, 0x9b, 0xf1, 0xab,
100 0x0f, 0xa3, 0x31, 0x4f, 0x52, 0x59, 0x0f, 0x66, 0x66, 0x86, 0x43, 0x26,
101 0x3f, 0x4e, 0x29, 0x83, 0x7f, 0x60, 0x3d, 0x59, 0x55, 0xad, 0x47, 0x09,
102 0x75, 0x96, 0x50, 0xec, 0xfb, 0x15, 0xbd, 0x15, 0x2a, 0x32, 0x73, 0x23,
103 0xe8, 0x3e, 0xe0, 0x16, 0xc6, 0x46, 0x54, 0x6d, 0xff, 0x84, 0x5a, 0x55,
104 0xe1, 0xea, 0xb3, 0xcc, 0x33, 0xf2, 0xa1, 0x2d, 0x5a, 0x1e, 0x48, 0xc5,
105 0x75, 0xa1, 0x84, 0xc4, 0x81, 0x7d, 0xcf, 0xf9, 0x8d, 0x09, 0xdc, 0xba,
106 0xad, 0xad, 0x52, 0x34, 0xc0, 0xda, 0xec, 0x37, 0x14, 0x24, 0xda, 0xdf,
107 0xd6, 0x3e, 0x98, 0xfc, 0x8e, 0x00, 0xf7, 0x8a, 0x44, 0xe5, 0xe6, 0xe7,
108 0x07, 0x0e, 0x8a, 0x52, 0xff, 0xff, 0xac, 0x9c, 0x3e, 0x31, 0xc7, 0x93,
109 0xe6, 0x71, 0xf3, 0x13, 0x42, 0xe3, 0x99, 0x73, 0x17, 0x5b, 0x79, 0xfa,
110 0xd4, 0xc2, 0xcd, 0x68, 0x59, 0x43, 0x91, 0xb0, 0x87, 0xd0, 0x5f, 0x5c,
111 0x22, 0x1c, 0xbf, 0xc2, 0x12, 0x4c, 0xc2, 0x4b, 0x02, 0x03, 0x01, 0x00,
112 0x01, 0xa3, 0x32, 0x30, 0x30, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13,
113 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d,
114 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xae, 0xc3, 0x1e,
115 0x3f, 0x30, 0xe6, 0xe4, 0xf5, 0x68, 0x0d, 0x57, 0xed, 0x55, 0x53, 0xea,
116 0x91, 0xdb, 0x71, 0x24, 0xcf, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
117 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01,
118 0x00, 0x28, 0x3d, 0xe2, 0xa1, 0x7e, 0x13, 0x8b, 0xd7, 0xf3, 0xf5, 0xaa,
119 0x5a, 0x2c, 0x06, 0x95, 0x5f, 0x3d, 0x12, 0x2a, 0xf4, 0xbd, 0x80, 0xb2,
120 0x3a, 0x2d, 0x72, 0x85, 0xb6, 0xf6, 0x1f, 0xdc, 0x5e, 0x27, 0xfb, 0xc4,
121 0xb8, 0x48, 0xeb, 0xab, 0x44, 0xec, 0x8b, 0xa9, 0x0b, 0x77, 0xb5, 0x21,
122 0xa0, 0x3c, 0x11, 0xec, 0x9c, 0x68, 0x8b, 0xe8, 0x35, 0x5f, 0xaf, 0xee,
123 0x0a, 0x8d, 0x39, 0x44, 0xa4, 0x75, 0x97, 0x73, 0x49, 0x41, 0xef, 0xe3,
124 0xf7, 0xc7, 0x0d, 0x7f, 0x23, 0x0d, 0xfe, 0x83, 0xf3, 0x7b, 0x21, 0x00,
125 0x5b, 0x2d, 0xbb, 0x76, 0xea, 0x79, 0xce, 0x2c, 0x86, 0x15, 0x08, 0xf7,
126 0x12, 0x48, 0x0e, 0x5e, 0x0c, 0x97, 0xce, 0xbd, 0xc9, 0x0d, 0xa2, 0x73,
127 0xec, 0x81, 0x54, 0x2b, 0x50, 0xab, 0xb6, 0xea, 0xa7, 0xa1, 0x8a, 0xbf,
128 0xee, 0x16, 0xf1, 0x2b, 0x03, 0x97, 0xfb, 0x38, 0x9d, 0xa8, 0xde, 0x73,
129 0xb1, 0x8f, 0xd2, 0x3b, 0x40, 0x86, 0x32, 0xdb, 0xeb, 0x8f, 0x0a, 0xf7,
130 0x1f, 0xac, 0xbc, 0x32, 0x05, 0x8b, 0xa1, 0xc6, 0xdd, 0x39, 0x9c, 0xfa,
131 0x70, 0x91, 0xda, 0x80, 0x60, 0xfa, 0xaa, 0xef, 0x51, 0x65, 0x2c, 0x09,
132 0x21, 0x9b, 0x35, 0xed, 0x99, 0x07, 0xbd, 0x63, 0x84, 0x72, 0xa0, 0xc4,
133 0x11, 0x7e, 0x6e, 0x27, 0xe1, 0xda, 0xd4, 0xac, 0xf1, 0xca, 0xc0, 0xfd,
134 0x77, 0x64, 0x29, 0x3b, 0x49, 0x64, 0x5f, 0xe3, 0x4c, 0x8b, 0x93, 0x98,
135 0x9a, 0x9a, 0xb7, 0xb7, 0x04, 0xfc, 0x7d, 0x82, 0x9b, 0xcc, 0x1d, 0xd2,
136 0x8c, 0x98, 0x3b, 0x9a, 0xca, 0x53, 0x9b, 0x04, 0x6d, 0x3d, 0x41, 0x38,
137 0x8c, 0x2b, 0xea, 0xaa, 0x28, 0xef, 0x27, 0xd3, 0xc7, 0x0e, 0x59, 0xa1,
138 0x30, 0xd9, 0xee, 0x92, 0x5a, 0x34, 0x21, 0x11, 0x54, 0xa4, 0xdd, 0xc0,
139 0x86, 0x07, 0xd9, 0x33, 0xb1
140 };
141 unsigned int certb_len = 689;
142
143 unsigned char certc[] = {
144 0x30, 0x82, 0x02, 0xad, 0x30, 0x82, 0x01, 0x95, 0xa0, 0x03, 0x02, 0x01,
145 0x02, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
146 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x00, 0x30, 0x1e, 0x17,
147 0x0d, 0x31, 0x30, 0x30, 0x38, 0x32, 0x37, 0x32, 0x33, 0x30, 0x37, 0x34,
148 0x35, 0x5a, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x38, 0x32, 0x34, 0x32, 0x33,
149 0x30, 0x37, 0x34, 0x35, 0x5a, 0x30, 0x00, 0x30, 0x82, 0x01, 0x22, 0x30,
150 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
151 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02,
152 0x82, 0x01, 0x01, 0x00, 0xae, 0x74, 0xef, 0x9f, 0x1f, 0x5d, 0x85, 0x83,
153 0x57, 0xce, 0x65, 0xd5, 0x54, 0x2d, 0x71, 0x4d, 0xea, 0x6c, 0x57, 0x8c,
154 0x4f, 0x3f, 0xfd, 0xcb, 0x22, 0x01, 0xa0, 0x2a, 0xbd, 0x41, 0xd1, 0xf5,
155 0xb2, 0xf5, 0xe7, 0x7b, 0xe3, 0xd1, 0xe1, 0x48, 0xcf, 0xc6, 0xdb, 0x71,
156 0x52, 0xde, 0xd9, 0x1e, 0xb4, 0x29, 0xd4, 0xc8, 0xf2, 0xf9, 0x6e, 0xbb,
157 0xff, 0x69, 0x36, 0x72, 0xa8, 0x8b, 0x54, 0x0d, 0xf7, 0x5c, 0x3d, 0x62,
158 0x10, 0xdc, 0x8d, 0x4a, 0xc3, 0x11, 0x91, 0x9f, 0x24, 0xe1, 0x5e, 0xcf,
159 0x21, 0x82, 0xa9, 0xf9, 0xff, 0xa6, 0xe2, 0x79, 0xc2, 0x0b, 0x93, 0xa2,
160 0x31, 0x62, 0xef, 0x01, 0x4e, 0x77, 0xd2, 0xa6, 0x49, 0xb4, 0x6e, 0x8e,
161 0xbd, 0x63, 0x57, 0x01, 0x51, 0xd6, 0xb3, 0xf0, 0x11, 0xd5, 0xf1, 0xf8,
162 0xcc, 0xd8, 0x4e, 0x9d, 0x04, 0xf7, 0xa3, 0xa1, 0x14, 0x61, 0x6a, 0x21,
163 0x16, 0xe3, 0xa3, 0x6d, 0x92, 0xaf, 0xc6, 0xfd, 0x12, 0x63, 0x54, 0xbf,
164 0x24, 0xc8, 0x11, 0xcc, 0xdb, 0xaf, 0x14, 0xdd, 0x84, 0xd9, 0xdd, 0x5d,
165 0xc4, 0xe6, 0x92, 0xbe, 0x76, 0x3b, 0x91, 0x52, 0xcb, 0x4c, 0x31, 0x8c,
166 0xeb, 0x12, 0xce, 0xde, 0xe0, 0xb4, 0x12, 0x7f, 0xa1, 0x60, 0xd4, 0x9e,
167 0xc5, 0x0b, 0x49, 0xd6, 0xbf, 0x9a, 0x13, 0x99, 0x0e, 0x65, 0x83, 0xff,
168 0xf5, 0xab, 0xe2, 0x76, 0xa3, 0x58, 0x7a, 0xea, 0x0d, 0x0f, 0x76, 0x4c,
169 0xff, 0xf3, 0xc7, 0x6e, 0x48, 0x0a, 0xba, 0x37, 0x87, 0x32, 0x94, 0x44,
170 0xfa, 0x06, 0x70, 0xfd, 0x9a, 0x17, 0x7e, 0x73, 0x92, 0x6e, 0xe6, 0xc9,
171 0x75, 0xbb, 0xd3, 0x16, 0x92, 0xb0, 0xed, 0xfc, 0x80, 0x3d, 0xba, 0x56,
172 0x82, 0xdf, 0xe7, 0xf5, 0xe1, 0xc8, 0xd7, 0x68, 0xf9, 0xc5, 0x8b, 0xf5,
173 0x15, 0x3d, 0xda, 0x77, 0xc1, 0xc8, 0xb8, 0xfb, 0x02, 0x03, 0x01, 0x00,
174 0x01, 0xa3, 0x32, 0x30, 0x30, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13,
175 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d,
176 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x6e, 0x04, 0x5d,
177 0xde, 0x1e, 0x58, 0xca, 0x9d, 0xa4, 0x25, 0x50, 0xeb, 0xf9, 0xff, 0x3c,
178 0x31, 0xb7, 0x29, 0x63, 0xa8, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
179 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01,
180 0x00, 0x01, 0x6d, 0xbb, 0xa9, 0xf5, 0x59, 0x07, 0xe2, 0xf5, 0x8c, 0x82,
181 0x84, 0x3f, 0x13, 0xe0, 0x2f, 0x03, 0x9b, 0xce, 0x8d, 0x48, 0x80, 0x60,
182 0xda, 0xfc, 0x8e, 0x08, 0xda, 0xff, 0x83, 0x49, 0xd4, 0x10, 0x80, 0xe2,
183 0x57, 0x95, 0x27, 0x92, 0xb5, 0x61, 0x23, 0x4c, 0x23, 0x3a, 0x9a, 0x61,
184 0xd5, 0xdb, 0x60, 0x00, 0x7d, 0x18, 0x96, 0xc2, 0x97, 0xa7, 0x6f, 0x41,
185 0x38, 0xf3, 0xb7, 0x04, 0xeb, 0x86, 0xce, 0xe3, 0x27, 0x2b, 0xf2, 0x6d,
186 0x25, 0xf9, 0xc2, 0x04, 0x8a, 0x58, 0x6e, 0x32, 0x8c, 0x04, 0xe5, 0x2a,
187 0x60, 0x03, 0x5c, 0x78, 0xf8, 0x34, 0xfe, 0x24, 0x67, 0x77, 0xd7, 0x7a,
188 0x96, 0xec, 0x0d, 0x37, 0x74, 0x22, 0xc4, 0xa6, 0x42, 0x83, 0x3a, 0x5b,
189 0xed, 0x11, 0x46, 0xfd, 0x1d, 0xd5, 0x8c, 0x39, 0x3b, 0x24, 0x70, 0x2a,
190 0x4a, 0xdf, 0x54, 0xbd, 0xa5, 0x29, 0x86, 0xa5, 0xe6, 0xcb, 0xde, 0x99,
191 0x8c, 0x7d, 0x80, 0xcc, 0xb1, 0x2f, 0x5e, 0xad, 0x51, 0xfa, 0x74, 0x15,
192 0x17, 0xc3, 0x00, 0xfc, 0xa8, 0x7f, 0x67, 0x44, 0x5f, 0x0e, 0x29, 0x8e,
193 0x74, 0x12, 0xab, 0x2c, 0xc5, 0xee, 0xd2, 0xa3, 0xb6, 0xa8, 0x78, 0xb0,
194 0x04, 0x8e, 0x77, 0x33, 0x91, 0x1d, 0x8e, 0x50, 0x97, 0x61, 0x5c, 0x1f,
195 0x0e, 0xe0, 0x2a, 0xfa, 0x56, 0x1d, 0x5b, 0x36, 0x63, 0xeb, 0x13, 0x70,
196 0xb2, 0x40, 0x1e, 0x78, 0x41, 0x71, 0x7d, 0x81, 0x63, 0xe9, 0xec, 0xe4,
197 0xe6, 0x7b, 0x63, 0x4f, 0x29, 0x75, 0x7a, 0xf7, 0x96, 0x47, 0x7d, 0x5b,
198 0x11, 0xd2, 0x52, 0x17, 0x69, 0x19, 0x53, 0x3f, 0x8f, 0xc2, 0xaa, 0xaf,
199 0x42, 0x35, 0x3b, 0xb2, 0x94, 0x6f, 0xcf, 0xf8, 0xb1, 0xca, 0xe7, 0x47,
200 0xcc, 0xed, 0x6c, 0x97, 0xfd, 0xdd, 0x41, 0x3a, 0x22, 0x69, 0xfc, 0x3c,
201 0xdf, 0x13, 0x32, 0x3c, 0xa4
202 };
203 unsigned int certc_len = 689;
204
205
206 unsigned char _AppleiPhoneDeviceCert_DER[] = {
207 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0xa8, 0xa0, 0x03, 0x02, 0x01,
208 0x02, 0x02, 0x0a, 0x01, 0x4c, 0x21, 0x41, 0x26, 0x71, 0x63, 0x81, 0xd8,
209 0xd9, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
210 0x01, 0x0b, 0x05, 0x00, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03,
211 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06,
212 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
213 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
214 0x0b, 0x13, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68,
215 0x6f, 0x6e, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x03,
216 0x13, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f,
217 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x43, 0x41,
218 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x38, 0x30, 0x37, 0x32, 0x32, 0x31, 0x38,
219 0x33, 0x32, 0x34, 0x35, 0x5a, 0x17, 0x0d, 0x31, 0x31, 0x30, 0x37, 0x32,
220 0x32, 0x31, 0x38, 0x33, 0x32, 0x34, 0x35, 0x5a, 0x30, 0x81, 0x87, 0x31,
221 0x31, 0x30, 0x2f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x28, 0x32, 0x31,
222 0x33, 0x63, 0x65, 0x65, 0x35, 0x63, 0x64, 0x31, 0x31, 0x37, 0x37, 0x38,
223 0x62, 0x65, 0x65, 0x32, 0x63, 0x64, 0x31, 0x63, 0x65, 0x61, 0x36, 0x32,
224 0x34, 0x62, 0x63, 0x63, 0x30, 0x61, 0x62, 0x38, 0x31, 0x33, 0x64, 0x32,
225 0x33, 0x35, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
226 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08,
227 0x13, 0x02, 0x43, 0x41, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04,
228 0x07, 0x13, 0x09, 0x43, 0x75, 0x70, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x6f,
229 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41,
230 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x0f, 0x30,
231 0x0d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x06, 0x69, 0x50, 0x68, 0x6f,
232 0x6e, 0x65, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
233 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00,
234 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0x82, 0x8e, 0xda, 0x67, 0x93,
235 0x6d, 0x54, 0x03, 0x98, 0xcc, 0xdb, 0xec, 0x06, 0xed, 0xd7, 0x4e, 0xc7,
236 0x74, 0xc8, 0xb5, 0x91, 0x64, 0xf9, 0x52, 0x23, 0x50, 0xae, 0x4d, 0x15,
237 0x22, 0x8b, 0x05, 0x03, 0x79, 0x76, 0x45, 0xfc, 0x33, 0xcb, 0x2a, 0xf1,
238 0x5c, 0x96, 0x49, 0x96, 0x06, 0x11, 0x06, 0x6e, 0x76, 0xbe, 0x99, 0xdc,
239 0xae, 0xf9, 0x67, 0x3d, 0x03, 0x0c, 0x07, 0x5f, 0x38, 0xe5, 0x98, 0x64,
240 0x65, 0x68, 0xd2, 0x65, 0x59, 0x9a, 0xd6, 0x70, 0x59, 0x80, 0xf2, 0x54,
241 0x91, 0xb9, 0xd9, 0x45, 0x80, 0x6a, 0x29, 0x4f, 0xa7, 0xfb, 0x72, 0x75,
242 0x70, 0x2a, 0xb2, 0xe9, 0x35, 0x7d, 0x63, 0x8f, 0xf7, 0x83, 0xba, 0x4a,
243 0x8e, 0xb8, 0x29, 0x37, 0xde, 0x70, 0x3e, 0xc2, 0x0f, 0xc7, 0x55, 0x36,
244 0xce, 0xc1, 0xd4, 0x2d, 0x11, 0xb7, 0x02, 0x46, 0x7a, 0x30, 0x69, 0xba,
245 0x81, 0x60, 0x5d, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xdd, 0x30,
246 0x81, 0xda, 0x30, 0x81, 0x82, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x7b,
247 0x30, 0x79, 0x80, 0x14, 0xb2, 0xfe, 0x21, 0x23, 0x44, 0x86, 0x95, 0x6a,
248 0x79, 0xd5, 0x81, 0x26, 0x8e, 0x73, 0x10, 0xd8, 0xa7, 0x4c, 0x8e, 0x74,
249 0xa1, 0x5e, 0xa4, 0x5c, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03,
250 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06,
251 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
252 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
253 0x0b, 0x13, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68,
254 0x6f, 0x6e, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x03,
255 0x13, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f,
256 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x43, 0x41,
257 0x82, 0x01, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16,
258 0x04, 0x14, 0x54, 0x8c, 0xa9, 0x72, 0xce, 0x75, 0x20, 0xf9, 0x99, 0xa0,
259 0xa7, 0x9e, 0xb9, 0x1f, 0x7d, 0x70, 0x67, 0x74, 0xf5, 0x01, 0x30, 0x0c,
260 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00,
261 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04,
262 0x03, 0x02, 0x05, 0xa0, 0x30, 0x16, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01,
263 0x01, 0xff, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05,
264 0x05, 0x07, 0x03, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
265 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x32,
266 0xc8, 0xf6, 0xa0, 0x75, 0x47, 0x75, 0xaf, 0x5c, 0xac, 0x0d, 0x12, 0xc4,
267 0x73, 0x63, 0x0e, 0x59, 0xee, 0x99, 0x1a, 0xea, 0xe8, 0x8c, 0x12, 0xd9,
268 0x64, 0xf5, 0xe3, 0x45, 0x1e, 0x62, 0x45, 0xb5, 0xc4, 0xfc, 0xf4, 0x37,
269 0x92, 0xfe, 0xb9, 0x8e, 0x06, 0x87, 0xcb, 0xf6, 0x16, 0xb7, 0xca, 0x1a,
270 0x31, 0x24, 0x7e, 0xdf, 0x46, 0xd9, 0xe1, 0x26, 0x82, 0xff, 0xcd, 0xd1,
271 0x10, 0xba, 0xfd, 0x1e, 0x47, 0xc4, 0x3c, 0x76, 0x0d, 0x39, 0x0b, 0x57,
272 0xd9, 0xf1, 0xd5, 0x1d, 0x18, 0xd3, 0x35, 0xae, 0x1d, 0xdf, 0xec, 0xf1,
273 0x2a, 0x9d, 0x61, 0x91, 0x60, 0x43, 0x15, 0x2f, 0x4b, 0x19, 0x24, 0xc9,
274 0xbd, 0xf6, 0xa4, 0x66, 0x48, 0x48, 0x55, 0x67, 0xbf, 0xaa, 0x71, 0xa2,
275 0x92, 0x3d, 0x3c, 0xc7, 0xdc, 0x73, 0x6e, 0x38, 0xe6, 0xae, 0x6b, 0x8e,
276 0xbc, 0xbb, 0xa2, 0x75, 0xf9, 0x7a, 0x77
277 };
278
279 /*
280 subject= /C=US/O=Apple Inc./OU=Apple iPhone/CN=Apple iPhone Activation
281 issuer= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple iPhone Certification Authority
282 serial=02
283 */
284 const uint8_t _AppleiPhoneActivation_DER[] = {
285 0x30, 0x82, 0x03, 0x67, 0x30, 0x82, 0x02, 0x4f,
286 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02,
287 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
288 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30,
289 0x79, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
290 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
291 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
292 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
293 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
294 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70,
295 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
296 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
297 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
298 0x69, 0x74, 0x79, 0x31, 0x2d, 0x30, 0x2b, 0x06,
299 0x03, 0x55, 0x04, 0x03, 0x13, 0x24, 0x41, 0x70,
300 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f,
301 0x6e, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69,
302 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
303 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
304 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x37,
305 0x30, 0x34, 0x31, 0x36, 0x32, 0x32, 0x35, 0x35,
306 0x30, 0x32, 0x5a, 0x17, 0x0d, 0x31, 0x34, 0x30,
307 0x34, 0x31, 0x36, 0x32, 0x32, 0x35, 0x35, 0x30,
308 0x32, 0x5a, 0x30, 0x5b, 0x31, 0x0b, 0x30, 0x09,
309 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
310 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
311 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c,
312 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15,
313 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
314 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69,
315 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x31, 0x20, 0x30,
316 0x1e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x17,
317 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50,
318 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x41, 0x63, 0x74,
319 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x30,
320 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
321 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
322 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89,
323 0x02, 0x81, 0x81, 0x00, 0xc5, 0x01, 0x7c, 0xd1,
324 0x22, 0x60, 0x2b, 0x9a, 0x88, 0x87, 0x7d, 0xb4,
325 0xb6, 0xa0, 0xf7, 0x2a, 0x01, 0xf6, 0xc4, 0xbf,
326 0x47, 0x75, 0x8e, 0x4e, 0xc6, 0x6e, 0x75, 0xfb,
327 0xfb, 0x86, 0x14, 0x97, 0x22, 0x1f, 0xa6, 0xbc,
328 0xc1, 0x55, 0xd9, 0x66, 0xcf, 0x62, 0x47, 0x62,
329 0xfd, 0x7e, 0xd3, 0x82, 0x33, 0x26, 0xd2, 0xfb,
330 0x70, 0xbf, 0x7b, 0x50, 0x8e, 0xdf, 0x93, 0x48,
331 0xb4, 0x38, 0xc6, 0x34, 0x6a, 0x5f, 0x1a, 0xf8,
332 0x93, 0xd0, 0x6b, 0x85, 0x20, 0xeb, 0x5d, 0x53,
333 0x6e, 0xa1, 0x2d, 0xfa, 0x78, 0xc0, 0x98, 0x09,
334 0x20, 0x7b, 0x71, 0xd7, 0x58, 0x30, 0x5d, 0x01,
335 0x70, 0xfd, 0x32, 0x19, 0x02, 0xed, 0x3f, 0xfd,
336 0xa3, 0xbe, 0xf3, 0x39, 0x0d, 0x68, 0x96, 0x2e,
337 0x1c, 0x51, 0xdc, 0xe5, 0x9d, 0x85, 0x9f, 0xce,
338 0x65, 0xb4, 0x3d, 0xdb, 0x8e, 0xc6, 0xeb, 0xde,
339 0x01, 0xe6, 0x18, 0xe3, 0x02, 0x03, 0x01, 0x00,
340 0x01, 0xa3, 0x81, 0x9b, 0x30, 0x81, 0x98, 0x30,
341 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01,
342 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30,
343 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01,
344 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06,
345 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
346 0xa1, 0xa0, 0xd2, 0xfe, 0xb7, 0xb4, 0x73, 0xfe,
347 0x9b, 0x14, 0x6a, 0xaf, 0xcd, 0x3d, 0x73, 0x4f,
348 0x1f, 0xef, 0xd6, 0x94, 0x30, 0x1f, 0x06, 0x03,
349 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80,
350 0x14, 0xe7, 0x34, 0x2a, 0x2e, 0x22, 0xde, 0x39,
351 0x60, 0x6b, 0xb4, 0x94, 0xce, 0x77, 0x83, 0x61,
352 0x2f, 0x31, 0xa0, 0x7c, 0x35, 0x30, 0x38, 0x06,
353 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x31, 0x30, 0x2f,
354 0x30, 0x2d, 0xa0, 0x2b, 0xa0, 0x29, 0x86, 0x27,
355 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
356 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65,
357 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x70,
358 0x6c, 0x65, 0x63, 0x61, 0x2f, 0x69, 0x70, 0x68,
359 0x6f, 0x6e, 0x65, 0x2e, 0x63, 0x72, 0x6c, 0x30,
360 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
361 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82,
362 0x01, 0x01, 0x00, 0x5f, 0x6a, 0x9a, 0xb5, 0x0d,
363 0x74, 0x0f, 0x85, 0x44, 0xe6, 0x06, 0x3f, 0xba,
364 0x56, 0x71, 0x84, 0xc0, 0x2b, 0xea, 0x4b, 0xc8,
365 0xe7, 0xfd, 0xcc, 0xe6, 0x84, 0xed, 0xa7, 0x95,
366 0x23, 0xcf, 0x39, 0x57, 0xc6, 0x3f, 0x04, 0xa1,
367 0xe1, 0x97, 0x00, 0x28, 0xfb, 0x31, 0x24, 0x88,
368 0xe5, 0x37, 0x15, 0xb1, 0x0f, 0x09, 0x2f, 0x55,
369 0xb5, 0x2d, 0x7c, 0x64, 0x17, 0x30, 0x0f, 0xff,
370 0x9d, 0xe5, 0x94, 0x13, 0x30, 0x59, 0x27, 0x85,
371 0xc5, 0x09, 0xc1, 0xd3, 0xea, 0xaa, 0x39, 0xe6,
372 0xf4, 0xba, 0x93, 0x7c, 0x7f, 0xf1, 0xe2, 0x9c,
373 0x3c, 0x38, 0xd1, 0xd1, 0x0f, 0x3c, 0x47, 0x76,
374 0x9f, 0x7a, 0x80, 0xe5, 0x77, 0x03, 0x8f, 0xbc,
375 0x69, 0xb9, 0x28, 0x01, 0x27, 0xdc, 0x62, 0xab,
376 0xc8, 0x47, 0x2a, 0x57, 0x9d, 0xbb, 0xab, 0xdd,
377 0xb4, 0x51, 0x85, 0x3c, 0xc0, 0xb3, 0x85, 0x48,
378 0x2d, 0x2e, 0xa3, 0x4f, 0x21, 0x58, 0xca, 0x66,
379 0x5e, 0x49, 0xec, 0x2d, 0x06, 0xe6, 0xe6, 0x9a,
380 0x28, 0x28, 0xd6, 0x40, 0x90, 0x89, 0x91, 0x9c,
381 0xef, 0xa7, 0x39, 0x7d, 0xe0, 0xc0, 0xc8, 0x76,
382 0xf6, 0x6f, 0x31, 0x2a, 0xb6, 0xfc, 0x77, 0x5a,
383 0x9a, 0xe5, 0x8e, 0xd4, 0xb8, 0xe9, 0x04, 0xf9,
384 0x09, 0x1e, 0x98, 0x7a, 0x58, 0xa7, 0x66, 0x78,
385 0xa8, 0xdf, 0x68, 0xc0, 0xcd, 0x16, 0x13, 0xc6,
386 0xd4, 0xba, 0xaf, 0x72, 0x6c, 0xbd, 0x90, 0xe2,
387 0x27, 0x4e, 0xfe, 0x10, 0x77, 0x26, 0x7c, 0x67,
388 0x69, 0xc7, 0x08, 0x0e, 0xfb, 0xb6, 0xed, 0x5b,
389 0x5a, 0x45, 0x6a, 0xbd, 0x19, 0x8c, 0x5f, 0x7f,
390 0x8d, 0x82, 0x8a, 0x9c, 0xe6, 0x0d, 0xca, 0xf0,
391 0xab, 0xc2, 0xcc, 0xe1, 0x69, 0xf6, 0xd2, 0x63,
392 0x0c, 0xc0, 0x1b, 0x91, 0x09, 0xa1, 0x71, 0x41,
393 0xe1, 0xdf, 0xa9, 0x89, 0x61, 0xd4, 0x0d, 0xc3,
394 0xf1, 0xb5, 0xc7
395 };
396
397 unsigned char _AppleiPhoneDeviceCA_DER[] = {
398 0x30, 0x82, 0x03, 0x69, 0x30, 0x82, 0x02, 0x51, 0xa0, 0x03, 0x02, 0x01,
399 0x02, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
400 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x79, 0x31, 0x0b, 0x30,
401 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
402 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
403 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
404 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
405 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
406 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31,
407 0x2d, 0x30, 0x2b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x24, 0x41, 0x70,
408 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x43,
409 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
410 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e,
411 0x17, 0x0d, 0x30, 0x37, 0x30, 0x34, 0x31, 0x36, 0x32, 0x32, 0x35, 0x34,
412 0x34, 0x36, 0x5a, 0x17, 0x0d, 0x31, 0x34, 0x30, 0x34, 0x31, 0x36, 0x32,
413 0x32, 0x35, 0x34, 0x34, 0x36, 0x5a, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09,
414 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30,
415 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c,
416 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
417 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69,
418 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55,
419 0x04, 0x03, 0x13, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50,
420 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20,
421 0x43, 0x41, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
422 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00,
423 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xf1, 0x94, 0x4a, 0xc9, 0xea,
424 0xba, 0x5a, 0x18, 0x60, 0xad, 0xcb, 0xa2, 0x4d, 0x4d, 0x4e, 0x54, 0x19,
425 0x69, 0x17, 0x59, 0x07, 0x66, 0xcb, 0x97, 0xe8, 0x66, 0x9a, 0x47, 0x5f,
426 0x46, 0xae, 0x67, 0x7a, 0xb5, 0x4a, 0x73, 0x54, 0xb1, 0xcb, 0x04, 0xf6,
427 0xbd, 0x36, 0xb8, 0x0c, 0x55, 0x38, 0x8a, 0x84, 0x83, 0x31, 0x52, 0x65,
428 0xf9, 0x33, 0xe1, 0x97, 0x77, 0x9c, 0x2b, 0x4c, 0x26, 0xb0, 0x25, 0x3f,
429 0xe9, 0x32, 0xaa, 0x7b, 0x08, 0x74, 0x94, 0xec, 0xc1, 0x4b, 0x38, 0x1d,
430 0x67, 0x4e, 0x08, 0x52, 0x94, 0x5a, 0x8b, 0x59, 0xa3, 0x5c, 0xd7, 0x93,
431 0xf4, 0xa0, 0xfe, 0x55, 0x85, 0xbb, 0x4c, 0x46, 0x97, 0x5e, 0x6e, 0xb2,
432 0x77, 0x45, 0x2f, 0x67, 0x5c, 0xbc, 0x0b, 0x18, 0xbf, 0x59, 0xb9, 0x6c,
433 0x86, 0xf7, 0x2a, 0x75, 0x76, 0xd2, 0x19, 0x71, 0xf4, 0x29, 0x63, 0xb9,
434 0x25, 0x0b, 0xaf, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0x9e, 0x30,
435 0x81, 0x9b, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff,
436 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d,
437 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
438 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb2, 0xfe,
439 0x21, 0x23, 0x44, 0x86, 0x95, 0x6a, 0x79, 0xd5, 0x81, 0x26, 0x8e, 0x73,
440 0x10, 0xd8, 0xa7, 0x4c, 0x8e, 0x74, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
441 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe7, 0x34, 0x2a, 0x2e, 0x22,
442 0xde, 0x39, 0x60, 0x6b, 0xb4, 0x94, 0xce, 0x77, 0x83, 0x61, 0x2f, 0x31,
443 0xa0, 0x7c, 0x35, 0x30, 0x38, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x31,
444 0x30, 0x2f, 0x30, 0x2d, 0xa0, 0x2b, 0xa0, 0x29, 0x86, 0x27, 0x68, 0x74,
445 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70,
446 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x65,
447 0x63, 0x61, 0x2f, 0x69, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x63, 0x72,
448 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
449 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x77, 0x5d, 0xcf,
450 0x67, 0x7a, 0x4c, 0x56, 0x2b, 0xa4, 0x54, 0x77, 0xbd, 0x59, 0x48, 0x3c,
451 0x1e, 0xe9, 0xbe, 0xd0, 0x8f, 0xf4, 0x90, 0x72, 0xaf, 0x8e, 0x1c, 0x15,
452 0x77, 0xf2, 0x0c, 0xc0, 0x69, 0x57, 0xc9, 0x4e, 0xc3, 0x85, 0x46, 0x16,
453 0x76, 0x36, 0xb6, 0x5f, 0xfc, 0xea, 0x8f, 0xb5, 0xb6, 0xe0, 0x0a, 0xb9,
454 0xed, 0xd1, 0x0a, 0x9b, 0x77, 0xea, 0xab, 0x12, 0xb9, 0x5c, 0x21, 0x55,
455 0x19, 0x8e, 0x47, 0x23, 0x47, 0x11, 0xb1, 0xd1, 0x0d, 0xc9, 0x33, 0xfb,
456 0x97, 0x14, 0xa2, 0x89, 0x34, 0x58, 0x8f, 0x69, 0xa5, 0x3d, 0xe7, 0x61,
457 0x78, 0x29, 0xfe, 0x93, 0xa4, 0xf9, 0xcb, 0x45, 0x38, 0x5e, 0xbe, 0x34,
458 0x15, 0x7c, 0x16, 0x6f, 0x69, 0xd6, 0xa8, 0x21, 0x75, 0x02, 0x02, 0x2e,
459 0x76, 0x18, 0x2f, 0x55, 0xbc, 0x65, 0xbe, 0xa7, 0x31, 0x52, 0x6f, 0x19,
460 0xcf, 0xbc, 0x83, 0x78, 0x9d, 0x09, 0x16, 0x8b, 0xd7, 0x42, 0x1c, 0x8e,
461 0xe5, 0xf2, 0xd4, 0x1d, 0x12, 0xc2, 0x40, 0x5b, 0x2c, 0x01, 0xb7, 0xfc,
462 0x07, 0x88, 0xbc, 0xad, 0x86, 0x2c, 0x05, 0x48, 0x58, 0x4e, 0xca, 0x55,
463 0x25, 0xcc, 0x55, 0xa4, 0x82, 0x25, 0xb6, 0x46, 0x29, 0x74, 0x84, 0x52,
464 0x20, 0x04, 0x40, 0xe3, 0xd1, 0xcd, 0xbc, 0xa2, 0xb8, 0x87, 0x38, 0xf3,
465 0x31, 0x2f, 0xce, 0x84, 0xa4, 0x29, 0x54, 0xac, 0x3e, 0x38, 0x21, 0x19,
466 0xc6, 0x9b, 0x42, 0x55, 0xe3, 0x76, 0xa6, 0x36, 0xdd, 0xb7, 0xdb, 0xb3,
467 0x8b, 0x5e, 0xf9, 0xa1, 0x5a, 0x3f, 0xbb, 0xa0, 0x76, 0x02, 0xb2, 0x80,
468 0x5b, 0x5e, 0xee, 0xe9, 0x71, 0x07, 0x21, 0xd0, 0xcc, 0x39, 0xee, 0xdc,
469 0x6f, 0x7d, 0xe9, 0x79, 0x52, 0x3a, 0x4c, 0x3d, 0x79, 0x5b, 0x83, 0x08,
470 0xa7, 0x24, 0x0f, 0x6e, 0x9f, 0x28, 0xae, 0x55, 0xde, 0xfa, 0xd0, 0x3c,
471 0x24
472 };
473
474 /*
475 subject= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple iPhone Certification Authority
476 issuer= /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Root CA
477 serial=17
478 */
479 const uint8_t _AppleiPhoneCertificationAuthority_DER[] = {
480 0x30, 0x82, 0x03, 0xf3, 0x30, 0x82, 0x02, 0xdb,
481 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x17,
482 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
483 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30,
484 0x62, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
485 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
486 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
487 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
488 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06,
489 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70,
490 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
491 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
492 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
493 0x69, 0x74, 0x79, 0x31, 0x16, 0x30, 0x14, 0x06,
494 0x03, 0x55, 0x04, 0x03, 0x13, 0x0d, 0x41, 0x70,
495 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74,
496 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30,
497 0x37, 0x30, 0x34, 0x31, 0x32, 0x31, 0x37, 0x34,
498 0x33, 0x32, 0x38, 0x5a, 0x17, 0x0d, 0x32, 0x32,
499 0x30, 0x34, 0x31, 0x32, 0x31, 0x37, 0x34, 0x33,
500 0x32, 0x38, 0x5a, 0x30, 0x79, 0x31, 0x0b, 0x30,
501 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
502 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
503 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
504 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31,
505 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x0b,
506 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
507 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
508 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
509 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31,
510 0x2d, 0x30, 0x2b, 0x06, 0x03, 0x55, 0x04, 0x03,
511 0x13, 0x24, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
512 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x43,
513 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
514 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74,
515 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x82,
516 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
517 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
518 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82,
519 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa3,
520 0x1e, 0xbe, 0xf0, 0x47, 0xc0, 0xb4, 0x9e, 0x10,
521 0x5b, 0x46, 0xa4, 0xb8, 0x21, 0xb8, 0x4f, 0x86,
522 0x21, 0x70, 0x28, 0x45, 0x60, 0x5c, 0x1c, 0xc3,
523 0xc8, 0x0a, 0x64, 0x63, 0x88, 0xfb, 0xfc, 0x69,
524 0xee, 0xf8, 0x54, 0xfc, 0xe9, 0x5b, 0xb7, 0x06,
525 0x4e, 0x04, 0x2f, 0xc3, 0x6b, 0x33, 0xaf, 0x44,
526 0x4c, 0xea, 0x4b, 0x80, 0x09, 0xb4, 0x87, 0xf6,
527 0x5b, 0xb4, 0xfd, 0x64, 0xdd, 0xb3, 0x72, 0xe0,
528 0x13, 0xb3, 0xfd, 0x17, 0xd9, 0xbc, 0xe7, 0xa8,
529 0xed, 0xc2, 0x8c, 0x61, 0xc2, 0x2a, 0xf9, 0xec,
530 0xce, 0xa5, 0x5e, 0xd6, 0x69, 0xeb, 0x64, 0x0b,
531 0x8d, 0x08, 0x8f, 0xb8, 0xa0, 0x50, 0x46, 0x09,
532 0xdc, 0x19, 0xe4, 0xe5, 0xb0, 0x94, 0x6d, 0xbb,
533 0xf7, 0x99, 0x98, 0xc4, 0xe8, 0x9b, 0x41, 0x4e,
534 0xd4, 0xf1, 0x65, 0xe3, 0x1b, 0x52, 0x7a, 0xdc,
535 0xe8, 0x03, 0xd9, 0x6e, 0x1d, 0xda, 0x10, 0x55,
536 0x86, 0xa4, 0x29, 0x58, 0x49, 0x0c, 0xea, 0x47,
537 0xd7, 0x15, 0x34, 0x33, 0xf6, 0xc0, 0xa0, 0x44,
538 0x4a, 0x70, 0xbe, 0x2c, 0xb5, 0x2a, 0x30, 0x37,
539 0x8c, 0x2e, 0x15, 0xeb, 0xd1, 0xe4, 0x6c, 0x97,
540 0x38, 0x55, 0x56, 0xb1, 0x35, 0x2b, 0x58, 0xea,
541 0x44, 0xa3, 0x26, 0x85, 0xee, 0xc8, 0x66, 0x4a,
542 0xe4, 0xcf, 0x89, 0xf0, 0x3d, 0x63, 0xad, 0x29,
543 0xde, 0xad, 0xba, 0x5a, 0xb3, 0xdc, 0xa5, 0xa3,
544 0x9a, 0xa7, 0x09, 0x4e, 0x80, 0x16, 0x35, 0x65,
545 0xa4, 0x85, 0x0d, 0x63, 0x7b, 0x3e, 0x63, 0x8a,
546 0xda, 0x7d, 0x4a, 0x46, 0xec, 0xa3, 0x39, 0x18,
547 0x34, 0xb9, 0xc6, 0x28, 0x65, 0x18, 0xbc, 0x13,
548 0x60, 0x9c, 0x7f, 0x57, 0xac, 0x14, 0xc9, 0x89,
549 0xed, 0xa1, 0xb6, 0x87, 0x68, 0x52, 0xb6, 0x84,
550 0x4e, 0xb8, 0xc8, 0x83, 0xec, 0xf9, 0x9e, 0x19,
551 0xab, 0xb3, 0xc1, 0x0b, 0x86, 0xc7, 0x9f, 0x02,
552 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0x9c, 0x30,
553 0x81, 0x99, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d,
554 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02,
555 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d,
556 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03,
557 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55,
558 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe7, 0x34,
559 0x2a, 0x2e, 0x22, 0xde, 0x39, 0x60, 0x6b, 0xb4,
560 0x94, 0xce, 0x77, 0x83, 0x61, 0x2f, 0x31, 0xa0,
561 0x7c, 0x35, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
562 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x2b,
563 0xd0, 0x69, 0x47, 0x94, 0x76, 0x09, 0xfe, 0xf4,
564 0x6b, 0x8d, 0x2e, 0x40, 0xa6, 0xf7, 0x47, 0x4d,
565 0x7f, 0x08, 0x5e, 0x30, 0x36, 0x06, 0x03, 0x55,
566 0x1d, 0x1f, 0x04, 0x2f, 0x30, 0x2d, 0x30, 0x2b,
567 0xa0, 0x29, 0xa0, 0x27, 0x86, 0x25, 0x68, 0x74,
568 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
569 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x63,
570 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x65,
571 0x63, 0x61, 0x2f, 0x72, 0x6f, 0x6f, 0x74, 0x2e,
572 0x63, 0x72, 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a,
573 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
574 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x1d,
575 0xd1, 0xd5, 0x7b, 0xdd, 0x74, 0x4e, 0xd7, 0x17,
576 0xfc, 0x82, 0x2d, 0x0c, 0x99, 0x9b, 0x5e, 0x42,
577 0x72, 0xf2, 0x69, 0xdc, 0xd5, 0x6b, 0x5e, 0x0d,
578 0x0c, 0x6b, 0x4b, 0x3e, 0x7b, 0x14, 0x25, 0xde,
579 0xb3, 0x94, 0xe8, 0xa0, 0xfa, 0x0f, 0x80, 0x89,
580 0xf2, 0x17, 0x3d, 0x00, 0x02, 0xa2, 0x91, 0x91,
581 0xbe, 0x74, 0x57, 0xdc, 0xaf, 0x9a, 0x9f, 0xa1,
582 0x0a, 0x7d, 0x30, 0xbe, 0x00, 0x2a, 0xcc, 0x21,
583 0x59, 0xeb, 0xfd, 0x49, 0xac, 0x6e, 0x75, 0x19,
584 0xe8, 0x9a, 0x7a, 0x03, 0xd1, 0x86, 0xf6, 0xe7,
585 0xf6, 0xb0, 0x0e, 0x4b, 0x49, 0xfa, 0xa3, 0xb7,
586 0x41, 0xba, 0xd7, 0xd1, 0xe3, 0x56, 0xa1, 0x7d,
587 0x83, 0xab, 0x97, 0xae, 0xf8, 0x51, 0x4a, 0x26,
588 0xc1, 0x85, 0x42, 0x13, 0x26, 0x8d, 0x03, 0x54,
589 0x66, 0x10, 0x5e, 0x60, 0x84, 0x05, 0x12, 0x31,
590 0x2b, 0x6b, 0x54, 0xc0, 0xa0, 0xc8, 0x41, 0xbc,
591 0x54, 0x1e, 0xe7, 0x54, 0xad, 0x13, 0x00, 0xd2,
592 0x4a, 0xc7, 0xbb, 0xc1, 0x8a, 0xaf, 0x81, 0x08,
593 0x8e, 0xf0, 0x46, 0x0a, 0xbf, 0x27, 0xa6, 0xbe,
594 0xdc, 0xcf, 0x39, 0x3a, 0x80, 0x70, 0x19, 0x23,
595 0x32, 0xa3, 0x6b, 0x66, 0x5d, 0x9e, 0x4d, 0xa8,
596 0x47, 0x49, 0xb2, 0x7b, 0x45, 0xb5, 0x51, 0x33,
597 0xa7, 0x74, 0x67, 0x09, 0x4e, 0xb6, 0x6c, 0x6f,
598 0x48, 0xf7, 0x2c, 0xb9, 0x33, 0x05, 0x44, 0x6b,
599 0x45, 0xbe, 0x74, 0x4b, 0x6f, 0xb2, 0x86, 0x91,
600 0xb4, 0x3e, 0x25, 0x28, 0x25, 0x9e, 0xb3, 0xc2,
601 0x51, 0x86, 0xfc, 0x4f, 0xe5, 0xaf, 0x3b, 0xaa,
602 0xbb, 0x44, 0x2c, 0x01, 0x49, 0xe2, 0x74, 0xb3,
603 0x34, 0xfa, 0x44, 0xef, 0x14, 0xc2, 0x11, 0xf2,
604 0x2d, 0x19, 0x1a, 0x51, 0x89, 0xd3, 0x08, 0x4a,
605 0x41, 0x6c, 0x58, 0x56, 0xde, 0x9b, 0x3a, 0xe1,
606 0x05, 0x57, 0xe5, 0x62, 0xcf, 0xd2, 0x0f
607 };
608
609 static const unsigned char _AppleFactoryDeviceCA_DER[] = {
610 0x30, 0x82, 0x03, 0x78, 0x30, 0x82, 0x02, 0x60, 0xa0, 0x03, 0x02, 0x01,
611 0x02, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
612 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0x80, 0x31, 0x0b,
613 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
614 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70,
615 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24,
616 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65,
617 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
618 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79,
619 0x31, 0x34, 0x30, 0x32, 0x06, 0x03, 0x55, 0x04, 0x03, 0x14, 0x2b, 0x5b,
620 0x54, 0x45, 0x53, 0x54, 0x5d, 0x20, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
621 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69,
622 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74,
623 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x37,
624 0x30, 0x33, 0x32, 0x31, 0x30, 0x36, 0x32, 0x30, 0x35, 0x30, 0x5a, 0x17,
625 0x0d, 0x32, 0x32, 0x30, 0x33, 0x31, 0x32, 0x30, 0x36, 0x32, 0x30, 0x35,
626 0x30, 0x5a, 0x30, 0x61, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
627 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
628 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e,
629 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
630 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f, 0x6e,
631 0x65, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x14, 0x1d,
632 0x5b, 0x54, 0x45, 0x53, 0x54, 0x5d, 0x20, 0x41, 0x70, 0x70, 0x6c, 0x65,
633 0x20, 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76, 0x69,
634 0x63, 0x65, 0x20, 0x43, 0x41, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09,
635 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
636 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd7, 0x60,
637 0x52, 0x2a, 0xfa, 0x93, 0x52, 0xdc, 0xdb, 0xae, 0x92, 0x6b, 0xd6, 0xac,
638 0x59, 0x17, 0x1f, 0x9a, 0x20, 0xed, 0x34, 0xae, 0xc2, 0x15, 0xe8, 0xe3,
639 0xf0, 0x3b, 0x63, 0x84, 0xd8, 0x6d, 0x8d, 0x02, 0x65, 0x74, 0xe6, 0x62,
640 0x18, 0x27, 0xd1, 0xfc, 0x78, 0xc3, 0x2f, 0x36, 0x83, 0x39, 0x91, 0x9f,
641 0x3d, 0x32, 0xe0, 0x95, 0x7f, 0x90, 0x3b, 0xab, 0x47, 0xbe, 0xf1, 0x47,
642 0x85, 0x8c, 0x5d, 0xab, 0x1c, 0x5c, 0xbb, 0x10, 0x69, 0x47, 0x56, 0xb8,
643 0x15, 0xbf, 0x34, 0x4a, 0xf0, 0x49, 0x6e, 0x8a, 0x35, 0x4a, 0x4f, 0x47,
644 0xbb, 0x3e, 0xea, 0xcc, 0xdf, 0x2e, 0xf4, 0xb8, 0x96, 0x16, 0x94, 0xdd,
645 0x38, 0xf6, 0xf0, 0x82, 0xcf, 0x26, 0xfd, 0x67, 0xa1, 0x73, 0x01, 0x43,
646 0xd8, 0x25, 0xbd, 0x02, 0x2c, 0x82, 0x89, 0x7c, 0x70, 0x01, 0x68, 0xc2,
647 0x8a, 0x85, 0x60, 0x84, 0x77, 0x83, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3,
648 0x81, 0x9e, 0x30, 0x81, 0x9b, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f,
649 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06,
650 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01,
651 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
652 0x14, 0x38, 0x05, 0x20, 0xa9, 0x3f, 0xc6, 0x79, 0xf4, 0xec, 0x9a, 0x6f,
653 0x7f, 0x47, 0x02, 0x5e, 0x6e, 0xa4, 0x79, 0x11, 0xf5, 0x30, 0x1f, 0x06,
654 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0xa2,
655 0x4c, 0xa9, 0x8a, 0x5b, 0x4a, 0x27, 0x5e, 0x85, 0xa6, 0x4d, 0x05, 0x1c,
656 0x27, 0x44, 0xa5, 0x87, 0x76, 0x17, 0x30, 0x38, 0x06, 0x03, 0x55, 0x1d,
657 0x1f, 0x04, 0x31, 0x30, 0x2f, 0x30, 0x2d, 0xa0, 0x2b, 0xa0, 0x29, 0x86,
658 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
659 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70,
660 0x70, 0x6c, 0x65, 0x63, 0x61, 0x2f, 0x69, 0x70, 0x68, 0x6f, 0x6e, 0x65,
661 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
662 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00,
663 0x8d, 0xbe, 0x6b, 0xc8, 0x4e, 0x80, 0x9e, 0x78, 0x86, 0x0c, 0x09, 0xd0,
664 0x6e, 0xed, 0xc1, 0xdc, 0x30, 0xf7, 0x29, 0x4b, 0x20, 0x4e, 0x2c, 0x6c,
665 0xb3, 0x24, 0x72, 0xfd, 0xce, 0x24, 0x34, 0x60, 0x95, 0x30, 0xd7, 0x32,
666 0x61, 0x31, 0xe5, 0xd4, 0xd5, 0x63, 0xaa, 0x3f, 0x89, 0x81, 0xf6, 0x44,
667 0xab, 0x71, 0xd0, 0xbc, 0x17, 0xdb, 0xab, 0xbc, 0xec, 0xbb, 0xa4, 0x40,
668 0x6a, 0xe7, 0xe4, 0x57, 0xc6, 0x28, 0x6f, 0x11, 0x72, 0xfc, 0x0c, 0x51,
669 0x07, 0x31, 0xdb, 0x40, 0x54, 0xee, 0xb5, 0xe6, 0x1e, 0xe3, 0xdc, 0x9b,
670 0xf9, 0x3c, 0x6a, 0xba, 0xd8, 0xc3, 0x20, 0xf1, 0xdd, 0x49, 0xcb, 0x3a,
671 0xa6, 0x29, 0xcd, 0x52, 0xf9, 0xf3, 0xf3, 0x18, 0x5e, 0xdd, 0x82, 0x83,
672 0xb8, 0xe8, 0x4e, 0x94, 0x10, 0x7a, 0x1e, 0x11, 0xa0, 0x63, 0x4d, 0x8e,
673 0x60, 0x4a, 0x1d, 0x45, 0x72, 0x4d, 0xa0, 0xac, 0x1f, 0xb0, 0x98, 0x8b,
674 0xb4, 0x33, 0x5a, 0x85, 0x60, 0xcf, 0x7f, 0x89, 0x35, 0x62, 0x65, 0xd1,
675 0x1b, 0x48, 0xa4, 0xec, 0xca, 0x60, 0x1a, 0x9d, 0xa6, 0xd1, 0xb9, 0x3d,
676 0xf3, 0x64, 0xa4, 0x67, 0xd1, 0xa5, 0x1b, 0xb6, 0xd9, 0xe7, 0x65, 0x75,
677 0xcb, 0xaf, 0x2f, 0x7a, 0xdb, 0xd8, 0xa1, 0xf4, 0xf3, 0x09, 0xbf, 0x9a,
678 0x99, 0x1a, 0x34, 0xa6, 0xed, 0x1f, 0x82, 0x84, 0x0b, 0xb6, 0xa8, 0x68,
679 0x5d, 0xec, 0x49, 0xd4, 0xb3, 0x34, 0x84, 0xaf, 0xcb, 0xa4, 0xd9, 0x00,
680 0xf0, 0xbc, 0x07, 0x6c, 0x17, 0xe7, 0x95, 0xbb, 0xc3, 0x3d, 0xd9, 0xbb,
681 0x6a, 0x13, 0x1d, 0x34, 0xbd, 0x2f, 0xc1, 0x9a, 0xf1, 0x4d, 0x67, 0x5f,
682 0x56, 0x33, 0x90, 0xb2, 0xef, 0xff, 0x27, 0xda, 0x19, 0x60, 0x55, 0xb0,
683 0x78, 0xc2, 0x8c, 0x34, 0x5b, 0x61, 0x3a, 0xe1, 0xec, 0x61, 0x92, 0x8b,
684 0x2f, 0x04, 0x9a, 0xc6
685 };
686
687 unsigned char _AppleFactoryDeviceCert_DER[] = {
688 0x30, 0x82, 0x03, 0x7c, 0x30, 0x82, 0x02, 0xe5, 0xa0, 0x03, 0x02, 0x01,
689 0x02, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
690 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x61, 0x31, 0x0b, 0x30,
691 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
692 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
693 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06,
694 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20,
695 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03,
696 0x55, 0x04, 0x03, 0x14, 0x1d, 0x5b, 0x54, 0x45, 0x53, 0x54, 0x5d, 0x20,
697 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65,
698 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x43, 0x41, 0x30, 0x1e,
699 0x17, 0x0d, 0x30, 0x39, 0x30, 0x31, 0x32, 0x30, 0x30, 0x36, 0x32, 0x36,
700 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x31, 0x31, 0x38, 0x30,
701 0x36, 0x32, 0x36, 0x34, 0x33, 0x5a, 0x30, 0x81, 0x87, 0x31, 0x31, 0x30,
702 0x2f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x28, 0x63, 0x61, 0x62, 0x32,
703 0x38, 0x64, 0x35, 0x36, 0x37, 0x31, 0x38, 0x64, 0x39, 0x35, 0x32, 0x34,
704 0x66, 0x38, 0x31, 0x64, 0x63, 0x63, 0x31, 0x30, 0x35, 0x35, 0x38, 0x65,
705 0x35, 0x34, 0x65, 0x33, 0x32, 0x35, 0x31, 0x36, 0x39, 0x63, 0x66, 0x65,
706 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
707 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x02,
708 0x43, 0x41, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13,
709 0x09, 0x43, 0x75, 0x70, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x6f, 0x31, 0x13,
710 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70,
711 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x0f, 0x30, 0x0d, 0x06,
712 0x03, 0x55, 0x04, 0x0b, 0x13, 0x06, 0x69, 0x50, 0x68, 0x6f, 0x6e, 0x65,
713 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
714 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81,
715 0x89, 0x02, 0x81, 0x81, 0x00, 0xaf, 0xe4, 0x3c, 0xd3, 0x42, 0xb5, 0x82,
716 0x6f, 0x13, 0x13, 0x51, 0x67, 0xd1, 0x37, 0xec, 0xc6, 0xb9, 0xab, 0xff,
717 0xde, 0x9a, 0xcc, 0x6b, 0x16, 0xc3, 0x41, 0x78, 0x77, 0x20, 0x07, 0x46,
718 0xc9, 0x50, 0xab, 0x4d, 0xf4, 0xd9, 0x0e, 0x52, 0x0a, 0x86, 0x20, 0x28,
719 0x19, 0xaf, 0xe0, 0x96, 0xaa, 0x4e, 0x24, 0xac, 0xad, 0xf9, 0x6b, 0x61,
720 0x99, 0xda, 0x09, 0x3e, 0x7a, 0x4a, 0xe1, 0x5d, 0xa5, 0xb7, 0x12, 0xc7,
721 0xf7, 0x9b, 0xf8, 0xdb, 0x3a, 0x28, 0x33, 0x07, 0x2c, 0xf0, 0xf7, 0x41,
722 0xd1, 0x0f, 0xb0, 0x97, 0x01, 0xf1, 0xb3, 0x75, 0xc1, 0x4f, 0x48, 0x42,
723 0x52, 0x41, 0x42, 0x99, 0x89, 0x39, 0x59, 0x96, 0xec, 0x2d, 0x72, 0xf0,
724 0x32, 0x75, 0xc9, 0x00, 0xcd, 0xad, 0xf0, 0x2f, 0xbe, 0x6a, 0x07, 0xac,
725 0xbc, 0x04, 0x54, 0x15, 0xe0, 0x6e, 0xcb, 0x11, 0x86, 0x77, 0xaf, 0xf2,
726 0x07, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x1b, 0x30, 0x82,
727 0x01, 0x17, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30,
728 0x00, 0x30, 0x2e, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42,
729 0x01, 0x0d, 0x04, 0x21, 0x16, 0x1f, 0x22, 0x4f, 0x70, 0x65, 0x6e, 0x53,
730 0x53, 0x4c, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,
731 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
732 0x22, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
733 0x34, 0xe0, 0x45, 0x63, 0xa4, 0x4a, 0x7d, 0x07, 0xf2, 0x1e, 0xc1, 0x55,
734 0xf3, 0x33, 0x21, 0xa5, 0xa9, 0x71, 0x92, 0x06, 0x30, 0x81, 0xad, 0x06,
735 0x03, 0x55, 0x1d, 0x23, 0x04, 0x81, 0xa5, 0x30, 0x81, 0xa2, 0x80, 0x14,
736 0x38, 0x05, 0x20, 0xa9, 0x3f, 0xc6, 0x79, 0xf4, 0xec, 0x9a, 0x6f, 0x7f,
737 0x47, 0x02, 0x5e, 0x6e, 0xa4, 0x79, 0x11, 0xf5, 0xa1, 0x81, 0x86, 0xa4,
738 0x81, 0x83, 0x30, 0x81, 0x80, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
739 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
740 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49,
741 0x6e, 0x63, 0x2e, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x0b,
742 0x13, 0x1d, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74,
743 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
744 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x34, 0x30, 0x32, 0x06,
745 0x03, 0x55, 0x04, 0x03, 0x14, 0x2b, 0x5b, 0x54, 0x45, 0x53, 0x54, 0x5d,
746 0x20, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x50, 0x68, 0x6f, 0x6e,
747 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
748 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
749 0x79, 0x82, 0x01, 0x01, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04,
750 0x04, 0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
751 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00,
752 0x02, 0xc0, 0x6e, 0x4c, 0x4c, 0xeb, 0x7b, 0x02, 0xc3, 0x09, 0x05, 0x51,
753 0x29, 0xc1, 0x72, 0x3f, 0x7e, 0x39, 0x3f, 0xfd, 0x1f, 0xe0, 0x09, 0x9d,
754 0xff, 0xb6, 0xff, 0xda, 0xfd, 0xbc, 0xc9, 0xbd, 0xb2, 0x8d, 0x59, 0xf9,
755 0x89, 0x6a, 0x09, 0x96, 0x50, 0xdd, 0xf6, 0x16, 0xf6, 0x23, 0x84, 0x0b,
756 0xef, 0x0d, 0xf5, 0x16, 0x59, 0x8f, 0x7b, 0xd9, 0xbe, 0x1d, 0x94, 0xab,
757 0x07, 0x3c, 0x8c, 0x1e, 0x1b, 0x55, 0xa3, 0xab, 0xe7, 0x20, 0x97, 0x67,
758 0x1b, 0xb6, 0xad, 0x11, 0xe9, 0x8c, 0xd5, 0x80, 0xba, 0x3b, 0xad, 0xf8,
759 0x4e, 0x15, 0xce, 0x47, 0x4d, 0x2a, 0x67, 0x74, 0x4f, 0xe3, 0x3c, 0x95,
760 0x46, 0xed, 0x90, 0x33, 0x25, 0x01, 0x53, 0x74, 0x41, 0x29, 0xa5, 0x51,
761 0xee, 0x7a, 0x8c, 0x2e, 0x09, 0x0f, 0x2f, 0x25, 0x35, 0x81, 0x8a, 0x2e,
762 0xc3, 0x4b, 0xce, 0x79, 0xe1, 0xf8, 0x31, 0xeb
763 };
764
765
766 /* Test basic add delete update copy matching stuff. */
767 static void tests(void)
768 {
769 SecTrustRef trust;
770 SecCertificateRef _device_cert, _device_ca, _device_activation,
771 _iphone_cert_authority, _factory_device_ca, _factory_device_cert;
772 isnt(_device_activation = SecCertificateCreateWithBytes(NULL,
773 _AppleiPhoneActivation_DER, sizeof(_AppleiPhoneActivation_DER)),
774 NULL, "create iphone activation cert");
775 isnt(_iphone_cert_authority = SecCertificateCreateWithBytes(NULL,
776 _AppleiPhoneCertificationAuthority_DER,
777 sizeof(_AppleiPhoneCertificationAuthority_DER)),
778 NULL, "create iphone cert authority");
779 isnt(_device_ca = SecCertificateCreateWithBytes(NULL,
780 _AppleiPhoneDeviceCA_DER,
781 sizeof(_AppleiPhoneDeviceCA_DER)),
782 NULL, "create iphone device CA");
783 isnt(_device_cert = SecCertificateCreateWithBytes(NULL,
784 _AppleiPhoneDeviceCert_DER,
785 sizeof(_AppleiPhoneDeviceCert_DER)),
786 NULL, "create iphone device certificate");
787 isnt(_factory_device_ca = SecCertificateCreateWithBytes(NULL,
788 _AppleFactoryDeviceCA_DER,
789 sizeof(_AppleFactoryDeviceCA_DER)),
790 NULL, "create factory device authority");
791 isnt(_factory_device_cert = SecCertificateCreateWithBytes(NULL,
792 _AppleFactoryDeviceCert_DER,
793 sizeof(_AppleFactoryDeviceCert_DER)),
794 NULL, "create factory device certificate");
795
796 const void *v_certs[] = {
797 _device_activation,
798 _iphone_cert_authority
799 };
800 SecPolicyRef policy = SecPolicyCreateiPhoneActivation();
801 CFArrayRef certs = CFArrayCreate(NULL, v_certs,
802 array_size(v_certs), NULL);
803 ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust");
804
805 SecTrustResultType trustResult;
806 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
807 is_status(trustResult, kSecTrustResultUnspecified,
808 "trust is kSecTrustResultUnspecified");
809
810 is(SecTrustGetCertificateCount(trust), 3, "cert count is 3");
811
812 CFArrayRef anchors = CFArrayCreate(NULL, (const void **)&_iphone_cert_authority,
813 1, &kCFTypeArrayCallBacks);
814 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
815 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
816 is_status(trustResult, kSecTrustResultRecoverableTrustFailure,
817 "trust is kSecTrustResultRecoverableTrustFailure");
818 is(SecTrustGetCertificateCount(trust), 2, "cert count is 2");
819
820 CFReleaseSafe(anchors);
821 CFReleaseSafe(trust);
822 CFReleaseSafe(policy);
823 CFReleaseSafe(certs);
824 CFReleaseSafe(_device_activation);
825
826 /* SHA256 signature test */
827 policy = SecPolicyCreateiPhoneDeviceCertificate();
828 const void *v_dev_certs[] = {
829 _device_cert,
830 _device_ca,
831 _iphone_cert_authority
832 };
833 certs = CFArrayCreate(NULL, v_dev_certs,
834 array_size(v_dev_certs), NULL);
835
836 /* leaf is valid from 238444365-333052365 */
837 ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust");
838 CFDateRef date = CFDateCreate(NULL, 220752000.0); /* 1 Jan 2008 */
839 ok_status(SecTrustSetVerifyDate(trust, date), "set date");
840 CFRelease(date);
841
842 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
843 is_status(trustResult, kSecTrustResultUnspecified, "trusted");
844
845 CFReleaseSafe(trust);
846 CFReleaseSafe(policy);
847 CFReleaseSafe(certs);
848
849 certs = CFArrayCreate(NULL, (const void **)&_factory_device_cert, 1, NULL);
850 anchors = CFArrayCreate(NULL, (const void **)&_factory_device_ca, 1, NULL);
851 policy = SecPolicyCreateFactoryDeviceCertificate();
852 ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust");
853 /* pick date outside of validity range: 254125603-569485603 */
854 date = CFDateCreate(NULL, 220752000.0); /* 1 Jan 2008 */
855 ok_status(SecTrustSetVerifyDate(trust, date), "set date");
856 CFRelease(date);
857 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchor");
858 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
859 is_status(trustResult, kSecTrustResultUnspecified, "trusted");
860 is(2, SecTrustGetCertificateCount(trust), "cert count is 2");
861
862 CFReleaseSafe(trust);
863 CFReleaseSafe(policy);
864 CFReleaseSafe(certs);
865 CFReleaseSafe(anchors);
866
867 CFReleaseSafe(_iphone_cert_authority);
868 CFReleaseSafe(_device_ca);
869 CFReleaseSafe(_device_cert);
870 CFReleaseSafe(_factory_device_ca);
871 CFReleaseSafe(_factory_device_cert);
872
873 SecCertificateRef _pairing_host_cert, _pairing_root_cert, _wrong_pairing_root_cert;
874 isnt(_pairing_host_cert = SecCertificateCreateWithBytes(NULL,
875 certa, certa_len),
876 NULL, "create iphone activation cert");
877 isnt(_pairing_root_cert = SecCertificateCreateWithBytes(NULL,
878 certb, certb_len),
879 NULL, "create iphone cert authority");
880 isnt(_wrong_pairing_root_cert = SecCertificateCreateWithBytes(NULL,
881 certc, certc_len),
882 NULL, "create iphone cert authority");
883
884 const void *pairing_certs_chain[] = {
885 _pairing_host_cert,
886 _pairing_root_cert
887 };
888 policy = SecPolicyCreateLockdownPairing();
889 certs = CFArrayCreate(NULL, pairing_certs_chain,
890 array_size(pairing_certs_chain), NULL);
891 ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust");
892
893 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
894 is_status(trustResult, kSecTrustResultRecoverableTrustFailure,
895 "trust is kSecTrustResultRecoverableTrustFailure");
896
897 is(SecTrustGetCertificateCount(trust), 2, "cert count is 2");
898
899 anchors = CFArrayCreate(NULL, (const void **)&_pairing_root_cert,
900 1, &kCFTypeArrayCallBacks);
901 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
902 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
903 is_status(trustResult, kSecTrustResultUnspecified,
904 "trust is kSecTrustResultUnspecified");
905 is(SecTrustGetCertificateCount(trust), 2, "cert count is 2");
906 CFReleaseSafe(trust);
907 CFReleaseSafe(certs);
908
909 ok_status(SecTrustCreateWithCertificates(anchors, policy, &trust), "create trust");
910 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
911 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
912 is_status(trustResult, kSecTrustResultUnspecified,
913 "trust is kSecTrustResultUnspecified");
914 CFReleaseSafe(trust);
915
916 certs = CFArrayCreate(NULL, (const void **)&_wrong_pairing_root_cert,
917 1, NULL);
918 ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust");
919 ok_status(SecTrustSetAnchorCertificates(trust, anchors), "set anchors");
920 ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");
921 is_status(trustResult, kSecTrustResultRecoverableTrustFailure,
922 "trust is kSecTrustResultRecoverableTrustFailure");
923
924 CFReleaseSafe(policy);
925 CFReleaseSafe(certs);
926 CFReleaseSafe(trust);
927 CFReleaseSafe(anchors);
928
929 CFReleaseSafe(_pairing_root_cert);
930 CFReleaseSafe(_pairing_host_cert);
931 CFReleaseSafe(_wrong_pairing_root_cert);
932
933 }
934
935 int si_20_sectrust_activation(int argc, char *const *argv)
936 {
937 plan_tests(43);
938
939 tests();
940
941 return 0;
942 }