]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-61-pkcs12.c
Security-57337.50.23.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-61-pkcs12.c
1 /*
2 * Copyright (c) 2008-2010,2012-2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25 #include <Security/SecImportExport.h>
26
27 #include <CommonCrypto/CommonCryptor.h>
28 #include <Security/SecIdentity.h>
29 #include <Security/SecItem.h>
30 #include <Security/SecItemPriv.h>
31 #include <Security/SecBasePriv.h>
32 #include <Security/SecKey.h>
33 #include <Security/SecECKey.h>
34
35 #include <Security/SecInternal.h>
36 #include <CoreFoundation/CoreFoundation.h>
37 #include <stdlib.h>
38 #include <unistd.h>
39
40 #include "Security_regressions.h"
41
42 unsigned char _user_one_p12[] = {
43 0x30, 0x82, 0x06, 0xf1, 0x02, 0x01, 0x03, 0x30, 0x82, 0x06, 0xb7, 0x06,
44 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82,
45 0x06, 0xa8, 0x04, 0x82, 0x06, 0xa4, 0x30, 0x82, 0x06, 0xa0, 0x30, 0x82,
46 0x03, 0x9f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07,
47 0x06, 0xa0, 0x82, 0x03, 0x90, 0x30, 0x82, 0x03, 0x8c, 0x02, 0x01, 0x00,
48 0x30, 0x82, 0x03, 0x85, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
49 0x01, 0x07, 0x01, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
50 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0e, 0x04, 0x08, 0x07, 0xfd, 0xeb,
51 0x68, 0x40, 0xd8, 0x58, 0x20, 0x02, 0x02, 0x08, 0x00, 0x80, 0x82, 0x03,
52 0x58, 0x03, 0x78, 0xbd, 0x4a, 0x74, 0xb4, 0x64, 0x25, 0xcc, 0xec, 0xb7,
53 0xad, 0xee, 0xc5, 0x80, 0x9b, 0xdd, 0x24, 0xab, 0x1f, 0xd8, 0xa4, 0x2d,
54 0x6f, 0xbc, 0x7d, 0xba, 0xf3, 0x7c, 0xc9, 0x93, 0x9c, 0xb4, 0xb7, 0x6e,
55 0x2c, 0x77, 0x8d, 0xf0, 0x64, 0x59, 0x96, 0x34, 0xfb, 0xd7, 0x95, 0x5e,
56 0x2a, 0xab, 0xf4, 0x64, 0x12, 0xdf, 0x68, 0x71, 0xcb, 0xa9, 0xc1, 0xe7,
57 0x36, 0x46, 0x06, 0xd7, 0xde, 0xc2, 0x00, 0x13, 0xfe, 0x9d, 0xb9, 0x43,
58 0xa2, 0x57, 0xd9, 0xb8, 0x6f, 0xa7, 0x09, 0xca, 0x2e, 0xc0, 0x72, 0x03,
59 0x12, 0x32, 0x4c, 0x26, 0x90, 0x6b, 0x8f, 0xc1, 0xbf, 0x2e, 0xab, 0x77,
60 0x9c, 0xaf, 0x0c, 0x96, 0x77, 0xc7, 0x93, 0x02, 0xdb, 0x6f, 0x5e, 0xfd,
61 0x67, 0xff, 0x48, 0x7f, 0x12, 0x69, 0x47, 0x29, 0x6a, 0xc5, 0x6d, 0xb2,
62 0x3f, 0xaa, 0x26, 0x42, 0x0d, 0x84, 0x7d, 0x3b, 0x19, 0xe5, 0x7c, 0xb2,
63 0x47, 0xf0, 0x9d, 0xd1, 0x06, 0x73, 0xc8, 0xd0, 0x85, 0xc5, 0xc5, 0x9f,
64 0xb4, 0xcc, 0x62, 0x17, 0xed, 0x42, 0x5b, 0x0a, 0x57, 0x2c, 0xc8, 0x6b,
65 0x39, 0x29, 0x83, 0x4f, 0xa0, 0xfa, 0xd0, 0x1d, 0xb3, 0x8f, 0xf0, 0x2e,
66 0x72, 0x66, 0x72, 0x7a, 0xc7, 0x9c, 0x67, 0x9e, 0x1c, 0xdf, 0x7c, 0xfc,
67 0x87, 0x1a, 0xcc, 0xdf, 0x6b, 0x22, 0x17, 0x4b, 0x16, 0x5a, 0x97, 0x16,
68 0x22, 0xea, 0xdb, 0x02, 0xab, 0x21, 0xcd, 0xb2, 0x4b, 0x85, 0x72, 0xbb,
69 0xe0, 0x98, 0xdc, 0x1a, 0xf8, 0xde, 0xd3, 0x0a, 0x2f, 0xc1, 0x2d, 0x91,
70 0x45, 0x7b, 0x33, 0xe6, 0x02, 0x0a, 0x12, 0xb2, 0x27, 0x4a, 0x44, 0x6f,
71 0x1b, 0x6a, 0x2f, 0x15, 0xab, 0x06, 0xcb, 0x19, 0xd4, 0x16, 0x14, 0x06,
72 0x18, 0x3e, 0x6a, 0x84, 0x61, 0x9e, 0x28, 0x61, 0xa6, 0xaa, 0x51, 0x6b,
73 0x3b, 0x66, 0x95, 0xd8, 0x9a, 0x2c, 0x65, 0x99, 0x58, 0xad, 0xcf, 0xdf,
74 0x8a, 0x0f, 0x60, 0x20, 0xc5, 0x1a, 0x3e, 0xfc, 0x28, 0x7e, 0x8f, 0x7f,
75 0xe6, 0xa5, 0x48, 0xff, 0x2b, 0x65, 0xfd, 0xa5, 0xa2, 0x9e, 0x0d, 0x1d,
76 0xe3, 0xf8, 0x68, 0x02, 0xac, 0x67, 0x0e, 0x12, 0x27, 0x37, 0x06, 0x95,
77 0x0a, 0x59, 0xdf, 0x42, 0x6b, 0x0c, 0xc0, 0x79, 0xc8, 0x38, 0xde, 0x0c,
78 0x60, 0x36, 0x89, 0xdf, 0xd0, 0x58, 0xd9, 0x67, 0x84, 0xf0, 0x54, 0x67,
79 0xd3, 0x83, 0x27, 0x13, 0x99, 0xff, 0x0e, 0x68, 0x04, 0x7e, 0x65, 0xe3,
80 0x69, 0x74, 0xec, 0x0e, 0x63, 0x2c, 0x05, 0xc2, 0x64, 0x43, 0x6d, 0x78,
81 0xa0, 0xe8, 0x76, 0x9c, 0x60, 0x6b, 0xad, 0x0f, 0x5e, 0x2d, 0x44, 0xc1,
82 0xa1, 0x2c, 0x5c, 0x2a, 0x01, 0x7b, 0xe3, 0xba, 0xbd, 0x8b, 0xd0, 0x7b,
83 0x98, 0x77, 0x5e, 0xe9, 0xb0, 0xda, 0x95, 0x97, 0x6c, 0x32, 0x60, 0x6f,
84 0x76, 0xf2, 0x07, 0x05, 0xd7, 0x3a, 0x40, 0x0b, 0x3e, 0xfc, 0xae, 0x72,
85 0x30, 0xa2, 0x9c, 0x2f, 0x66, 0xea, 0x84, 0x1e, 0xa1, 0xc8, 0x67, 0x2c,
86 0x07, 0x46, 0x84, 0xed, 0x38, 0x74, 0x75, 0xc9, 0x68, 0x7f, 0x63, 0x08,
87 0x04, 0xb8, 0xb4, 0xd3, 0x62, 0x11, 0x50, 0x32, 0x20, 0x1e, 0xce, 0xf9,
88 0x43, 0xc4, 0xe8, 0xb4, 0x01, 0x28, 0x85, 0x1b, 0x1e, 0x62, 0x60, 0x9c,
89 0x43, 0xa7, 0xab, 0xd2, 0x8f, 0x25, 0xa6, 0x2d, 0x09, 0x7d, 0x25, 0x05,
90 0x0c, 0x9e, 0x84, 0xdc, 0xd9, 0xf7, 0xf2, 0xda, 0x87, 0xce, 0x8e, 0x23,
91 0x22, 0x9c, 0x4f, 0x4a, 0x0c, 0xe2, 0x6a, 0x2b, 0x18, 0x17, 0x65, 0x08,
92 0xda, 0x18, 0x57, 0xfd, 0x34, 0x97, 0xbd, 0xc5, 0xce, 0x76, 0xa8, 0x22,
93 0xee, 0x60, 0x63, 0x78, 0x30, 0x04, 0xfa, 0x49, 0x63, 0x65, 0x5f, 0xe4,
94 0x75, 0x9f, 0x68, 0xf6, 0x93, 0x86, 0xf2, 0x76, 0x00, 0x91, 0xd1, 0x7b,
95 0xcf, 0xcc, 0x55, 0xca, 0x4a, 0x2c, 0x35, 0xe0, 0x64, 0xb2, 0xc0, 0x2c,
96 0x02, 0x84, 0xa2, 0xd8, 0x54, 0x08, 0xbe, 0x93, 0xfd, 0x77, 0x5d, 0xa5,
97 0x4e, 0xc7, 0x07, 0x39, 0xed, 0xa5, 0x68, 0x0b, 0x93, 0x65, 0xc0, 0xd3,
98 0x42, 0x55, 0xc8, 0x61, 0x92, 0x02, 0x34, 0x67, 0x93, 0x4e, 0xcb, 0xa1,
99 0x99, 0x38, 0xe6, 0x93, 0x3b, 0xe2, 0x4c, 0x7d, 0x55, 0xc4, 0xd2, 0x55,
100 0x81, 0x4a, 0xe4, 0xd7, 0x1c, 0x25, 0x85, 0xd8, 0xd2, 0x3e, 0x1c, 0xe6,
101 0xd6, 0xdb, 0x85, 0x02, 0x2b, 0x67, 0x07, 0x5e, 0xdc, 0x19, 0x82, 0x10,
102 0xa7, 0x8d, 0x2c, 0x08, 0xad, 0x4a, 0x7c, 0x54, 0x81, 0x65, 0xb6, 0xca,
103 0x4a, 0x4c, 0x5d, 0xed, 0xb4, 0x3a, 0x81, 0x0c, 0xc5, 0x65, 0x01, 0x89,
104 0x51, 0x6f, 0xbc, 0xfa, 0x90, 0x78, 0x6c, 0x81, 0x42, 0x00, 0xa3, 0x45,
105 0xa3, 0x58, 0xa7, 0x09, 0x84, 0xa6, 0x6e, 0xae, 0xc6, 0x01, 0x84, 0x9e,
106 0x8a, 0x78, 0xa9, 0xd8, 0x48, 0x07, 0x7c, 0x02, 0x44, 0x4d, 0xcf, 0xd9,
107 0x6e, 0xae, 0xbd, 0xe2, 0x8c, 0xb4, 0x92, 0x65, 0x24, 0x43, 0x67, 0xb2,
108 0x92, 0x86, 0xac, 0x81, 0x95, 0x48, 0xdc, 0xdf, 0xd7, 0x7d, 0x3b, 0xf2,
109 0x4c, 0x4b, 0x19, 0xb0, 0xdd, 0x87, 0x1d, 0xd9, 0xf6, 0x0f, 0x30, 0x40,
110 0x60, 0x78, 0x7b, 0xf8, 0xcf, 0x84, 0x60, 0x7c, 0x2d, 0xdc, 0xd3, 0x6b,
111 0xbf, 0x68, 0xd3, 0x86, 0x7e, 0x22, 0xee, 0x81, 0x25, 0xdf, 0xee, 0x2b,
112 0x2b, 0x39, 0x6b, 0xfe, 0x91, 0xa9, 0x41, 0x67, 0xe4, 0x8b, 0x14, 0xd6,
113 0x9f, 0x12, 0xaf, 0x4f, 0x89, 0x35, 0xd9, 0x6f, 0xd1, 0x48, 0xae, 0x89,
114 0xd3, 0x13, 0x8e, 0x13, 0xa0, 0xba, 0xc8, 0xef, 0xab, 0x2e, 0xdf, 0xe4,
115 0x1f, 0xbd, 0xb7, 0x26, 0x28, 0x75, 0xe4, 0x7a, 0x11, 0x29, 0x8e, 0xe6,
116 0x59, 0x62, 0x67, 0x2f, 0xd8, 0x8b, 0x87, 0xee, 0xcf, 0x80, 0x46, 0x14,
117 0xd5, 0x77, 0xd8, 0x6b, 0xb0, 0xa4, 0xa0, 0xce, 0x93, 0xa8, 0x2c, 0x5f,
118 0x4b, 0x3c, 0x56, 0x7b, 0x4e, 0x56, 0x2e, 0x7b, 0x3b, 0xa8, 0x26, 0x3e,
119 0x96, 0x57, 0x05, 0x76, 0xc4, 0xff, 0x26, 0x7a, 0xe6, 0x3b, 0x21, 0xd2,
120 0x76, 0x2b, 0xd3, 0xb8, 0x2d, 0x57, 0x7b, 0x62, 0xdb, 0x80, 0x9a, 0xde,
121 0xad, 0x4a, 0x1b, 0x85, 0xb7, 0xd0, 0xa6, 0x0e, 0x85, 0x0a, 0xbb, 0x43,
122 0x9f, 0x5c, 0x03, 0x4f, 0x9c, 0x47, 0x11, 0xb2, 0x5c, 0xc8, 0x8f, 0xb5,
123 0x8d, 0xf1, 0x28, 0x37, 0xca, 0x30, 0x82, 0x02, 0xf9, 0x06, 0x09, 0x2a,
124 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x02, 0xea,
125 0x04, 0x82, 0x02, 0xe6, 0x30, 0x82, 0x02, 0xe2, 0x30, 0x82, 0x02, 0xde,
126 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01,
127 0x02, 0xa0, 0x82, 0x02, 0xa6, 0x30, 0x82, 0x02, 0xa2, 0x30, 0x1c, 0x06,
128 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30,
129 0x0e, 0x04, 0x08, 0xfd, 0x54, 0x70, 0x85, 0x3f, 0x2b, 0x23, 0x6c, 0x02,
130 0x02, 0x08, 0x00, 0x04, 0x82, 0x02, 0x80, 0xbc, 0x6f, 0xe7, 0x00, 0x36,
131 0xd9, 0xe9, 0xba, 0x49, 0x04, 0xd5, 0x06, 0xb0, 0xbb, 0x6b, 0xe8, 0x8d,
132 0x51, 0x46, 0x38, 0xdc, 0x00, 0xc6, 0xf0, 0xc7, 0xb0, 0x9d, 0xf9, 0x82,
133 0xec, 0x87, 0x08, 0x6a, 0x7f, 0xce, 0xb8, 0x22, 0x55, 0xae, 0x24, 0x8f,
134 0x77, 0x50, 0x40, 0xf2, 0x72, 0x9d, 0xc9, 0xc9, 0x97, 0x0d, 0x1c, 0xee,
135 0x8c, 0x30, 0x0b, 0xfe, 0x8c, 0x63, 0x1e, 0x1b, 0x6a, 0x13, 0xaa, 0xf5,
136 0x60, 0xf1, 0x38, 0x00, 0x5b, 0x55, 0x18, 0x43, 0xf5, 0xea, 0x9e, 0xdc,
137 0x12, 0xb4, 0xfd, 0xf8, 0xee, 0x62, 0x0d, 0x67, 0x32, 0x23, 0xf5, 0x3c,
138 0x43, 0x5f, 0x18, 0xea, 0x3a, 0x1b, 0x7f, 0xcb, 0x20, 0xe4, 0x80, 0xb3,
139 0xd4, 0x37, 0x1a, 0x58, 0x59, 0x3b, 0x40, 0xd7, 0x8e, 0x30, 0xbe, 0xee,
140 0x7b, 0x65, 0xa4, 0x39, 0xf5, 0x4c, 0xa8, 0x8c, 0x20, 0x79, 0xe3, 0x1f,
141 0x72, 0x82, 0x1f, 0xe3, 0x16, 0xfd, 0x29, 0xe2, 0x90, 0xa0, 0xac, 0x54,
142 0xad, 0x01, 0x18, 0x42, 0x02, 0xef, 0xae, 0x61, 0x7b, 0xf9, 0x89, 0x8c,
143 0x40, 0x97, 0xfb, 0x5a, 0x4c, 0xee, 0x9a, 0xb0, 0x02, 0xc3, 0x48, 0x28,
144 0x58, 0xb0, 0x9a, 0x98, 0xe8, 0x70, 0x53, 0xc7, 0x7d, 0x40, 0x2e, 0x6d,
145 0x0a, 0x0c, 0xa1, 0xb6, 0xac, 0x48, 0xe0, 0xde, 0x3a, 0x37, 0x52, 0x77,
146 0xc5, 0x89, 0x8f, 0xa7, 0xf8, 0xaf, 0xfc, 0x94, 0x2d, 0xb7, 0xf1, 0xff,
147 0x79, 0x44, 0x29, 0x69, 0xee, 0x6f, 0xaf, 0x3e, 0xe6, 0xe4, 0x09, 0x62,
148 0x45, 0x36, 0xb2, 0x11, 0x3d, 0x0a, 0xdc, 0x3a, 0xc6, 0x6b, 0x46, 0x48,
149 0x42, 0x60, 0xd5, 0x92, 0x49, 0x3e, 0xd8, 0xbc, 0x4b, 0x47, 0x2b, 0x2a,
150 0xe9, 0xa6, 0xe5, 0xca, 0x6a, 0x39, 0x87, 0x3b, 0xa8, 0xa4, 0xae, 0x29,
151 0x36, 0xb4, 0x39, 0xe2, 0x7e, 0x9a, 0x22, 0x69, 0xc6, 0xa3, 0x95, 0xa3,
152 0x20, 0xf9, 0x6e, 0xc9, 0xfd, 0x4c, 0x3a, 0xd4, 0x9d, 0x9c, 0xeb, 0x91,
153 0x95, 0xdc, 0x1a, 0x3b, 0xd8, 0x0d, 0x0a, 0x87, 0x52, 0xef, 0x13, 0x77,
154 0xee, 0x92, 0x25, 0xba, 0xc7, 0x7a, 0x16, 0x2d, 0x85, 0x78, 0x3e, 0xbb,
155 0x0f, 0x95, 0xed, 0x60, 0xd0, 0x01, 0x60, 0xa2, 0x69, 0x3b, 0x3c, 0x63,
156 0x5c, 0x10, 0x78, 0x15, 0x72, 0x40, 0xc6, 0x1e, 0x0e, 0x34, 0xee, 0x71,
157 0x1d, 0xdf, 0xfb, 0x5f, 0x58, 0x3a, 0xdf, 0xb9, 0xc0, 0xa1, 0xa2, 0x02,
158 0x25, 0xc7, 0x16, 0xe4, 0x50, 0x64, 0xa8, 0x84, 0x3e, 0xa0, 0xb2, 0x8a,
159 0xfa, 0xbe, 0x55, 0x17, 0xf9, 0x7c, 0x64, 0x4b, 0xa6, 0xf7, 0x50, 0x52,
160 0x06, 0x39, 0xb1, 0x30, 0x28, 0x32, 0xa7, 0x7b, 0xaf, 0x18, 0xbd, 0x8b,
161 0x25, 0x6d, 0xde, 0x95, 0x82, 0xfb, 0x65, 0x71, 0x31, 0xca, 0x3e, 0x41,
162 0xb1, 0xa9, 0xf1, 0xec, 0x3c, 0xbc, 0x24, 0x49, 0x12, 0x1a, 0x49, 0x66,
163 0x90, 0xb2, 0xc4, 0x36, 0xe3, 0xd8, 0x93, 0x66, 0x6c, 0xc6, 0x81, 0xef,
164 0xf3, 0x61, 0xab, 0x4c, 0xba, 0x8e, 0x39, 0x47, 0xeb, 0x9b, 0xdf, 0x59,
165 0x9e, 0x45, 0xdc, 0x64, 0x51, 0xfb, 0x2d, 0x4c, 0x61, 0xbe, 0x70, 0x3a,
166 0x20, 0x86, 0x09, 0x75, 0xbe, 0x03, 0xdc, 0x35, 0x00, 0xae, 0xa9, 0x3d,
167 0xb4, 0xa2, 0x3a, 0xfb, 0xc5, 0x63, 0xb6, 0xf1, 0x92, 0x58, 0x84, 0x42,
168 0xf3, 0x11, 0x47, 0x38, 0xd4, 0x47, 0x59, 0x7d, 0xc6, 0xb6, 0x31, 0x83,
169 0x7e, 0x44, 0x41, 0xca, 0x50, 0x34, 0xf6, 0xf2, 0x23, 0x1f, 0x4d, 0x7d,
170 0x4d, 0xf7, 0xe8, 0x0b, 0x58, 0x0f, 0x94, 0x1f, 0x66, 0x8b, 0xe6, 0x6d,
171 0xe3, 0x91, 0xf8, 0xe7, 0xca, 0xca, 0x86, 0xdb, 0x66, 0x7e, 0x3e, 0x0c,
172 0x7a, 0xa8, 0xd4, 0xd4, 0xa2, 0x98, 0xe7, 0x33, 0x09, 0x7a, 0x77, 0x0d,
173 0x63, 0x48, 0x0a, 0x7e, 0x27, 0x2e, 0x59, 0x87, 0xcc, 0x47, 0xa6, 0x2d,
174 0x14, 0xfc, 0x1f, 0xa7, 0x31, 0xba, 0xac, 0xef, 0x4e, 0xf2, 0x02, 0xdc,
175 0x8c, 0x7b, 0x44, 0x08, 0x4a, 0xeb, 0xbe, 0x48, 0xe1, 0xf0, 0x56, 0xb1,
176 0xe2, 0x1a, 0x5a, 0x39, 0x11, 0x3b, 0x56, 0x5b, 0x7f, 0x05, 0xd4, 0x99,
177 0x6d, 0xa1, 0x46, 0x42, 0x9a, 0x69, 0xc8, 0x97, 0x5c, 0x3b, 0xfd, 0x18,
178 0x28, 0x98, 0xaa, 0x7a, 0x66, 0xf1, 0x7d, 0xcb, 0x60, 0x38, 0xd8, 0x97,
179 0xed, 0x28, 0xec, 0xbb, 0x6e, 0xf0, 0x83, 0xdc, 0x1c, 0xae, 0xc2, 0xd3,
180 0xa5, 0x2b, 0xd5, 0x13, 0x22, 0xf6, 0x6c, 0x7c, 0x43, 0x74, 0xf3, 0xed,
181 0xd1, 0x89, 0x0a, 0x2c, 0x93, 0xb0, 0x42, 0xa3, 0x5f, 0xda, 0xa7, 0x04,
182 0x76, 0x33, 0xb8, 0x05, 0xf5, 0xaf, 0xf4, 0x91, 0x43, 0x88, 0xde, 0xfc,
183 0x68, 0xd0, 0xa4, 0x1f, 0x6e, 0x47, 0xc3, 0x73, 0x96, 0xfa, 0x4d, 0x31,
184 0x25, 0x30, 0x23, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
185 0x09, 0x15, 0x31, 0x16, 0x04, 0x14, 0x9e, 0x4f, 0xb2, 0x4e, 0x45, 0x98,
186 0x37, 0x90, 0x63, 0x59, 0xe3, 0x7b, 0xcc, 0xca, 0x76, 0x0a, 0xaf, 0x95,
187 0x35, 0x37, 0x30, 0x31, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e,
188 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0x82, 0xbc, 0x96, 0xb1, 0x5d,
189 0x7f, 0x5d, 0x93, 0x54, 0x42, 0x95, 0x55, 0x01, 0x6a, 0xcd, 0x65, 0x01,
190 0x7a, 0x06, 0xcf, 0x04, 0x08, 0x39, 0xfd, 0x29, 0x7c, 0xbe, 0x39, 0x07,
191 0xd5, 0x02, 0x02, 0x08, 0x00
192 };
193
194 unsigned char _user_two_p12[] = {
195 0x30, 0x82, 0x06, 0xf1, 0x02, 0x01, 0x03, 0x30, 0x82, 0x06, 0xb7, 0x06,
196 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82,
197 0x06, 0xa8, 0x04, 0x82, 0x06, 0xa4, 0x30, 0x82, 0x06, 0xa0, 0x30, 0x82,
198 0x03, 0x9f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07,
199 0x06, 0xa0, 0x82, 0x03, 0x90, 0x30, 0x82, 0x03, 0x8c, 0x02, 0x01, 0x00,
200 0x30, 0x82, 0x03, 0x85, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
201 0x01, 0x07, 0x01, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
202 0x0d, 0x01, 0x0c, 0x01, 0x06, 0x30, 0x0e, 0x04, 0x08, 0x59, 0x5c, 0x39,
203 0x74, 0xd7, 0x82, 0x11, 0x51, 0x02, 0x02, 0x08, 0x00, 0x80, 0x82, 0x03,
204 0x58, 0xa6, 0xd1, 0xa1, 0x2f, 0x26, 0x9d, 0x85, 0x45, 0xae, 0x87, 0x8f,
205 0xd4, 0x13, 0x32, 0x90, 0xba, 0x53, 0x3b, 0x65, 0x02, 0xa9, 0xa0, 0xe6,
206 0x45, 0x30, 0xee, 0x1c, 0xf6, 0x24, 0x38, 0x22, 0x26, 0x37, 0x50, 0x2d,
207 0x7c, 0x9b, 0x66, 0xa6, 0x13, 0xed, 0xd5, 0x9f, 0xd3, 0x6d, 0xc6, 0x2b,
208 0x9c, 0x66, 0x22, 0x3f, 0x95, 0xa5, 0x99, 0xc9, 0x8b, 0xcc, 0x40, 0x4b,
209 0xa8, 0xd0, 0x2a, 0x6f, 0x16, 0x9b, 0xc3, 0xec, 0xfc, 0xa4, 0x28, 0xc5,
210 0xb0, 0xa8, 0xc2, 0x96, 0xb4, 0xa2, 0x9d, 0x8d, 0x33, 0xc3, 0x6d, 0xc8,
211 0xac, 0x64, 0x34, 0x73, 0xda, 0x1c, 0x5b, 0x07, 0xc1, 0x45, 0xac, 0xe2,
212 0x00, 0x56, 0xaf, 0x38, 0xc1, 0x30, 0xe4, 0x65, 0x24, 0x42, 0x67, 0x2d,
213 0xcf, 0x19, 0xad, 0x2a, 0xe2, 0x04, 0x2d, 0x5a, 0x48, 0xd1, 0xdc, 0xbe,
214 0x88, 0xb7, 0x31, 0x5b, 0x37, 0x75, 0x6e, 0xa5, 0xe2, 0x74, 0xf0, 0xba,
215 0xac, 0xe2, 0x24, 0x84, 0x6d, 0x94, 0x65, 0xb4, 0x55, 0x3f, 0xf8, 0x8d,
216 0xd3, 0x13, 0xa1, 0xce, 0x33, 0x4f, 0x39, 0xc7, 0x80, 0x1a, 0x0e, 0x68,
217 0x0f, 0x63, 0xc6, 0x36, 0x01, 0xaa, 0xd3, 0x3b, 0x03, 0xe4, 0xa9, 0xdd,
218 0x4d, 0x4a, 0xcc, 0xf8, 0x2b, 0x55, 0xa7, 0x47, 0x31, 0x39, 0x14, 0xd5,
219 0x0f, 0x3f, 0x38, 0xfd, 0xc7, 0xe6, 0x99, 0x36, 0xc2, 0x1b, 0xa8, 0x99,
220 0x16, 0xa8, 0x05, 0x7a, 0xc4, 0x66, 0x97, 0x13, 0x09, 0x0d, 0x15, 0x14,
221 0x66, 0x3c, 0x9b, 0x39, 0x6c, 0x10, 0xc9, 0xc5, 0xbe, 0x69, 0xd7, 0x13,
222 0x21, 0xb3, 0xd8, 0x29, 0x50, 0xf4, 0x40, 0x77, 0x09, 0xb3, 0x32, 0xf2,
223 0x88, 0xa5, 0x05, 0x5e, 0x14, 0x77, 0x41, 0xd5, 0x31, 0x82, 0xcb, 0xea,
224 0xe0, 0x56, 0xd3, 0xb0, 0x3e, 0x27, 0xd7, 0x9d, 0x46, 0x04, 0x07, 0x86,
225 0x8b, 0xb2, 0x0f, 0x45, 0xc4, 0x8b, 0xff, 0xcb, 0x39, 0x54, 0x6c, 0xe0,
226 0x9b, 0x6d, 0xbc, 0x5d, 0x1c, 0x0e, 0xb2, 0xba, 0xfe, 0x94, 0x2a, 0x9c,
227 0x4f, 0x84, 0x44, 0x17, 0xc4, 0x07, 0x0b, 0x8d, 0x6f, 0x90, 0x23, 0xfb,
228 0xf3, 0xe4, 0x0f, 0x4a, 0xf4, 0x40, 0xf5, 0xf4, 0xfe, 0xb4, 0x32, 0xde,
229 0x01, 0x0c, 0x00, 0x3a, 0x0a, 0x9e, 0xa0, 0x1a, 0x95, 0x94, 0xbe, 0x3c,
230 0x75, 0x32, 0x38, 0x50, 0x07, 0xd3, 0x70, 0x30, 0x47, 0x7a, 0xce, 0x74,
231 0x57, 0x8f, 0x7b, 0x5c, 0x2b, 0xb8, 0xc0, 0x72, 0xbf, 0x9a, 0xab, 0xc0,
232 0xe4, 0x26, 0xec, 0x91, 0x80, 0xba, 0x45, 0xa7, 0xc0, 0x18, 0xcf, 0xed,
233 0x24, 0x9f, 0x1b, 0x07, 0xcb, 0x1b, 0xd2, 0x81, 0xe8, 0x4b, 0x26, 0x0a,
234 0xf6, 0x4c, 0x81, 0x5f, 0x4f, 0x2a, 0x7c, 0x79, 0x25, 0xd6, 0x8b, 0xe7,
235 0x00, 0x82, 0xf2, 0x6e, 0x6c, 0x63, 0x38, 0x19, 0x79, 0x05, 0x0e, 0xb8,
236 0x13, 0x2b, 0x30, 0x2b, 0xd3, 0xe3, 0x85, 0x6b, 0x75, 0x32, 0xc2, 0x58,
237 0xa4, 0xf0, 0xd3, 0x0a, 0xae, 0xee, 0x3e, 0x10, 0x28, 0x5d, 0xd5, 0x09,
238 0x6f, 0x0f, 0xa2, 0x15, 0x6f, 0x3c, 0x40, 0xb9, 0x74, 0x7f, 0x35, 0xb1,
239 0xd6, 0x58, 0x6a, 0x09, 0x2c, 0x29, 0x0d, 0x69, 0x37, 0xae, 0x17, 0xd2,
240 0x98, 0xef, 0x4a, 0xbd, 0x18, 0x3f, 0x97, 0x83, 0x81, 0x63, 0x8f, 0xc5,
241 0x98, 0x2a, 0xb8, 0xe9, 0x32, 0xef, 0x6b, 0x4c, 0x26, 0xd8, 0x1d, 0x8f,
242 0x5c, 0x68, 0xe0, 0x68, 0x2f, 0x5e, 0x2c, 0x85, 0xa5, 0xbc, 0x88, 0x56,
243 0x1b, 0xc7, 0x0e, 0x22, 0x80, 0x80, 0x36, 0x43, 0x68, 0x5d, 0xd4, 0x0e,
244 0xb5, 0x08, 0x82, 0xfe, 0xae, 0xc5, 0xde, 0x61, 0x1e, 0xf8, 0xfe, 0x64,
245 0x66, 0xf2, 0xda, 0x9e, 0x8e, 0xb9, 0x8e, 0xa9, 0xcd, 0xe4, 0x17, 0xe0,
246 0x12, 0xd4, 0x37, 0x54, 0xd0, 0x24, 0xca, 0xcc, 0xc0, 0xa9, 0xd4, 0x98,
247 0x1d, 0xe9, 0x04, 0x64, 0x50, 0x3d, 0x76, 0x0f, 0xf7, 0x75, 0xde, 0xb5,
248 0x5c, 0x0a, 0x3b, 0x70, 0x3e, 0xeb, 0x0b, 0x26, 0x98, 0x0e, 0x47, 0x6b,
249 0x36, 0x3d, 0x7b, 0x04, 0x20, 0x26, 0xf7, 0xe6, 0x01, 0xbf, 0xda, 0xc9,
250 0x09, 0xce, 0x2f, 0xd9, 0xeb, 0x8a, 0x19, 0x68, 0x9b, 0x67, 0x5d, 0x2a,
251 0xef, 0x74, 0x6f, 0xcd, 0xd2, 0x3b, 0xdc, 0x65, 0xbc, 0x79, 0x40, 0x12,
252 0x52, 0x3e, 0x57, 0xc4, 0x12, 0xf2, 0x4e, 0x1a, 0x5d, 0x63, 0x55, 0x0a,
253 0xb7, 0x70, 0x85, 0x09, 0x6e, 0x97, 0x2f, 0xf8, 0x7b, 0x02, 0xb6, 0x03,
254 0xa3, 0x7d, 0x91, 0x06, 0xb9, 0xf4, 0xfc, 0x45, 0x03, 0x6a, 0xb2, 0xc0,
255 0x8c, 0x75, 0xe3, 0x16, 0x0e, 0xa7, 0x65, 0x9a, 0xd4, 0x05, 0x7e, 0x03,
256 0xe0, 0x42, 0xbd, 0x8f, 0x55, 0xac, 0xf3, 0xde, 0x70, 0x0a, 0xc6, 0xbc,
257 0x0d, 0xda, 0x14, 0x87, 0x3e, 0xa2, 0x18, 0x28, 0xa7, 0x4a, 0xea, 0x21,
258 0x12, 0x70, 0xd3, 0x31, 0xed, 0x22, 0x5e, 0xc6, 0xed, 0xf0, 0xc1, 0xee,
259 0xe6, 0x4b, 0x34, 0x22, 0x97, 0x87, 0x37, 0x24, 0x8f, 0xe4, 0x47, 0x99,
260 0x5d, 0x0a, 0x82, 0xe3, 0xca, 0x88, 0xcf, 0x35, 0xa3, 0xe5, 0xa3, 0xef,
261 0x8b, 0x2c, 0x0a, 0x2c, 0x1f, 0xe4, 0x24, 0xaa, 0xf2, 0x9e, 0x85, 0x28,
262 0xae, 0x60, 0xcc, 0x0a, 0xfc, 0x94, 0x5b, 0x4a, 0xe4, 0x6e, 0xeb, 0x59,
263 0xa3, 0x6f, 0x86, 0xac, 0xc5, 0x2c, 0xf5, 0xaa, 0x10, 0xf4, 0x9e, 0x08,
264 0xc5, 0xbe, 0x8b, 0x9e, 0xe5, 0xd7, 0x6b, 0x49, 0xde, 0x0c, 0x16, 0x38,
265 0x6f, 0xa5, 0x74, 0x62, 0x93, 0x44, 0xd8, 0xf7, 0x6d, 0x40, 0x98, 0xf7,
266 0xfd, 0x6b, 0xc9, 0xda, 0xc7, 0x49, 0xf5, 0x7c, 0x83, 0x9e, 0xc8, 0xe3,
267 0x6e, 0x51, 0x93, 0xfe, 0xb4, 0xe6, 0xa4, 0x2c, 0x18, 0xe8, 0x96, 0xb6,
268 0xb7, 0x11, 0x4d, 0xd4, 0x94, 0x34, 0xfc, 0x4f, 0x2f, 0x17, 0x58, 0x84,
269 0x5a, 0xaa, 0xb7, 0x8f, 0x41, 0x65, 0x7a, 0xac, 0xbc, 0x7d, 0x77, 0x1f,
270 0xf2, 0x99, 0xba, 0x60, 0xe1, 0xe0, 0x24, 0xc0, 0x24, 0x56, 0x08, 0x24,
271 0x39, 0x12, 0xd3, 0xa8, 0xa3, 0x51, 0x37, 0xab, 0xd6, 0xab, 0x78, 0x3c,
272 0x82, 0x91, 0xb8, 0x8e, 0xbf, 0xe6, 0xfd, 0x19, 0x05, 0x60, 0x14, 0xdf,
273 0x19, 0x2f, 0x07, 0x54, 0x11, 0xea, 0x45, 0xec, 0x37, 0xaa, 0x2b, 0x9d,
274 0xa4, 0xfe, 0xd4, 0x34, 0xdf, 0xcc, 0x33, 0xda, 0x09, 0xa9, 0xa9, 0x49,
275 0x10, 0x48, 0xc3, 0x63, 0x49, 0x30, 0x82, 0x02, 0xf9, 0x06, 0x09, 0x2a,
276 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x02, 0xea,
277 0x04, 0x82, 0x02, 0xe6, 0x30, 0x82, 0x02, 0xe2, 0x30, 0x82, 0x02, 0xde,
278 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01,
279 0x02, 0xa0, 0x82, 0x02, 0xa6, 0x30, 0x82, 0x02, 0xa2, 0x30, 0x1c, 0x06,
280 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30,
281 0x0e, 0x04, 0x08, 0x8d, 0xff, 0x52, 0xa2, 0x8e, 0x75, 0xb1, 0x64, 0x02,
282 0x02, 0x08, 0x00, 0x04, 0x82, 0x02, 0x80, 0x57, 0x31, 0xfa, 0x59, 0x1f,
283 0xec, 0x07, 0x6b, 0xcc, 0x29, 0x14, 0x9f, 0xbe, 0x11, 0x4f, 0x1b, 0xb2,
284 0x14, 0x51, 0xca, 0x2e, 0x3c, 0x53, 0xf5, 0x8f, 0xab, 0x90, 0xa0, 0xae,
285 0xf1, 0xa8, 0xd8, 0xc9, 0x51, 0xae, 0x5b, 0x84, 0xc8, 0xfa, 0xfe, 0x54,
286 0x33, 0xf3, 0x02, 0xb2, 0x74, 0x6c, 0x77, 0xcf, 0xe8, 0xdf, 0xab, 0x45,
287 0xaf, 0xb2, 0x1e, 0x18, 0xdd, 0x57, 0xa6, 0x3a, 0xc1, 0xac, 0xab, 0x83,
288 0x48, 0x91, 0x24, 0x06, 0xce, 0x58, 0x69, 0x15, 0x23, 0xf4, 0x19, 0x8f,
289 0x53, 0xd5, 0x92, 0x76, 0x31, 0x35, 0x75, 0xd6, 0x5d, 0xb3, 0x87, 0xe2,
290 0xb3, 0x96, 0x85, 0x30, 0xe0, 0x93, 0xff, 0x02, 0x7b, 0xba, 0x89, 0x50,
291 0xa9, 0xbc, 0x9d, 0x85, 0x20, 0x17, 0x3e, 0x1c, 0xef, 0xcf, 0xf9, 0x69,
292 0xdf, 0x89, 0xe8, 0x11, 0x4b, 0xcc, 0x48, 0x9a, 0x5a, 0x1a, 0x6b, 0x86,
293 0xc4, 0x74, 0xc8, 0x8f, 0x34, 0x0a, 0xbf, 0xec, 0xc8, 0x9d, 0x0f, 0x52,
294 0xd7, 0x0e, 0x39, 0x46, 0x42, 0xf8, 0x8d, 0x14, 0xf5, 0x44, 0x73, 0xb4,
295 0x78, 0x31, 0x89, 0x02, 0xc6, 0x8d, 0xae, 0x2f, 0x9c, 0x7c, 0x7a, 0x5b,
296 0x55, 0x04, 0xe7, 0x81, 0x84, 0x36, 0xee, 0xb8, 0x47, 0x81, 0x65, 0x95,
297 0x8e, 0x35, 0x7f, 0x15, 0xdc, 0xeb, 0xdc, 0x28, 0xe2, 0x16, 0xe8, 0x86,
298 0x1c, 0x7d, 0x1a, 0xd8, 0xe5, 0x8f, 0x4c, 0x29, 0x17, 0x1a, 0x9e, 0xe9,
299 0xc2, 0xd1, 0x84, 0x78, 0x76, 0xd6, 0x93, 0x8c, 0x29, 0x62, 0x3a, 0x2d,
300 0xdd, 0xc6, 0xb4, 0xab, 0x32, 0xd9, 0x18, 0x2a, 0x1d, 0x38, 0x11, 0x48,
301 0x4d, 0x0b, 0xd0, 0x3c, 0xed, 0x51, 0x0f, 0x77, 0x97, 0x67, 0x40, 0x96,
302 0x64, 0x99, 0x34, 0x56, 0xf5, 0x45, 0xe9, 0xfe, 0x87, 0x5b, 0xb2, 0xe9,
303 0x01, 0x1a, 0xfc, 0x83, 0x7e, 0x9f, 0x8b, 0xc9, 0xb2, 0xa9, 0x99, 0x1f,
304 0xb2, 0x32, 0xed, 0xb8, 0x21, 0x00, 0xf5, 0x94, 0x56, 0x15, 0x72, 0xee,
305 0x84, 0x0b, 0x98, 0x9d, 0x9f, 0xc9, 0xf6, 0x4b, 0x65, 0x71, 0xdb, 0xc0,
306 0x49, 0xd8, 0xf8, 0x86, 0x13, 0xc4, 0x23, 0xf7, 0xe3, 0x30, 0xb6, 0x6d,
307 0x2f, 0x72, 0xdb, 0x01, 0x7b, 0x68, 0x46, 0xbe, 0xd6, 0xd5, 0xfe, 0xca,
308 0xc7, 0x87, 0xec, 0x7c, 0xb6, 0x91, 0x27, 0xa4, 0xb5, 0x9f, 0x9d, 0xf7,
309 0xeb, 0x93, 0xce, 0x55, 0xd8, 0x61, 0xcb, 0x2a, 0x45, 0xd4, 0xe6, 0x94,
310 0x9c, 0x06, 0xb3, 0xe3, 0x7b, 0xbc, 0xc8, 0xff, 0xff, 0xbb, 0x29, 0xe8,
311 0x6c, 0xb5, 0x22, 0x64, 0xa4, 0xd4, 0x7e, 0x08, 0x29, 0xae, 0x05, 0xd6,
312 0xf7, 0x88, 0x8b, 0xc4, 0x12, 0x1d, 0xef, 0x38, 0x74, 0x32, 0x8d, 0x2c,
313 0x59, 0x10, 0x5b, 0x9f, 0xac, 0x45, 0x5e, 0xef, 0x62, 0xc3, 0x66, 0x64,
314 0xc4, 0xc7, 0xb3, 0x1d, 0xb1, 0xec, 0x76, 0x90, 0x2f, 0xc8, 0x52, 0x65,
315 0x3c, 0x58, 0x02, 0x01, 0x52, 0x42, 0xbd, 0x38, 0xc4, 0xb1, 0x33, 0x5e,
316 0x9d, 0x6a, 0x19, 0x4f, 0xf1, 0xee, 0x1f, 0x1c, 0x90, 0x40, 0x40, 0x9d,
317 0x41, 0xec, 0x3d, 0xbe, 0xe3, 0x97, 0x70, 0x95, 0x5c, 0x16, 0x66, 0xfd,
318 0xc9, 0xee, 0x29, 0x14, 0x7a, 0x9b, 0x53, 0xa7, 0x8b, 0x4e, 0xf5, 0x3b,
319 0xbe, 0xb4, 0x1b, 0xab, 0x25, 0x5c, 0xcd, 0xac, 0xe0, 0x49, 0xd1, 0xbc,
320 0xcb, 0x1a, 0x8a, 0x7f, 0x62, 0x67, 0xeb, 0xe2, 0x0c, 0x4f, 0x05, 0x0f,
321 0x28, 0xcf, 0xe7, 0x8a, 0x4c, 0x62, 0x16, 0x56, 0x66, 0x83, 0x9e, 0x56,
322 0x13, 0x9d, 0xf5, 0xc4, 0xeb, 0x69, 0xae, 0x64, 0xcd, 0xa0, 0x40, 0x5f,
323 0x61, 0x2d, 0x45, 0xa6, 0x5d, 0x41, 0x88, 0x87, 0xb2, 0x49, 0x30, 0x24,
324 0x95, 0x9d, 0x30, 0x77, 0x36, 0xde, 0x75, 0x54, 0x3b, 0xac, 0xc8, 0x6b,
325 0xf5, 0xed, 0x54, 0xcb, 0xef, 0xa0, 0xc8, 0xdb, 0x1b, 0x80, 0x08, 0x34,
326 0x91, 0xe7, 0x8b, 0xbe, 0x4e, 0x46, 0xed, 0x04, 0x64, 0x51, 0x73, 0xa2,
327 0x6e, 0x52, 0xa2, 0xe4, 0xe3, 0x8a, 0x72, 0x75, 0xf8, 0xb5, 0xc4, 0xa2,
328 0x4a, 0xab, 0xa4, 0x4e, 0xf1, 0x65, 0x29, 0xee, 0xe6, 0x97, 0xb8, 0xeb,
329 0x18, 0x9e, 0x49, 0x08, 0x92, 0x54, 0xc9, 0x20, 0xff, 0xfa, 0xc5, 0x39,
330 0x36, 0xa5, 0xc5, 0xf4, 0x53, 0x91, 0x73, 0x88, 0x94, 0xf1, 0xd9, 0x5a,
331 0x5b, 0xd0, 0x6f, 0x64, 0x9e, 0x32, 0xa6, 0xbf, 0xd2, 0x8e, 0xd7, 0x01,
332 0x53, 0xe2, 0xdd, 0xde, 0xf9, 0x39, 0x4f, 0x53, 0xf0, 0x38, 0x80, 0x87,
333 0xb2, 0x6b, 0x6e, 0x67, 0x5e, 0x6c, 0xcb, 0x21, 0x8b, 0x9a, 0xb3, 0xfc,
334 0x4b, 0x50, 0x71, 0x66, 0xdd, 0x80, 0xa8, 0x0b, 0x76, 0xa7, 0xb6, 0x78,
335 0xce, 0x09, 0x16, 0x88, 0x3f, 0xbb, 0x85, 0xcc, 0x30, 0x78, 0x12, 0x31,
336 0x25, 0x30, 0x23, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
337 0x09, 0x15, 0x31, 0x16, 0x04, 0x14, 0x1e, 0x0f, 0x8e, 0x8c, 0x64, 0x6c,
338 0x43, 0xac, 0xd5, 0x64, 0x2c, 0xab, 0x5f, 0xa8, 0x1b, 0x09, 0x44, 0x00,
339 0x32, 0x8d, 0x30, 0x31, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e,
340 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0x79, 0xb8, 0x38, 0x22, 0x89,
341 0x49, 0xa9, 0x7b, 0xfa, 0x75, 0xb9, 0x92, 0xd7, 0x25, 0xf4, 0x42, 0x17,
342 0x1f, 0xf0, 0x19, 0x04, 0x08, 0x46, 0x09, 0xf3, 0x1a, 0x9a, 0xa5, 0xda,
343 0xb3, 0x02, 0x02, 0x08, 0x00
344 };
345
346
347 unsigned char ECDSA_fails_import_p12[] = {
348 0x30, 0x82, 0x07, 0xf8, 0x02, 0x01, 0x03, 0x30, 0x82, 0x07, 0xbf, 0x06,
349 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82,
350 0x07, 0xb0, 0x04, 0x82, 0x07, 0xac, 0x30, 0x82, 0x07, 0xa8, 0x30, 0x82,
351 0x04, 0xdf, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07,
352 0x06, 0xa0, 0x82, 0x04, 0xd0, 0x30, 0x82, 0x04, 0xcc, 0x02, 0x01, 0x00,
353 0x30, 0x82, 0x04, 0xc5, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
354 0x01, 0x07, 0x01, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
355 0x0d, 0x01, 0x0c, 0x01, 0x06, 0x30, 0x0e, 0x04, 0x08, 0x32, 0xb1, 0x01,
356 0x77, 0xeb, 0x95, 0x02, 0xb9, 0x02, 0x02, 0x08, 0x00, 0x80, 0x82, 0x04,
357 0x98, 0x8f, 0xa0, 0x71, 0x8a, 0x9a, 0x75, 0x78, 0x29, 0x7e, 0xc9, 0x54,
358 0x98, 0xba, 0x58, 0x7f, 0x65, 0x29, 0xb5, 0x9e, 0xb9, 0xc3, 0xfd, 0x9f,
359 0xfc, 0x43, 0x31, 0x08, 0x73, 0x45, 0x03, 0x7d, 0xfc, 0x97, 0x20, 0x8f,
360 0xb1, 0x4c, 0x85, 0xc3, 0xe9, 0xda, 0xf8, 0x73, 0xbc, 0x77, 0xe5, 0xff,
361 0xc7, 0xef, 0x74, 0xc0, 0xb6, 0x18, 0xa9, 0x76, 0x2c, 0x00, 0x2c, 0x00,
362 0x9f, 0xcb, 0x34, 0x16, 0x0b, 0xf0, 0x11, 0x7c, 0xc0, 0x65, 0x1c, 0x69,
363 0x51, 0xbb, 0x92, 0x86, 0xbf, 0x2e, 0xdf, 0x1e, 0x15, 0xad, 0x1f, 0x66,
364 0xdf, 0x5e, 0x9e, 0xb4, 0xf1, 0x9b, 0x86, 0x0d, 0x0f, 0xe6, 0xd2, 0x01,
365 0x91, 0x0e, 0x37, 0x43, 0xba, 0x5a, 0xf3, 0x4e, 0x3c, 0x5d, 0xc7, 0x0d,
366 0x14, 0x38, 0xc3, 0x4a, 0x10, 0x9a, 0x2d, 0xf8, 0x53, 0x2d, 0xfd, 0x00,
367 0xa9, 0x2b, 0xd1, 0x3f, 0xc4, 0xf8, 0x99, 0xb6, 0xaa, 0x1f, 0x70, 0xb4,
368 0x2f, 0xa4, 0xa6, 0x07, 0x1a, 0x95, 0xd1, 0x93, 0xf1, 0xd2, 0xfe, 0x3f,
369 0x7c, 0xb0, 0x55, 0x18, 0xd5, 0x9f, 0x37, 0x11, 0x3d, 0x2d, 0x1f, 0xb8,
370 0xc8, 0x47, 0xa5, 0x03, 0xa5, 0x2e, 0x91, 0x04, 0xe0, 0xd0, 0x15, 0x70,
371 0xa2, 0x05, 0xac, 0x71, 0x4a, 0x09, 0x93, 0xbb, 0x44, 0xeb, 0x78, 0x20,
372 0x7b, 0xbb, 0x0a, 0x2f, 0x0a, 0x51, 0x5c, 0x16, 0x32, 0x37, 0x82, 0x9e,
373 0xc8, 0x90, 0x96, 0xee, 0x9a, 0x4e, 0x77, 0x21, 0xfd, 0x37, 0x80, 0x2f,
374 0x55, 0xf2, 0x03, 0xb1, 0x31, 0x7e, 0x9b, 0x90, 0xa9, 0x7b, 0xb4, 0x19,
375 0x5d, 0x10, 0xfd, 0x22, 0xa5, 0x07, 0x24, 0xc5, 0xda, 0x86, 0x1e, 0xbd,
376 0x4a, 0xa6, 0xc2, 0x02, 0x71, 0xa5, 0x3d, 0xca, 0x5b, 0x19, 0x5d, 0xb6,
377 0xc4, 0x7d, 0xe7, 0x74, 0xf5, 0x71, 0xd5, 0xe5, 0x9f, 0x0a, 0x4a, 0x01,
378 0xa0, 0xe6, 0xa0, 0x73, 0x93, 0xaa, 0x3b, 0x6c, 0x03, 0x4c, 0xbd, 0x32,
379 0xc9, 0x97, 0xaf, 0x84, 0x79, 0x3d, 0x93, 0x49, 0xc6, 0xbc, 0x2a, 0x4f,
380 0xe1, 0x3e, 0x9f, 0x86, 0xe3, 0xd2, 0x16, 0xd3, 0xb3, 0xf6, 0xac, 0x3c,
381 0xb4, 0x6a, 0xa6, 0x68, 0xb8, 0xf4, 0xe7, 0x68, 0x98, 0xe6, 0xf6, 0x76,
382 0x40, 0x64, 0xeb, 0x95, 0xe2, 0xcc, 0x8b, 0x76, 0x4a, 0xab, 0x83, 0xa9,
383 0x84, 0x08, 0xf7, 0x43, 0x92, 0xcb, 0x31, 0xd1, 0x0a, 0x90, 0x8b, 0x98,
384 0x1d, 0x6a, 0x45, 0x7f, 0x83, 0x9b, 0x01, 0x8d, 0xe8, 0x25, 0x9e, 0x55,
385 0xad, 0x27, 0x7e, 0x21, 0xfd, 0x8e, 0xc8, 0x26, 0x1f, 0x43, 0x44, 0x06,
386 0x5f, 0x44, 0xbd, 0x5a, 0xf3, 0x15, 0xac, 0x1a, 0x8f, 0xc7, 0x5a, 0x40,
387 0xa9, 0x93, 0x09, 0xdc, 0xc4, 0xc9, 0xe9, 0x42, 0xf0, 0xe4, 0xda, 0x29,
388 0x90, 0x61, 0x32, 0xcb, 0x05, 0x74, 0x61, 0x71, 0x44, 0xbb, 0x3f, 0x99,
389 0xc3, 0x25, 0x29, 0x8c, 0xa1, 0xe1, 0x92, 0xe6, 0xfd, 0x55, 0x8e, 0x22,
390 0x37, 0x95, 0x08, 0x59, 0xdc, 0xa2, 0x7c, 0xfc, 0x12, 0x9a, 0x5e, 0x1a,
391 0x58, 0x8a, 0x14, 0xa7, 0x96, 0xa2, 0x9e, 0x35, 0xe1, 0x1c, 0x7d, 0xac,
392 0x86, 0x1e, 0xcf, 0x1a, 0x35, 0x7a, 0xf1, 0x31, 0x46, 0x67, 0xbd, 0x81,
393 0x9c, 0xf5, 0x70, 0x9e, 0xaf, 0x0f, 0x84, 0x10, 0xc9, 0x46, 0xce, 0xb6,
394 0xc4, 0x35, 0x88, 0xf0, 0xe1, 0xa6, 0x25, 0xa5, 0xdf, 0x4d, 0x5e, 0x10,
395 0x76, 0x2c, 0xa3, 0x85, 0x42, 0x13, 0xe2, 0x34, 0x57, 0xce, 0x8a, 0x96,
396 0x1f, 0x1b, 0x78, 0x87, 0xd6, 0x4d, 0x66, 0x36, 0x8e, 0x2c, 0xc6, 0x8b,
397 0x0a, 0x53, 0x26, 0x70, 0xa5, 0x7e, 0x7c, 0x7f, 0x94, 0x8b, 0x89, 0x75,
398 0x32, 0x1b, 0x8d, 0x27, 0x6f, 0xb1, 0x64, 0x07, 0xa1, 0xbc, 0x34, 0xe4,
399 0x9b, 0xb7, 0x96, 0x4a, 0x9b, 0x96, 0xea, 0xc1, 0x4c, 0x13, 0xa8, 0x28,
400 0xe3, 0x70, 0xdd, 0x68, 0x2b, 0xf8, 0xd2, 0xe7, 0x1a, 0xec, 0x34, 0xd2,
401 0xce, 0x7c, 0x69, 0xc5, 0xe4, 0xde, 0x98, 0x8d, 0x1d, 0x54, 0x21, 0x12,
402 0x25, 0x2d, 0xff, 0xbf, 0x1c, 0x97, 0x01, 0x25, 0x2b, 0xbe, 0xad, 0x98,
403 0x4a, 0xd3, 0x19, 0x93, 0x9c, 0x03, 0xe6, 0xa4, 0xeb, 0x6c, 0x18, 0x9d,
404 0xae, 0xcc, 0xc4, 0xb8, 0x24, 0x2d, 0xa0, 0xc1, 0x70, 0xa3, 0x5c, 0x2f,
405 0x6e, 0xee, 0x1c, 0x66, 0x67, 0x43, 0xd8, 0x50, 0x23, 0xe8, 0xd9, 0xb8,
406 0x24, 0x98, 0x3a, 0x7d, 0xcf, 0x12, 0x89, 0xae, 0x1a, 0x11, 0x26, 0xa9,
407 0x80, 0xef, 0x08, 0x20, 0xf0, 0x11, 0x95, 0xfc, 0xe8, 0xfc, 0xc3, 0x4a,
408 0x8b, 0x55, 0x2e, 0xf8, 0x93, 0x6c, 0xe1, 0x82, 0xcb, 0x33, 0xe6, 0xfa,
409 0xa1, 0xc2, 0x1d, 0x26, 0xa1, 0x38, 0xc2, 0x12, 0x53, 0x51, 0xa0, 0xbf,
410 0xa9, 0x11, 0x57, 0x18, 0x1a, 0x94, 0x28, 0xe6, 0xf6, 0x71, 0x46, 0x02,
411 0xd9, 0x1e, 0x1c, 0x07, 0xf4, 0x95, 0xb9, 0xfb, 0x30, 0x79, 0xa6, 0x8a,
412 0xe0, 0x0d, 0x35, 0xb6, 0xb4, 0x4f, 0xde, 0x59, 0x35, 0x7c, 0x1a, 0xf9,
413 0xcc, 0x42, 0x40, 0xba, 0x58, 0x07, 0xd6, 0x10, 0x20, 0x7d, 0xa4, 0x49,
414 0x17, 0x4f, 0x03, 0xa6, 0xaf, 0x30, 0xbd, 0x54, 0x6b, 0x2a, 0xc3, 0x65,
415 0x98, 0x71, 0x6c, 0xcc, 0x75, 0x4e, 0xfb, 0x68, 0x14, 0x9d, 0x50, 0xe2,
416 0x4f, 0x93, 0x48, 0x2c, 0xc3, 0x37, 0x6c, 0x7e, 0x6a, 0x87, 0x4f, 0x5a,
417 0x01, 0xcc, 0x17, 0x54, 0xe7, 0xc0, 0x3d, 0xb3, 0xb4, 0x5f, 0xb9, 0xf1,
418 0xcb, 0x5f, 0x9e, 0x48, 0xa2, 0x01, 0x82, 0xb0, 0xd9, 0x01, 0xa8, 0xf9,
419 0xac, 0xbe, 0x44, 0x23, 0xb1, 0x43, 0x85, 0xe6, 0x50, 0x64, 0x80, 0xfc,
420 0x62, 0xbd, 0xda, 0xef, 0x85, 0xb2, 0x70, 0x8a, 0x0d, 0x5a, 0x62, 0xda,
421 0xcc, 0xb3, 0xc1, 0x3a, 0x21, 0xa0, 0x09, 0xfa, 0x64, 0x79, 0xf5, 0xa5,
422 0xb6, 0x52, 0x28, 0xb5, 0x2f, 0xbd, 0x9b, 0x98, 0xae, 0x42, 0x32, 0x15,
423 0xcc, 0x1a, 0x7d, 0xa6, 0xef, 0x4a, 0xf8, 0x09, 0x72, 0x3e, 0xc3, 0x69,
424 0x31, 0x9f, 0x4b, 0x32, 0x73, 0x5f, 0xbf, 0x5f, 0xd5, 0xc3, 0x9f, 0x1e,
425 0xcf, 0x6b, 0x0c, 0xde, 0x32, 0x57, 0x1d, 0x1d, 0xc0, 0xf8, 0xe9, 0x85,
426 0x8e, 0xd0, 0xf4, 0x86, 0xad, 0xfa, 0x51, 0x07, 0xed, 0x1c, 0xb6, 0x60,
427 0x8f, 0xdc, 0x72, 0x61, 0x36, 0x2e, 0x02, 0xf9, 0xe5, 0x3e, 0x14, 0x19,
428 0xa5, 0x30, 0xb6, 0x2a, 0x7e, 0xf9, 0xbc, 0x95, 0x82, 0x0f, 0x1b, 0x61,
429 0xa5, 0xad, 0x50, 0x38, 0xa1, 0xfe, 0xa8, 0xd0, 0x86, 0x69, 0x40, 0xb9,
430 0x82, 0x21, 0xbc, 0x26, 0x9b, 0x87, 0x2f, 0xf6, 0x39, 0x9c, 0x0a, 0x71,
431 0x0d, 0x54, 0x68, 0x78, 0xcc, 0x81, 0xaf, 0x09, 0xd7, 0xa2, 0x1c, 0x7a,
432 0xfb, 0xfb, 0xae, 0xe0, 0x59, 0x23, 0x0b, 0x8a, 0x5a, 0x9c, 0x4c, 0x9d,
433 0x17, 0xfc, 0x52, 0x66, 0x43, 0xbf, 0x06, 0x6c, 0x56, 0x3f, 0xdd, 0x8e,
434 0x33, 0x2e, 0xb8, 0xd7, 0xed, 0x13, 0x44, 0x05, 0x5b, 0xbf, 0x43, 0xc7,
435 0xfd, 0x6e, 0x41, 0xf4, 0xb8, 0xf0, 0x84, 0x73, 0x60, 0xe4, 0x72, 0x24,
436 0x00, 0xec, 0xdf, 0x1b, 0x0d, 0x57, 0x26, 0x04, 0xa0, 0x8c, 0x25, 0x12,
437 0xe0, 0xc6, 0x14, 0x0e, 0x69, 0xc2, 0xc8, 0x43, 0x53, 0xc6, 0x66, 0x50,
438 0x96, 0x29, 0x50, 0x6d, 0xab, 0x02, 0x29, 0xbd, 0x17, 0xda, 0xd4, 0x5b,
439 0xbe, 0xb1, 0xe8, 0x9a, 0x32, 0x3f, 0x39, 0x12, 0x4b, 0x02, 0xb7, 0x8f,
440 0x64, 0xca, 0x24, 0x43, 0x2b, 0xee, 0x04, 0xbb, 0xbd, 0x2b, 0x9f, 0x1c,
441 0x66, 0xe0, 0x6a, 0xa5, 0xd4, 0x0e, 0x3f, 0x5e, 0xad, 0xe5, 0xc4, 0xcd,
442 0x17, 0x71, 0x57, 0x62, 0xe6, 0x7d, 0xe1, 0xc1, 0xd8, 0x3e, 0x38, 0x30,
443 0x31, 0x49, 0xb0, 0x8d, 0x64, 0x80, 0x55, 0x30, 0xc4, 0x38, 0x22, 0xad,
444 0xc7, 0x8f, 0x1a, 0xbd, 0x30, 0xf8, 0x29, 0xcc, 0xdc, 0x16, 0x6e, 0xf4,
445 0x2d, 0xc4, 0x04, 0x49, 0x9a, 0x20, 0xf3, 0x9a, 0xd9, 0xab, 0x31, 0xe4,
446 0xb4, 0x0a, 0xce, 0x4e, 0xff, 0xdd, 0xe0, 0x75, 0x59, 0xe5, 0x40, 0x2d,
447 0xb5, 0xba, 0xae, 0x73, 0x91, 0x32, 0xba, 0x0d, 0xf3, 0x4a, 0x38, 0xa3,
448 0x0c, 0x11, 0xd2, 0x6c, 0x75, 0x80, 0x7a, 0xe4, 0xd5, 0x98, 0x47, 0x05,
449 0x66, 0x6c, 0x2e, 0x9d, 0x96, 0xad, 0x99, 0x30, 0xdf, 0xc2, 0x54, 0x5a,
450 0x4d, 0xc3, 0x21, 0x80, 0x52, 0xb7, 0x21, 0xa8, 0xb3, 0xd6, 0xe6, 0xf2,
451 0xaf, 0xd3, 0x49, 0x3e, 0xff, 0xb2, 0xc2, 0xc9, 0x8b, 0xba, 0x63, 0x6c,
452 0xf8, 0x8c, 0x39, 0x16, 0x52, 0x59, 0x86, 0x20, 0x50, 0x3a, 0xe6, 0x0f,
453 0x41, 0x13, 0x68, 0xe7, 0x0f, 0x16, 0x58, 0x38, 0xff, 0xb6, 0x26, 0x69,
454 0x41, 0x07, 0xeb, 0x21, 0x45, 0xaa, 0xed, 0xae, 0xea, 0xf6, 0xda, 0x00,
455 0x72, 0x30, 0x82, 0x02, 0xc1, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
456 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x02, 0xb2, 0x04, 0x82, 0x02, 0xae,
457 0x30, 0x82, 0x02, 0xaa, 0x30, 0x82, 0x01, 0x51, 0x06, 0x0b, 0x2a, 0x86,
458 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02, 0xa0, 0x81, 0xbc,
459 0x30, 0x81, 0xb9, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
460 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0e, 0x04, 0x08, 0x3a, 0xe1, 0x16,
461 0x95, 0xa1, 0x45, 0x12, 0xa2, 0x02, 0x02, 0x08, 0x00, 0x04, 0x81, 0x98,
462 0x56, 0x4a, 0x5a, 0xd4, 0xf6, 0x2f, 0x5d, 0x91, 0x3d, 0xed, 0x38, 0x21,
463 0x90, 0x2a, 0xe1, 0x2d, 0x6e, 0xb5, 0x1c, 0xd9, 0xb0, 0x88, 0xcf, 0xb9,
464 0xc7, 0x3a, 0x2b, 0x21, 0xc3, 0xf6, 0x51, 0x91, 0x0c, 0xfb, 0x29, 0x84,
465 0xd1, 0x62, 0x5f, 0x75, 0xee, 0xe6, 0xb0, 0x83, 0x4b, 0x9e, 0x55, 0x7b,
466 0xdd, 0xd3, 0x9c, 0x36, 0x1f, 0xe8, 0x0a, 0x23, 0x4e, 0x5d, 0xde, 0x11,
467 0x71, 0x26, 0xfd, 0x8d, 0x5b, 0xa8, 0x9e, 0x19, 0x2d, 0xbc, 0x2c, 0x75,
468 0xfa, 0x0b, 0xa2, 0x4c, 0xe5, 0x07, 0xed, 0x6b, 0x95, 0x3d, 0x75, 0x12,
469 0xb2, 0xec, 0xc5, 0x20, 0x5e, 0xfb, 0x5c, 0x0b, 0x68, 0x35, 0x1f, 0xdf,
470 0xe0, 0xaa, 0xd5, 0x93, 0x27, 0x3e, 0xa2, 0xed, 0x3f, 0x6d, 0x2c, 0xc0,
471 0x6f, 0x55, 0xf0, 0x21, 0xa6, 0xfa, 0x79, 0xce, 0xc5, 0xd6, 0x39, 0xa6,
472 0x04, 0xa8, 0x4a, 0xa6, 0x95, 0xf0, 0x7e, 0xe7, 0x54, 0xee, 0xb2, 0x88,
473 0xe2, 0x66, 0x5c, 0xb8, 0x5d, 0x3b, 0x90, 0x32, 0x6a, 0xfb, 0x3e, 0xa3,
474 0x8b, 0x6b, 0x96, 0xf6, 0x42, 0x55, 0xb3, 0x9f, 0x31, 0x81, 0x82, 0x30,
475 0x5b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x14,
476 0x31, 0x4e, 0x1e, 0x4c, 0x00, 0x4d, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73,
477 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x50, 0x00, 0x72, 0x00, 0x6f,
478 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f,
479 0x00, 0x6e, 0x00, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x53,
480 0x00, 0x69, 0x00, 0x67, 0x00, 0x6e, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67,
481 0x00, 0x49, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69,
482 0x00, 0x74, 0x00, 0x79, 0x00, 0x31, 0x00, 0x00, 0x30, 0x23, 0x06, 0x09,
483 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x15, 0x31, 0x16, 0x04,
484 0x14, 0xf8, 0x15, 0x2d, 0x15, 0x6b, 0x7d, 0x28, 0xe8, 0x23, 0x88, 0xbf,
485 0xba, 0xa2, 0x3a, 0x3e, 0x9a, 0x03, 0xe6, 0xc6, 0x89, 0x30, 0x82, 0x01,
486 0x51, 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a,
487 0x01, 0x02, 0xa0, 0x81, 0xbc, 0x30, 0x81, 0xb9, 0x30, 0x1c, 0x06, 0x0a,
488 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, 0x30, 0x0e,
489 0x04, 0x08, 0xe3, 0xef, 0x16, 0x96, 0x45, 0x16, 0xe5, 0xb3, 0x02, 0x02,
490 0x08, 0x00, 0x04, 0x81, 0x98, 0xf0, 0x1d, 0x35, 0x91, 0xfc, 0x16, 0x43,
491 0xaa, 0x1d, 0xb0, 0x58, 0x12, 0xde, 0x69, 0x92, 0xd0, 0xac, 0x96, 0xbe,
492 0xc7, 0xbb, 0xb8, 0xb2, 0x44, 0x4e, 0x17, 0xd1, 0xb5, 0xfb, 0x36, 0xea,
493 0xd7, 0x06, 0x3a, 0x0e, 0x9a, 0xaa, 0x23, 0xfa, 0x70, 0x51, 0xb9, 0xf9,
494 0x90, 0x78, 0xbc, 0xb3, 0x63, 0x48, 0x8c, 0x84, 0xb2, 0xa2, 0x98, 0xc9,
495 0x71, 0x46, 0x82, 0x42, 0x9f, 0x0f, 0x7b, 0xcc, 0xbe, 0xcc, 0xad, 0x3c,
496 0x30, 0xdb, 0x1d, 0x34, 0xcc, 0x89, 0x91, 0x6b, 0xee, 0x2f, 0x9c, 0x75,
497 0x8b, 0x55, 0xff, 0x2e, 0x0b, 0x1d, 0x71, 0x5e, 0xb1, 0xa2, 0xb2, 0x5e,
498 0x7e, 0x48, 0x37, 0x2f, 0x08, 0x67, 0x91, 0x9a, 0xf1, 0x05, 0x1c, 0x7a,
499 0x7f, 0xee, 0x6f, 0x1e, 0x5b, 0xd9, 0x7c, 0x2d, 0xb8, 0x09, 0x72, 0xb6,
500 0x5a, 0xbf, 0x9a, 0xd7, 0x23, 0x39, 0x6f, 0x1f, 0xf8, 0xd5, 0x72, 0x49,
501 0xea, 0xab, 0x4b, 0xa0, 0xcb, 0xa3, 0xc7, 0xef, 0xb8, 0x8c, 0xda, 0x4c,
502 0x0a, 0x8f, 0xeb, 0x7f, 0x8f, 0x42, 0xd4, 0xad, 0x45, 0x72, 0xda, 0xd9,
503 0xc4, 0x31, 0x81, 0x82, 0x30, 0x5b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
504 0xf7, 0x0d, 0x01, 0x09, 0x14, 0x31, 0x4e, 0x1e, 0x4c, 0x00, 0x4d, 0x00,
505 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00,
506 0x50, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00,
507 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x54, 0x00, 0x65, 0x00,
508 0x73, 0x00, 0x74, 0x00, 0x53, 0x00, 0x69, 0x00, 0x67, 0x00, 0x6e, 0x00,
509 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x49, 0x00, 0x64, 0x00, 0x65, 0x00,
510 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x74, 0x00, 0x79, 0x00, 0x31, 0x00,
511 0x00, 0x30, 0x23, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
512 0x09, 0x15, 0x31, 0x16, 0x04, 0x14, 0xf8, 0x15, 0x2d, 0x15, 0x6b, 0x7d,
513 0x28, 0xe8, 0x23, 0x88, 0xbf, 0xba, 0xa2, 0x3a, 0x3e, 0x9a, 0x03, 0xe6,
514 0xc6, 0x89, 0x30, 0x30, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e,
515 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0x06, 0xfc, 0xc7, 0x98, 0xaf,
516 0x81, 0x75, 0x9f, 0x25, 0x05, 0x0c, 0x6d, 0x78, 0xac, 0x4b, 0x31, 0x23,
517 0x6c, 0x9b, 0x4d, 0x04, 0x08, 0xf5, 0x1e, 0x85, 0xf5, 0x54, 0xf6, 0x09,
518 0x53, 0x02, 0x01, 0x01
519 };
520 unsigned int ECDSA_fails_import_p12_len = 2044;
521
522 unsigned char ECDSA_fails_import_priv_only[] = {
523 0x30, 0x25, 0x02, 0x01, 0x01, 0x04, 0x20, 0x79, 0xf4, 0x38, 0x5c, 0x35,
524 0xe1, 0x97, 0xbf, 0xc7, 0x39, 0xc1, 0x2e, 0x40, 0x52, 0x9f, 0xd1, 0xf0,
525 0x13, 0xa6, 0x94, 0xc5, 0xdc, 0x3b, 0x14, 0x5b, 0x08, 0x11, 0x28, 0xc5,
526 0xb6, 0xc4, 0xd7
527 };
528 unsigned int ECDSA_fails_import_priv_only_len = 39;
529
530 /* P521 certificate with passcode test!123 */
531 unsigned char ec521_host_pfx[] = {
532 0x30, 0x82, 0x05, 0x78, 0x02, 0x01, 0x03, 0x30, 0x82, 0x05, 0x3e, 0x06,
533 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82,
534 0x05, 0x2f, 0x04, 0x82, 0x05, 0x2b, 0x30, 0x82, 0x05, 0x27, 0x30, 0x82,
535 0x03, 0xaf, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07,
536 0x06, 0xa0, 0x82, 0x03, 0xa0, 0x30, 0x82, 0x03, 0x9c, 0x02, 0x01, 0x00,
537 0x30, 0x82, 0x03, 0x95, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
538 0x01, 0x07, 0x01, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7,
539 0x0d, 0x01, 0x0c, 0x01, 0x06, 0x30, 0x0e, 0x04, 0x08, 0x6d, 0x27, 0xf1,
540 0xd2, 0xe2, 0x19, 0xd9, 0xf2, 0x02, 0x02, 0x08, 0x00, 0x80, 0x82, 0x03,
541 0x68, 0x50, 0x87, 0xe5, 0xec, 0x26, 0x69, 0xcd, 0xa8, 0xd8, 0xd7, 0x0f,
542 0x5b, 0x31, 0xc6, 0xfa, 0x0f, 0x3c, 0x62, 0x47, 0x41, 0xbe, 0x13, 0xab,
543 0x0a, 0x53, 0x61, 0xe5, 0x0c, 0x61, 0xc3, 0x0b, 0xd3, 0x64, 0xce, 0xe7,
544 0x0e, 0xa6, 0x34, 0xaa, 0xd6, 0x8d, 0x8e, 0xa8, 0x6f, 0xc1, 0xc5, 0xd5,
545 0x4f, 0xa1, 0x44, 0xfb, 0x64, 0x5f, 0x21, 0xad, 0x80, 0x4f, 0x74, 0x50,
546 0x90, 0x6c, 0x16, 0xeb, 0x0a, 0x98, 0xa1, 0x71, 0x2d, 0x4c, 0x60, 0xf4,
547 0x68, 0x1b, 0x4f, 0x89, 0x74, 0xfb, 0xda, 0xdf, 0x73, 0xf6, 0x09, 0x76,
548 0x34, 0x7c, 0x25, 0x2f, 0x5e, 0xc2, 0x81, 0xdc, 0x35, 0x08, 0x28, 0xb8,
549 0x84, 0x9b, 0x3b, 0x31, 0x52, 0x99, 0x13, 0xf4, 0x79, 0x2d, 0xc5, 0x61,
550 0x7e, 0x8b, 0x55, 0x70, 0x37, 0xf9, 0xc1, 0xc5, 0xa8, 0xc6, 0xd6, 0x4b,
551 0x01, 0xa7, 0x99, 0x4a, 0xe2, 0xcc, 0xa3, 0xa6, 0xea, 0x4b, 0xb2, 0x21,
552 0x08, 0x3b, 0xdf, 0x49, 0xb6, 0x95, 0xcf, 0xca, 0xed, 0xd8, 0x59, 0x8c,
553 0x5d, 0xef, 0xec, 0xe9, 0x7f, 0xc0, 0xca, 0xea, 0x0c, 0xee, 0x22, 0x91,
554 0x35, 0x69, 0x36, 0xa2, 0x1d, 0x77, 0x74, 0xae, 0xc0, 0x96, 0xbe, 0x7d,
555 0x60, 0x96, 0x71, 0xd4, 0x83, 0x29, 0xfc, 0xb2, 0x62, 0x85, 0x1e, 0x18,
556 0x15, 0xa3, 0xf2, 0x97, 0xdb, 0xf5, 0x48, 0xd6, 0x2b, 0xcd, 0x36, 0x3f,
557 0x96, 0x0e, 0xea, 0x3f, 0x4a, 0x2e, 0x13, 0x19, 0xa9, 0xc6, 0x34, 0x03,
558 0xb8, 0x67, 0xd8, 0x39, 0x6b, 0x26, 0xa2, 0x2e, 0x5a, 0x1e, 0x32, 0x8e,
559 0x92, 0xe8, 0x26, 0xd5, 0x41, 0x6a, 0x5f, 0x14, 0x57, 0x7d, 0x6e, 0xc6,
560 0xbd, 0xec, 0xc1, 0x1c, 0x54, 0x86, 0x9a, 0xde, 0x26, 0x71, 0x22, 0xc8,
561 0xa4, 0x48, 0x38, 0x24, 0x5c, 0xd5, 0x45, 0x5a, 0x68, 0x91, 0x1e, 0x7f,
562 0xd8, 0x2f, 0xf2, 0x0f, 0x07, 0x4e, 0xe2, 0xd3, 0xea, 0x57, 0xd1, 0xcc,
563 0xd8, 0x0c, 0x3f, 0x5f, 0xf4, 0x27, 0xd0, 0xc6, 0x5f, 0x78, 0x7d, 0x26,
564 0xc4, 0x0d, 0x33, 0x0f, 0xac, 0xe2, 0xa6, 0xf7, 0x98, 0x08, 0xa5, 0xe7,
565 0x85, 0x95, 0x2d, 0xa8, 0x65, 0x0c, 0x80, 0xfe, 0x44, 0x8c, 0xff, 0x57,
566 0xd3, 0x2d, 0x09, 0xbf, 0x41, 0x93, 0xea, 0x1d, 0xd7, 0xbd, 0xb8, 0xb1,
567 0x9d, 0x08, 0x1e, 0x4f, 0xae, 0x15, 0xf9, 0x2e, 0xfc, 0xfc, 0x2f, 0x0f,
568 0xe1, 0x44, 0xfb, 0xac, 0x02, 0xb9, 0x58, 0x65, 0x6c, 0x7a, 0x96, 0xad,
569 0x98, 0xda, 0xaf, 0xf9, 0x99, 0x22, 0x83, 0xfe, 0x53, 0x1e, 0x96, 0xae,
570 0x5c, 0x89, 0x61, 0x68, 0x46, 0x7b, 0x15, 0x3b, 0x9e, 0xd8, 0xee, 0x29,
571 0xe6, 0x9b, 0xd1, 0x16, 0x9f, 0xcd, 0xf7, 0x09, 0x8c, 0xd5, 0x9e, 0xea,
572 0x6c, 0x63, 0x31, 0x5b, 0xbd, 0x1d, 0x73, 0xca, 0x88, 0x25, 0xa2, 0x74,
573 0x61, 0x78, 0x9a, 0x30, 0x65, 0x1c, 0x8d, 0x8f, 0xb0, 0x33, 0xd6, 0xf4,
574 0x25, 0xa1, 0x84, 0xe8, 0x16, 0x29, 0x74, 0x11, 0x75, 0x67, 0xac, 0xaa,
575 0xd0, 0x26, 0xfd, 0x67, 0xb5, 0x45, 0x4a, 0xc0, 0x73, 0xeb, 0x73, 0x6e,
576 0x73, 0xa1, 0xca, 0x66, 0x45, 0x92, 0xdf, 0x1d, 0xc2, 0xf2, 0x9e, 0x8f,
577 0x7f, 0x0e, 0x24, 0x6a, 0xb3, 0xcf, 0xe8, 0x02, 0xcc, 0xdc, 0x61, 0xd2,
578 0x34, 0x49, 0x3e, 0xb4, 0x15, 0x9a, 0x68, 0x1b, 0xd5, 0x08, 0x83, 0x98,
579 0xe5, 0xae, 0xad, 0xe1, 0x0d, 0x19, 0x24, 0x46, 0xda, 0x4b, 0xa4, 0xf7,
580 0x5f, 0x9c, 0x07, 0xc7, 0x89, 0x90, 0xa8, 0x8d, 0x95, 0x28, 0xdc, 0x47,
581 0xbd, 0x0d, 0x2b, 0x8f, 0x7f, 0xed, 0x20, 0xdd, 0x68, 0xc1, 0x63, 0x3d,
582 0x8d, 0x78, 0x3c, 0xab, 0x91, 0xd3, 0x94, 0x84, 0x4d, 0x4d, 0xf8, 0x56,
583 0xdb, 0x73, 0x73, 0xe3, 0x79, 0xb1, 0xbc, 0x06, 0x98, 0x03, 0x50, 0xb6,
584 0xbc, 0x8f, 0x89, 0x8c, 0xdb, 0x74, 0xa2, 0x55, 0xc8, 0x61, 0xaf, 0x04,
585 0xc7, 0x8b, 0x57, 0xa9, 0x63, 0x60, 0xe5, 0x0b, 0x94, 0x46, 0x15, 0xdb,
586 0xa0, 0x35, 0x2d, 0x69, 0x3f, 0x20, 0x9c, 0x65, 0x1e, 0x63, 0xb2, 0xd2,
587 0xf2, 0x03, 0xf3, 0x49, 0x4b, 0x8c, 0xc1, 0x13, 0x1e, 0x10, 0x31, 0xb5,
588 0xdb, 0xaf, 0xc3, 0x60, 0x18, 0xb1, 0xfd, 0x08, 0x23, 0x47, 0xcc, 0x0b,
589 0x55, 0x7f, 0x92, 0x2b, 0xc2, 0xed, 0xbd, 0x0b, 0x59, 0x24, 0xff, 0x1c,
590 0xdf, 0xd7, 0x50, 0x2b, 0xc1, 0x1e, 0x48, 0xc1, 0xfd, 0x58, 0x79, 0x18,
591 0x11, 0x00, 0x0c, 0xc7, 0x85, 0x00, 0xe9, 0x6d, 0x52, 0x4d, 0xfa, 0x80,
592 0x71, 0x68, 0xc7, 0xa7, 0xd5, 0x9d, 0x25, 0x75, 0x3a, 0x64, 0x95, 0x72,
593 0x5b, 0x8e, 0xad, 0x7b, 0x9b, 0xcb, 0x32, 0x3e, 0xfb, 0xc0, 0x4e, 0x9b,
594 0x17, 0xf7, 0x7e, 0xec, 0xa0, 0x60, 0xbc, 0x5a, 0xed, 0xfb, 0x7e, 0x7b,
595 0x77, 0xa3, 0xdb, 0xba, 0x40, 0x02, 0x45, 0x33, 0xcf, 0x2f, 0xd0, 0x79,
596 0x56, 0x99, 0xc7, 0x1a, 0x58, 0xcd, 0x0e, 0x5a, 0x84, 0x89, 0xce, 0xc0,
597 0x7b, 0xd1, 0x62, 0x6d, 0x11, 0x1d, 0x1f, 0x7a, 0xdf, 0xc8, 0x2d, 0x77,
598 0xb7, 0x61, 0x86, 0x5e, 0xd7, 0x6a, 0xe2, 0xec, 0x88, 0xf7, 0x1a, 0xc4,
599 0x75, 0x09, 0x12, 0xa7, 0x21, 0x2f, 0xee, 0x5d, 0x2a, 0xd6, 0x84, 0xcd,
600 0xf1, 0x2d, 0x2b, 0x11, 0x33, 0xb7, 0xfe, 0x6d, 0x4a, 0xe2, 0x4e, 0x6a,
601 0x5e, 0xc6, 0x25, 0xde, 0x77, 0x98, 0x32, 0x62, 0xd1, 0xd2, 0x89, 0xfe,
602 0xa4, 0x86, 0x65, 0xd9, 0x70, 0x5d, 0x3d, 0xfa, 0x42, 0xcb, 0xec, 0xe3,
603 0xa5, 0x95, 0x6d, 0xa2, 0x66, 0x81, 0x87, 0x0c, 0x90, 0x76, 0x8f, 0xfe,
604 0x55, 0xa9, 0x98, 0x8a, 0xfd, 0xc4, 0xd1, 0xfe, 0x72, 0xbc, 0x31, 0x71,
605 0x8e, 0xd6, 0x87, 0x93, 0x57, 0xc2, 0x62, 0x66, 0x2e, 0x4f, 0xbe, 0x5f,
606 0xc9, 0x22, 0x15, 0x85, 0xd8, 0xaf, 0x75, 0x57, 0x5d, 0xeb, 0xe3, 0x6e,
607 0xe6, 0x69, 0x16, 0x45, 0xb2, 0xab, 0xfc, 0xf4, 0x4b, 0x86, 0x3d, 0x13,
608 0x71, 0x33, 0xfd, 0xe2, 0x29, 0x7f, 0xdc, 0x2c, 0x2f, 0xed, 0xc9, 0x90,
609 0x1e, 0x55, 0x08, 0x91, 0x55, 0x64, 0x8a, 0xc9, 0x6f, 0x33, 0x00, 0x98,
610 0xab, 0x1d, 0xa8, 0xd2, 0x24, 0x2a, 0xaa, 0xd5, 0x20, 0x04, 0x69, 0xec,
611 0x37, 0xb0, 0x44, 0x0c, 0x00, 0x2e, 0x27, 0x2e, 0x8c, 0xab, 0x20, 0x06,
612 0x9d, 0x8a, 0x11, 0x8f, 0x05, 0x54, 0x5f, 0x16, 0x62, 0xb4, 0x8b, 0xec,
613 0x88, 0x6f, 0xb0, 0xf1, 0x4f, 0x90, 0x23, 0x71, 0xfb, 0x30, 0x82, 0x01,
614 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01,
615 0xa0, 0x82, 0x01, 0x61, 0x04, 0x82, 0x01, 0x5d, 0x30, 0x82, 0x01, 0x59,
616 0x30, 0x82, 0x01, 0x55, 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
617 0x01, 0x0c, 0x0a, 0x01, 0x02, 0xa0, 0x82, 0x01, 0x1d, 0x30, 0x82, 0x01,
618 0x19, 0x30, 0x1c, 0x06, 0x0a, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
619 0x0c, 0x01, 0x03, 0x30, 0x0e, 0x04, 0x08, 0xc2, 0xb9, 0xa1, 0x2f, 0x4c,
620 0x19, 0x68, 0x12, 0x02, 0x02, 0x08, 0x00, 0x04, 0x81, 0xf8, 0x34, 0x0f,
621 0x2b, 0x67, 0x09, 0xbf, 0xc4, 0xf9, 0x91, 0x76, 0xe3, 0xf2, 0x0e, 0x23,
622 0x56, 0x57, 0x30, 0x30, 0x7e, 0x1a, 0x60, 0x7a, 0xd3, 0x57, 0x51, 0xf0,
623 0x67, 0x83, 0xde, 0xf0, 0x6b, 0x1a, 0x7c, 0xd9, 0xd4, 0x48, 0xe6, 0xa0,
624 0x7f, 0xde, 0xe3, 0xd4, 0x55, 0xcb, 0x0d, 0xcf, 0x8b, 0x21, 0x0d, 0xfa,
625 0x65, 0xa1, 0xcb, 0x01, 0x6f, 0x81, 0xd4, 0x0d, 0x1c, 0xbd, 0xa6, 0x4b,
626 0xbd, 0x6c, 0xe9, 0xa3, 0x6f, 0xb4, 0x4d, 0x07, 0xc1, 0x19, 0xa3, 0x14,
627 0xcd, 0x39, 0xda, 0xd0, 0xa0, 0x2a, 0x62, 0x19, 0x87, 0xb6, 0x7b, 0xe6,
628 0xd4, 0xd5, 0x7a, 0x70, 0xe8, 0x37, 0x98, 0xb5, 0xfe, 0xe5, 0xcf, 0x7f,
629 0xb1, 0xbe, 0x00, 0x27, 0x83, 0xad, 0xfc, 0x46, 0x64, 0x91, 0xe4, 0x4c,
630 0x6f, 0x91, 0xb8, 0xc4, 0xf4, 0x8d, 0x1b, 0x31, 0xdb, 0x51, 0xba, 0xc5,
631 0x9c, 0xb0, 0x46, 0xf5, 0x33, 0x01, 0xc4, 0xf7, 0x27, 0x1e, 0x46, 0x79,
632 0xa6, 0x76, 0x87, 0x19, 0xa8, 0xb9, 0x06, 0x5a, 0x6f, 0xd4, 0x1b, 0x25,
633 0xd8, 0x75, 0x3e, 0x3a, 0x47, 0xde, 0x56, 0x58, 0xd4, 0xf1, 0x21, 0xe4,
634 0x1b, 0xdc, 0xaa, 0x82, 0x40, 0xf3, 0x50, 0x3a, 0x9c, 0xb3, 0x93, 0x95,
635 0xa7, 0x41, 0xfc, 0x94, 0x41, 0x68, 0x27, 0x20, 0x22, 0x2f, 0x24, 0xb3,
636 0xae, 0x71, 0x65, 0x3b, 0x9b, 0xb2, 0x69, 0x95, 0xbb, 0xf5, 0xb6, 0x89,
637 0x10, 0xfc, 0x0c, 0xba, 0x43, 0x16, 0x28, 0x4a, 0x69, 0x3c, 0x75, 0xdc,
638 0x7f, 0x95, 0x22, 0x00, 0x51, 0xbe, 0x68, 0x07, 0xf6, 0xb4, 0x00, 0x18,
639 0xac, 0x6d, 0x6d, 0xc9, 0xd9, 0x66, 0xa6, 0xe3, 0x08, 0x5b, 0x54, 0x37,
640 0xe0, 0x79, 0xcd, 0xa5, 0x23, 0x1a, 0x9a, 0xdd, 0xf1, 0xdf, 0x97, 0xbf,
641 0xbe, 0xe0, 0x53, 0x80, 0x0e, 0x63, 0x31, 0x25, 0x30, 0x23, 0x06, 0x09,
642 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x15, 0x31, 0x16, 0x04,
643 0x14, 0x11, 0xda, 0xbc, 0x66, 0xab, 0x86, 0x80, 0xe5, 0x49, 0x74, 0x47,
644 0xda, 0x5a, 0x84, 0x31, 0x69, 0x0a, 0x49, 0xa3, 0x66, 0x30, 0x31, 0x30,
645 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00,
646 0x04, 0x14, 0xa5, 0x4e, 0x8d, 0x67, 0x01, 0x9f, 0x1b, 0x55, 0x63, 0x54,
647 0xa7, 0x09, 0x7c, 0x1a, 0x76, 0x48, 0xcd, 0x14, 0x84, 0xc8, 0x04, 0x08,
648 0xbd, 0x08, 0x86, 0x2c, 0xe9, 0x77, 0xab, 0xaf, 0x02, 0x02, 0x08, 0x00
649 };
650
651
652 static void tests(void)
653 {
654 CFDataRef message = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
655 _user_one_p12, sizeof(_user_one_p12), kCFAllocatorNull);
656 CFArrayRef items = NULL;
657 SecCertificateRef cert = NULL;
658 SecKeyRef pkey = NULL;
659
660 #pragma clang diagnostic push
661 #pragma clang diagnostic ignored "-Wnonnull"
662 // Disable compile-time nullability checks, otherwise the code below won't compile.
663 is_status(SecPKCS12Import(message, NULL, NULL), errSecAuthFailed,
664 "try null password on a known good p12");
665 #pragma clang diagnostic pop
666
667 CFStringRef password = CFSTR("user-one");
668 CFDictionaryRef options = CFDictionaryCreate(NULL,
669 (const void **)&kSecImportExportPassphrase,
670 (const void **)&password, 1,
671 &kCFTypeDictionaryKeyCallBacks,
672 &kCFTypeDictionaryValueCallBacks);
673 ok_status(SecPKCS12Import(message, options, &items), "import user one");
674
675 is(CFArrayGetCount(items), 1, "one identity");
676 CFDictionaryRef item = CFArrayGetValueAtIndex(items, 0);
677 SecIdentityRef identity = NULL;
678 ok(identity = (SecIdentityRef)CFDictionaryGetValue(item, kSecImportItemIdentity), "pull identity from imported data");
679
680 ok(CFGetTypeID(identity)==SecIdentityGetTypeID(),"this is a SecIdentityRef");
681 ok_status(SecIdentityCopyPrivateKey(identity, &pkey),"get private key");
682 ok_status(SecIdentityCopyCertificate(identity, &cert), "get certificate");
683
684 CFReleaseNull(items);
685 CFReleaseNull(message);
686 CFReleaseNull(options);
687 CFReleaseNull(password);
688 CFReleaseNull(cert);
689 CFReleaseNull(pkey);
690
691 message = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
692 _user_two_p12, sizeof(_user_two_p12), kCFAllocatorNull);
693 items = NULL;
694 password = CFSTR("user-two");
695 options = CFDictionaryCreate(NULL,
696 (const void **)&kSecImportExportPassphrase,
697 (const void **)&password, 1,
698 &kCFTypeDictionaryKeyCallBacks,
699 &kCFTypeDictionaryValueCallBacks);
700
701 ok_status(SecPKCS12Import(message, options, &items), "import user two");
702 is(CFArrayGetCount(items), 1, "one identity");
703 item = CFArrayGetValueAtIndex(items, 0);
704 ok(identity = (SecIdentityRef)CFDictionaryGetValue(item, kSecImportItemIdentity), "pull identity from imported data");
705
706 ok(CFGetTypeID(identity)==SecIdentityGetTypeID(),"this is a SecIdentityRef");
707 ok_status(SecIdentityCopyPrivateKey(identity, &pkey),"get private key");
708 ok_status(SecIdentityCopyCertificate(identity, &cert), "get certificate");
709
710 CFReleaseNull(items);
711 CFReleaseNull(message);
712 CFReleaseNull(options);
713 CFReleaseNull(password);
714 CFReleaseNull(cert);
715 CFReleaseNull(pkey);
716
717
718
719 message = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
720 ECDSA_fails_import_p12, ECDSA_fails_import_p12_len, kCFAllocatorNull);
721 items = NULL;
722 password = CFSTR("test");
723 options = CFDictionaryCreate(NULL,
724 (const void **)&kSecImportExportPassphrase,
725 (const void **)&password, 1,
726 &kCFTypeDictionaryKeyCallBacks,
727 &kCFTypeDictionaryValueCallBacks);
728
729 ok_status(SecPKCS12Import(message, options, &items), "import ECDSA_fails_import_p12");
730 is(CFArrayGetCount(items), 1, "one identity");
731 item = CFArrayGetValueAtIndex(items, 0);
732 ok(identity = (SecIdentityRef)CFDictionaryGetValue(item, kSecImportItemIdentity), "pull identity from imported data");
733
734 ok(CFGetTypeID(identity)==SecIdentityGetTypeID(),"this is a SecIdentityRef");
735 ok_status(SecIdentityCopyPrivateKey(identity, &pkey),"get private key");
736 ok_status(SecIdentityCopyCertificate(identity, &cert), "get certificate");
737
738 CFDataRef pubdata = NULL;
739 SecKeyRef pubkey = NULL;
740
741 ok_status(SecKeyCopyPublicBytes(pkey, &pubdata), "pub key from priv key");
742 ok(pubkey = SecKeyCreateECPublicKey(kCFAllocatorDefault,
743 CFDataGetBytePtr(pubdata), CFDataGetLength(pubdata), kSecKeyEncodingBytes),
744 "recreate seckey");
745
746 /* Sign something. */
747 uint8_t something[20] = {0x80, 0xbe, 0xef, 0xba, 0xd0, };
748 size_t sigLen = SecKeyGetSize(pkey, kSecKeySignatureSize);
749 uint8_t sig[sigLen];
750 ok_status(SecKeyRawSign(pkey, kSecPaddingPKCS1,
751 something, sizeof(something), sig, &sigLen), "sign something");
752 ok_status(SecKeyRawVerify(pubkey, kSecPaddingPKCS1,
753 something, sizeof(something), sig, sigLen), "verify sig on something");
754
755
756 CFReleaseNull(pubdata);
757 CFReleaseNull(pubkey);
758 CFReleaseNull(pkey);
759
760 ok(pkey = SecKeyCreateECPrivateKey(kCFAllocatorDefault,
761 ECDSA_fails_import_priv_only, ECDSA_fails_import_priv_only_len,
762 kSecKeyEncodingPkcs1), "import privkey without pub");
763 ok_status(SecKeyCopyPublicBytes(pkey, &pubdata), "pub key from priv key");
764 ok(pubkey = SecKeyCreateECPublicKey(kCFAllocatorDefault,
765 CFDataGetBytePtr(pubdata), CFDataGetLength(pubdata), kSecKeyEncodingBytes),
766 "recreate seckey");
767 ok_status(SecKeyRawVerify(pubkey, kSecPaddingPKCS1,
768 something, sizeof(something), sig, sigLen), "verify sig on something");
769
770 CFReleaseNull(pubdata);
771 CFReleaseNull(pubkey);
772 CFReleaseNull(pkey);
773 CFReleaseNull(items);
774 CFReleaseNull(message);
775 CFReleaseNull(options);
776 CFReleaseNull(password);
777 CFReleaseNull(cert);
778
779 /* P521 test */
780 CFDataRef cert_p521_p12 = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
781 ec521_host_pfx, sizeof(ec521_host_pfx), kCFAllocatorNull);
782 CFStringRef password_p521 = CFSTR("test!123");
783 CFDictionaryRef options_p521 = CFDictionaryCreate(NULL,
784 (const void **)&kSecImportExportPassphrase,
785 (const void **)&password_p521, 1,
786 &kCFTypeDictionaryKeyCallBacks,
787 &kCFTypeDictionaryValueCallBacks);
788 ok_status(SecPKCS12Import(cert_p521_p12, options_p521, &items), "Import p512 PKCS12 cert");
789 is(CFArrayGetCount(items), 1, "one identity");
790 CFReleaseNull(items);
791 CFReleaseNull(cert_p521_p12);
792 CFReleaseNull(password_p521);
793 CFReleaseNull(options_p521);
794 }
795
796 int si_61_pkcs12(int argc, char *const *argv)
797 {
798 plan_tests(29);
799
800 tests();
801
802 return 0;
803 }