1 #if MONO_FEATURE_APPLETLS
2 // Copyright 2014 Xamarin Inc. All rights reserved.
4 namespace Mono.AppleTls {
6 // Security.framework/Headers/SecureTransport.h
23 // subset of OSStatus (int)
25 Success = 0, // errSecSuccess in SecBase.h
30 SessionNotFound = -9804,
31 ClosedGraceful = -9805,
33 XCertChainInvalid = -9807,
38 UnknownRootCert = -9812,
41 CertNotYetValid = -9815,
42 ClosedNotNotified = -9816,
43 BufferOverflow = -9817,
44 BadCipherSuite = -9818,
45 PeerUnexpectedMsg = -9819,
46 PeerBadRecordMac = -9820,
47 PeerDecryptionFail = -9821,
48 PeerRecordOverflow = -9822,
49 PeerDecompressFail = -9823,
50 PeerHandshakeFail = -9824,
52 PeerUnsupportedCert = -9826,
53 PeerCertRevoked = -9827,
54 PeerCertExpired = -9828,
55 PeerCertUnknown = -9829,
57 PeerUnknownCA = -9831,
58 PeerAccessDenied = -9832,
59 PeerDecodeError = -9833,
60 PeerDecryptError = -9834,
61 PeerExportRestriction = -9835,
62 PeerProtocolVersion = -9836,
63 PeerInsufficientSecurity = -9837,
64 PeerInternalError = -9838,
65 PeerUserCancelled = -9839,
66 PeerNoRenegotiation = -9840,
67 PeerAuthCompleted = -9841, // non fatal
68 PeerClientCertRequested = -9842, // non fatal
69 HostNameMismatch = -9843,
70 ConnectionRefused = -9844,
71 DecryptionFail = -9845,
73 RecordOverflow = -9847,
74 BadConfiguration = -9848,
75 UnexpectedRecord = -9849,
76 SSLWeakPeerEphemeralDHKey = -9850,
77 SSLClientHelloReceived = -9851 // non falta
80 // Security.framework/Headers/SecureTransport.h
82 enum SslSessionOption {
91 // AllowServerIdentityChange = 5,
95 // BreakOnClientHello = 7,
97 // AllowRenegotiation = 8,
100 // Security.framework/Headers/SecureTransport.h
102 enum SslAuthenticate {
108 // Security.framework/Headers/SecureTransport.h
110 enum SslProtocolSide {
115 // Security.framework/Headers/SecureTransport.h
117 enum SslConnectionType {
122 // Security.framework/Headers/SecureTransport.h
124 enum SslSessionState {
133 // Security.framework/Headers/SecureTransport.h
135 enum SslClientCertificateState {
142 // Security.framework/Headers/CipherSuite.h
143 // 32 bits (uint32_t) on OSX, 16 bits (uint16_t) on iOS
144 #if XAMMAC || XAMMAC_4_5
145 enum SslCipherSuite : uint {
147 enum SslCipherSuite : ushort {
149 // DO NOT RENAME VALUES - they don't look good but we need them to keep compatibility with our System.dll code
150 // it's how it's defined across most SSL/TLS implementation (from RFC)
152 SSL_NULL_WITH_NULL_NULL = 0x0000, // value used before (not after) negotiation
153 TLS_NULL_WITH_NULL_NULL = 0x0000,
155 // Not the whole list (too much unneeed metadata) but only what's supported
156 // FIXME needs to be expended with OSX 10.9
158 SSL_RSA_WITH_NULL_MD5 = 0x0001,
159 SSL_RSA_WITH_NULL_SHA = 0x0002,
160 SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003, // iOS 5.1 only
161 SSL_RSA_WITH_RC4_128_MD5 = 0x0004,
162 SSL_RSA_WITH_RC4_128_SHA = 0x0005,
163 SSL_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
164 SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
165 SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017, // iOS 5.1 only
166 SSL_DH_anon_WITH_RC4_128_MD5 = 0x0018,
167 SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
169 // TLS - identical values to SSL (above)
171 TLS_RSA_WITH_NULL_MD5 = 0x0001,
172 TLS_RSA_WITH_NULL_SHA = 0x0002,
173 TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
174 TLS_RSA_WITH_RC4_128_SHA = 0x0005,
175 TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
176 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
177 TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018,
178 TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
182 TLS_PSK_WITH_NULL_SHA = 0x002C,
183 TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
184 TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
185 TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034,
186 TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
187 TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
188 TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A,
189 TLS_RSA_WITH_NULL_SHA256 = 0x003B,
190 TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C,
191 TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D,
192 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067,
193 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B,
194 TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C,
195 TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D,
196 TLS_PSK_WITH_RC4_128_SHA = 0x008A,
197 TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B,
198 TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C,
199 TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D,
201 TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C, // iOS 9+
202 TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D, // iOS 9+
203 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E, // iOS 9+
204 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F, // iOS 9+
206 TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6, // iOS 5.1 only
207 TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7, // iOS 5.1 only
208 TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE,
209 TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF,
210 TLS_PSK_WITH_NULL_SHA256 = 0x00B0,
211 TLS_PSK_WITH_NULL_SHA384 = 0x00B1,
212 TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001,
213 TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002,
214 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003,
215 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004,
216 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005,
217 TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006,
218 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007,
219 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008,
220 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009,
221 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A,
222 TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B,
223 TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C,
224 TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D,
225 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E,
226 TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F,
227 TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010,
228 TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011,
229 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012,
230 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013,
231 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014,
232 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
233 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
234 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025,
235 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026,
236 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
237 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
238 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029,
239 TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A,
241 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B, // iOS 9+
242 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C, // iOS 9+
243 TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D, // iOS 9+
244 TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E, // iOS 9+
245 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F, // iOS 9+
246 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030, // iOS 9+
247 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031, // iOS 9+
248 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032, // iOS 9+