3 stcompat.h -- SecureTransport compatibility header
4 Copyright (C) 2014 Kyle J. McKay. All rights reserved.
6 If this software is included as part of a build of
7 the cURL library, it may be used under the same license
8 terms as the cURL library.
10 Otherwise the GPLv2 license applies.
12 This software is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 #include <TargetConditionals.h>
22 #include <AvailabilityMacros.h>
23 #include <CoreFoundation/CoreFoundation.h>
27 #define unimpErr -4 /* from MacErrors.h */
29 #define ioErr -36 /* from MacErrors.h */
31 #define paramErr -50 /* from MacErrors.h */
33 #ifndef TARGET_OS_EMBEDDED
34 #define TARGET_OS_EMBEDDED 0
36 #ifndef TARGET_OS_IPHONE
37 #define TARGET_OS_IPHONE 0
40 /* Some missing error defines */
41 #undef errSSLServerAuthCompleted
42 #define errSSLServerAuthCompleted -9841 /* original name */
43 #undef errSSLClientAuthCompleted
44 #define errSSLClientAuthCompleted -9841 /* added alias */
45 #undef errSSLPeerAuthCompleted
46 #define errSSLPeerAuthCompleted -9841 /* new name */
47 #undef errSSLClientCertRequested
48 #define errSSLClientCertRequested -9842
50 /* Some missing session option defines */
51 #undef kSSLSessionOptionBreakOnServerAuth
52 #define kSSLSessionOptionBreakOnServerAuth 0
53 #undef kSSLSessionOptionBreakOnCertRequested
54 #define kSSLSessionOptionBreakOnCertRequested 1
55 #undef kSSLSessionOptionBreakOnClientAuth
56 #define kSSLSessionOptionBreakOnClientAuth 2
57 #undef kSSLSessionOptionFalseStart
58 #define kSSLSessionOptionFalseStart 3
59 #undef kSSLSessionOptionSendOneByteRecord
60 #define kSSLSessionOptionSendOneByteRecord 4
61 #undef kSSLSessionOptionAllowServerIdentityChange
62 #define kSSLSessionOptionAllowServerIdentityChange 5
64 /* The entire known cipher suite list */
65 #undef SSL_NULL_WITH_NULL_NULL
66 #define SSL_NULL_WITH_NULL_NULL 0x0000
67 #undef TLS_NULL_WITH_NULL_NULL
68 #define TLS_NULL_WITH_NULL_NULL 0x0000
69 #undef SSL_RSA_WITH_NULL_MD5
70 #define SSL_RSA_WITH_NULL_MD5 0x0001
71 #undef TLS_RSA_WITH_NULL_MD5
72 #define TLS_RSA_WITH_NULL_MD5 0x0001
73 #undef SSL_RSA_WITH_NULL_SHA
74 #define SSL_RSA_WITH_NULL_SHA 0x0002
75 #undef TLS_RSA_WITH_NULL_SHA
76 #define TLS_RSA_WITH_NULL_SHA 0x0002
77 #undef SSL_RSA_EXPORT_WITH_RC4_40_MD5
78 #define SSL_RSA_EXPORT_WITH_RC4_40_MD5 0x0003
79 #undef SSL_RSA_WITH_RC4_128_MD5
80 #define SSL_RSA_WITH_RC4_128_MD5 0x0004
81 #undef TLS_RSA_WITH_RC4_128_MD5
82 #define TLS_RSA_WITH_RC4_128_MD5 0x0004
83 #undef SSL_RSA_WITH_RC4_128_SHA
84 #define SSL_RSA_WITH_RC4_128_SHA 0x0005
85 #undef TLS_RSA_WITH_RC4_128_SHA
86 #define TLS_RSA_WITH_RC4_128_SHA 0x0005
87 #undef SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
88 #define SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 0x0006
89 #undef SSL_RSA_WITH_IDEA_CBC_SHA
90 #define SSL_RSA_WITH_IDEA_CBC_SHA 0x0007
91 #undef SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
92 #define SSL_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0008
93 #undef SSL_RSA_WITH_DES_CBC_SHA
94 #define SSL_RSA_WITH_DES_CBC_SHA 0x0009
95 #undef SSL_RSA_WITH_3DES_EDE_CBC_SHA
96 #define SSL_RSA_WITH_3DES_EDE_CBC_SHA 0x000A
97 #undef TLS_RSA_WITH_3DES_EDE_CBC_SHA
98 #define TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x000A
99 #undef SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
100 #define SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA 0x000B
101 #undef SSL_DH_DSS_WITH_DES_CBC_SHA
102 #define SSL_DH_DSS_WITH_DES_CBC_SHA 0x000C
103 #undef SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA
104 #define SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA 0x000D
105 #undef TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA
106 #define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA 0x000D
107 #undef SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
108 #define SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA 0x000E
109 #undef SSL_DH_RSA_WITH_DES_CBC_SHA
110 #define SSL_DH_RSA_WITH_DES_CBC_SHA 0x000F
111 #undef SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA
112 #define SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA 0x0010
113 #undef TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA
114 #define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA 0x0010
115 #undef SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
116 #define SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA 0x0011
117 #undef SSL_DHE_DSS_WITH_DES_CBC_SHA
118 #define SSL_DHE_DSS_WITH_DES_CBC_SHA 0x0012
119 #undef SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
120 #define SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013
121 #undef TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
122 #define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013
123 #undef SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
124 #define SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0014
125 #undef SSL_DHE_RSA_WITH_DES_CBC_SHA
126 #define SSL_DHE_RSA_WITH_DES_CBC_SHA 0x0015
127 #undef SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
128 #define SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016
129 #undef TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
130 #define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016
131 #undef SSL_DH_anon_EXPORT_WITH_RC4_40_MD5
132 #define SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 0x0017
133 #undef SSL_DH_anon_WITH_RC4_128_MD5
134 #define SSL_DH_anon_WITH_RC4_128_MD5 0x0018
135 #undef TLS_DH_anon_WITH_RC4_128_MD5
136 #define TLS_DH_anon_WITH_RC4_128_MD5 0x0018
137 #undef SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
138 #define SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA 0x0019
139 #undef SSL_DH_anon_WITH_DES_CBC_SHA
140 #define SSL_DH_anon_WITH_DES_CBC_SHA 0x001A
141 #undef SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
142 #define SSL_DH_anon_WITH_3DES_EDE_CBC_SHA 0x001B
143 #undef TLS_DH_anon_WITH_3DES_EDE_CBC_SHA
144 #define TLS_DH_anon_WITH_3DES_EDE_CBC_SHA 0x001B
145 #undef SSL_FORTEZZA_DMS_WITH_NULL_SHA
146 #define SSL_FORTEZZA_DMS_WITH_NULL_SHA 0x001C
147 #undef SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA
148 #define SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA 0x001D
149 #undef TLS_PSK_WITH_NULL_SHA
150 #define TLS_PSK_WITH_NULL_SHA 0x002C
151 #undef TLS_DHE_PSK_WITH_NULL_SHA
152 #define TLS_DHE_PSK_WITH_NULL_SHA 0x002D
153 #undef TLS_RSA_PSK_WITH_NULL_SHA
154 #define TLS_RSA_PSK_WITH_NULL_SHA 0x002E
155 #undef TLS_RSA_WITH_AES_128_CBC_SHA
156 #define TLS_RSA_WITH_AES_128_CBC_SHA 0x002F
157 #undef TLS_DH_DSS_WITH_AES_128_CBC_SHA
158 #define TLS_DH_DSS_WITH_AES_128_CBC_SHA 0x0030
159 #undef TLS_DH_RSA_WITH_AES_128_CBC_SHA
160 #define TLS_DH_RSA_WITH_AES_128_CBC_SHA 0x0031
161 #undef TLS_DHE_DSS_WITH_AES_128_CBC_SHA
162 #define TLS_DHE_DSS_WITH_AES_128_CBC_SHA 0x0032
163 #undef TLS_DHE_RSA_WITH_AES_128_CBC_SHA
164 #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x0033
165 #undef TLS_DH_anon_WITH_AES_128_CBC_SHA
166 #define TLS_DH_anon_WITH_AES_128_CBC_SHA 0x0034
167 #undef TLS_RSA_WITH_AES_256_CBC_SHA
168 #define TLS_RSA_WITH_AES_256_CBC_SHA 0x0035
169 #undef TLS_DH_DSS_WITH_AES_256_CBC_SHA
170 #define TLS_DH_DSS_WITH_AES_256_CBC_SHA 0x0036
171 #undef TLS_DH_RSA_WITH_AES_256_CBC_SHA
172 #define TLS_DH_RSA_WITH_AES_256_CBC_SHA 0x0037
173 #undef TLS_DHE_DSS_WITH_AES_256_CBC_SHA
174 #define TLS_DHE_DSS_WITH_AES_256_CBC_SHA 0x0038
175 #undef TLS_DHE_RSA_WITH_AES_256_CBC_SHA
176 #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x0039
177 #undef TLS_DH_anon_WITH_AES_256_CBC_SHA
178 #define TLS_DH_anon_WITH_AES_256_CBC_SHA 0x003A
179 #undef TLS_RSA_WITH_NULL_SHA256
180 #define TLS_RSA_WITH_NULL_SHA256 0x003B
181 #undef TLS_RSA_WITH_AES_128_CBC_SHA256
182 #define TLS_RSA_WITH_AES_128_CBC_SHA256 0x003C
183 #undef TLS_RSA_WITH_AES_256_CBC_SHA256
184 #define TLS_RSA_WITH_AES_256_CBC_SHA256 0x003D
185 #undef TLS_DH_DSS_WITH_AES_128_CBC_SHA256
186 #define TLS_DH_DSS_WITH_AES_128_CBC_SHA256 0x003E
187 #undef TLS_DH_RSA_WITH_AES_128_CBC_SHA256
188 #define TLS_DH_RSA_WITH_AES_128_CBC_SHA256 0x003F
189 #undef TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
190 #define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 0x0040
191 #undef TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
192 #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x0067
193 #undef TLS_DH_DSS_WITH_AES_256_CBC_SHA256
194 #define TLS_DH_DSS_WITH_AES_256_CBC_SHA256 0x0068
195 #undef TLS_DH_RSA_WITH_AES_256_CBC_SHA256
196 #define TLS_DH_RSA_WITH_AES_256_CBC_SHA256 0x0069
197 #undef TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
198 #define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 0x006A
199 #undef TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
200 #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x006B
201 #undef TLS_DH_anon_WITH_AES_128_CBC_SHA256
202 #define TLS_DH_anon_WITH_AES_128_CBC_SHA256 0x006C
203 #undef TLS_DH_anon_WITH_AES_256_CBC_SHA256
204 #define TLS_DH_anon_WITH_AES_256_CBC_SHA256 0x006D
205 #undef TLS_PSK_WITH_RC4_128_SHA
206 #define TLS_PSK_WITH_RC4_128_SHA 0x008A
207 #undef TLS_PSK_WITH_3DES_EDE_CBC_SHA
208 #define TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x008B
209 #undef TLS_PSK_WITH_AES_128_CBC_SHA
210 #define TLS_PSK_WITH_AES_128_CBC_SHA 0x008C
211 #undef TLS_PSK_WITH_AES_256_CBC_SHA
212 #define TLS_PSK_WITH_AES_256_CBC_SHA 0x008D
213 #undef TLS_DHE_PSK_WITH_RC4_128_SHA
214 #define TLS_DHE_PSK_WITH_RC4_128_SHA 0x008E
215 #undef TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
216 #define TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x008F
217 #undef TLS_DHE_PSK_WITH_AES_128_CBC_SHA
218 #define TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x0090
219 #undef TLS_DHE_PSK_WITH_AES_256_CBC_SHA
220 #define TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x0091
221 #undef TLS_RSA_PSK_WITH_RC4_128_SHA
222 #define TLS_RSA_PSK_WITH_RC4_128_SHA 0x0092
223 #undef TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
224 #define TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x0093
225 #undef TLS_RSA_PSK_WITH_AES_128_CBC_SHA
226 #define TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x0094
227 #undef TLS_RSA_PSK_WITH_AES_256_CBC_SHA
228 #define TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x0095
229 #undef TLS_RSA_WITH_AES_128_GCM_SHA256
230 #define TLS_RSA_WITH_AES_128_GCM_SHA256 0x009C
231 #undef TLS_RSA_WITH_AES_256_GCM_SHA384
232 #define TLS_RSA_WITH_AES_256_GCM_SHA384 0x009D
233 #undef TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
234 #define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x009E
235 #undef TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
236 #define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x009F
237 #undef TLS_DH_RSA_WITH_AES_128_GCM_SHA256
238 #define TLS_DH_RSA_WITH_AES_128_GCM_SHA256 0x00A0
239 #undef TLS_DH_RSA_WITH_AES_256_GCM_SHA384
240 #define TLS_DH_RSA_WITH_AES_256_GCM_SHA384 0x00A1
241 #undef TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
242 #define TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 0x00A2
243 #undef TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
244 #define TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 0x00A3
245 #undef TLS_DH_DSS_WITH_AES_128_GCM_SHA256
246 #define TLS_DH_DSS_WITH_AES_128_GCM_SHA256 0x00A4
247 #undef TLS_DH_DSS_WITH_AES_256_GCM_SHA384
248 #define TLS_DH_DSS_WITH_AES_256_GCM_SHA384 0x00A5
249 #undef TLS_DH_anon_WITH_AES_128_GCM_SHA256
250 #define TLS_DH_anon_WITH_AES_128_GCM_SHA256 0x00A6
251 #undef TLS_DH_anon_WITH_AES_256_GCM_SHA384
252 #define TLS_DH_anon_WITH_AES_256_GCM_SHA384 0x00A7
253 #undef TLS_PSK_WITH_AES_128_GCM_SHA256
254 #define TLS_PSK_WITH_AES_128_GCM_SHA256 0x00A8
255 #undef TLS_PSK_WITH_AES_256_GCM_SHA384
256 #define TLS_PSK_WITH_AES_256_GCM_SHA384 0x00A9
257 #undef TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
258 #define TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0x00AA
259 #undef TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
260 #define TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0x00AB
261 #undef TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
262 #define TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0x00AC
263 #undef TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
264 #define TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0x00AD
265 #undef TLS_PSK_WITH_AES_128_CBC_SHA256
266 #define TLS_PSK_WITH_AES_128_CBC_SHA256 0x00AE
267 #undef TLS_PSK_WITH_AES_256_CBC_SHA384
268 #define TLS_PSK_WITH_AES_256_CBC_SHA384 0x00AF
269 #undef TLS_PSK_WITH_NULL_SHA256
270 #define TLS_PSK_WITH_NULL_SHA256 0x00B0
271 #undef TLS_PSK_WITH_NULL_SHA384
272 #define TLS_PSK_WITH_NULL_SHA384 0x00B1
273 #undef TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
274 #define TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0x00B2
275 #undef TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
276 #define TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0x00B3
277 #undef TLS_DHE_PSK_WITH_NULL_SHA256
278 #define TLS_DHE_PSK_WITH_NULL_SHA256 0x00B4
279 #undef TLS_DHE_PSK_WITH_NULL_SHA384
280 #define TLS_DHE_PSK_WITH_NULL_SHA384 0x00B5
281 #undef TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
282 #define TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0x00B6
283 #undef TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
284 #define TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0x00B7
285 #undef TLS_RSA_PSK_WITH_NULL_SHA256
286 #define TLS_RSA_PSK_WITH_NULL_SHA256 0x00B8
287 #undef TLS_RSA_PSK_WITH_NULL_SHA384
288 #define TLS_RSA_PSK_WITH_NULL_SHA384 0x00B9
289 #undef TLS_EMPTY_RENEGOTIATION_INFO_SCSV
290 #define TLS_EMPTY_RENEGOTIATION_INFO_SCSV 0x00FF
291 #undef TLS_ECDH_ECDSA_WITH_NULL_SHA
292 #define TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001
293 #undef TLS_ECDH_ECDSA_WITH_RC4_128_SHA
294 #define TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002
295 #undef TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
296 #define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003
297 #undef TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
298 #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004
299 #undef TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
300 #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005
301 #undef TLS_ECDHE_ECDSA_WITH_NULL_SHA
302 #define TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006
303 #undef TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
304 #define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007
305 #undef TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
306 #define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008
307 #undef TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
308 #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009
309 #undef TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
310 #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A
311 #undef TLS_ECDH_RSA_WITH_NULL_SHA
312 #define TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B
313 #undef TLS_ECDH_RSA_WITH_RC4_128_SHA
314 #define TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C
315 #undef TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
316 #define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D
317 #undef TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
318 #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E
319 #undef TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
320 #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F
321 #undef TLS_ECDHE_RSA_WITH_NULL_SHA
322 #define TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010
323 #undef TLS_ECDHE_RSA_WITH_RC4_128_SHA
324 #define TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011
325 #undef TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
326 #define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012
327 #undef TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
328 #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013
329 #undef TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
330 #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014
331 #undef TLS_ECDH_anon_WITH_NULL_SHA
332 #define TLS_ECDH_anon_WITH_NULL_SHA 0xC015
333 #undef TLS_ECDH_anon_WITH_RC4_128_SHA
334 #define TLS_ECDH_anon_WITH_RC4_128_SHA 0xC016
335 #undef TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
336 #define TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA 0xC017
337 #undef TLS_ECDH_anon_WITH_AES_128_CBC_SHA
338 #define TLS_ECDH_anon_WITH_AES_128_CBC_SHA 0xC018
339 #undef TLS_ECDH_anon_WITH_AES_256_CBC_SHA
340 #define TLS_ECDH_anon_WITH_AES_256_CBC_SHA 0xC019
341 #undef TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
342 #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023
343 #undef TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
344 #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024
345 #undef TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
346 #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025
347 #undef TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
348 #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026
349 #undef TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
350 #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027
351 #undef TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
352 #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028
353 #undef TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
354 #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029
355 #undef TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
356 #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A
357 #undef TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
358 #define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B
359 #undef TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
360 #define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C
361 #undef TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
362 #define TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D
363 #undef TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
364 #define TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E
365 #undef TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
366 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F
367 #undef TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
368 #define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030
369 #undef TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
370 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031
371 #undef TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
372 #define TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032
373 #undef SSL_RSA_WITH_RC2_CBC_MD5
374 #define SSL_RSA_WITH_RC2_CBC_MD5 0xFF80
375 #undef SSL_RSA_WITH_IDEA_CBC_MD5
376 #define SSL_RSA_WITH_IDEA_CBC_MD5 0xFF81
377 #undef SSL_RSA_WITH_DES_CBC_MD5
378 #define SSL_RSA_WITH_DES_CBC_MD5 0xFF82
379 #undef SSL_RSA_WITH_3DES_EDE_CBC_MD5
380 #define SSL_RSA_WITH_3DES_EDE_CBC_MD5 0xFF83
381 #undef SSL_NO_SUCH_CIPHERSUITE
382 #define SSL_NO_SUCH_CIPHERSUITE 0xFFFF
384 #undef kTLSProtocol11
385 #define kTLSProtocol11 7
386 #undef kTLSProtocol12
387 #define kTLSProtocol12 8
388 #undef kDTLSProtocol1
389 #define kDTLSProtocol1 9
391 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
393 #undef kSSLServerSide
394 #define kSSLServerSide 0
395 #undef kSSLClientSide
396 #define kSSLClientSide 1
398 #undef kSSLStreamType
399 #define kSSLStreamType 0
400 #undef kSSLDatagramType
401 #define kSSLDatagramType 1
403 #undef SecItemImportExportKeyParameters
406 SecKeyImportExportFlags flags
;
407 CFTypeRef passphrase
;
408 CFStringRef alertTitle
;
409 CFStringRef alertPrompt
;
410 SecAccessRef accessRef
;
412 CFArrayRef keyAttributes
;
413 } cSecItemImportExportKeyParameters
;
414 #define SecItemImportExportKeyParameters cSecItemImportExportKeyParameters
416 typedef void (*errinfo_func_t
)(void *, const char *, ...);
423 CFDataRef
CFDataCreateWithContentsOfFile(CFAllocatorRef a
, const char *f
);
424 CFArrayRef
CreateCertsArrayWithData(CFDataRef d
, const errinfo_t
*e
);
425 Boolean
CheckCertOkay(SecCertificateRef cert
);
427 OSStatus
cSSLSetSessionOption(SSLContextRef cxt
, int option
, Boolean value
);
428 SecCertificateRef
cSecCertificateCreateWithData(CFAllocatorRef a
, CFDataRef d
);
429 OSStatus
cSecIdentityCreateWithCertificate(CFTypeRef k
, SecCertificateRef c
,
431 SecIdentityRef
cSecIdentityCreateWithCertificateAndKeyData(
432 SecCertificateRef certificateRef
, CFDataRef keydata
, CFTypeRef pw
, void **kh
);
433 CFStringRef
CopyCertSubject(SecCertificateRef cert
);
434 OSStatus
CopyIdentityWithLabel(const char *label
, SecIdentityRef
*out
);
435 CFArrayRef
CreateClientAuthWithCertificatesAndKeyData(CFArrayRef certs
,
436 CFDataRef keydata
, CFTypeRef pw
, void **kh
);
437 void DisposeIdentityKeychainHandle(void *);
438 OSStatus
cSecItemImport(
439 CFDataRef importedData
, CFStringRef fileNameOrExtension
,
440 SecExternalFormat
*inputFormat
, SecExternalItemType
*itemType
,
441 SecItemImportExportFlags flags
, const SecItemImportExportKeyParameters
*keyParams
,
442 SecKeychainRef importKeychain
, CFArrayRef
*outItems
);
443 SSLContextRef
cSSLCreateContext(CFAllocatorRef a
, int ps
, int ct
);
444 void cSSLDisposeContext(SSLContextRef
);
445 OSStatus
cSSLSetTrustedRoots(SSLContextRef cxt
, CFArrayRef rts
, Boolean replace
);
446 OSStatus
cSSLCopyPeerCertificates(SSLContextRef cxt
, CFArrayRef
*certs
);
447 OSStatus
cSSLSetProtocolVersionMinMax(SSLContextRef cxt
, int minVer
, int maxVer
);
449 #elif TARGET_OS_EMBEDDED || TARGET_OS_IPHONE
451 #error iOS is not currently supported
453 #endif /* TARGET_OS_EMBEDDED || TARGET_OS_IPHONE */
455 #endif /* STCOMPAT_H */