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