winebus.sys: Move SDL mapping loading to a separate helper.
[wine.git] / include / schannel.h
blobb60fdf7ad47b3bde83285cd40c86a608e7cac0ed
1 /*
2 * Copyright (C) 2005 Juan Lang
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 #ifndef __WINE_SCHANNEL_H__
19 #define __WINE_SCHANNEL_H__
21 #include <wincrypt.h>
23 /* Package names */
24 #define UNISP_NAME_A "Microsoft Unified Security Protocol Provider"
25 #if defined(_MSC_VER) || defined(__MINGW32__)
26 #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider"
27 #else
28 static const WCHAR UNISP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
29 ' ','U','n','i','f','i','e','d',' ','S','e','c','u','r','i','t','y',' ',
30 'P','r','o','t','o','c','o','l',' ','P','r','o','v','i','d','e','r',0 };
31 #endif
32 #define UNISP_NAME WINELIB_NAME_AW(UNISP_NAME_)
34 #define SSL2SP_NAME_A "Microsoft SSL 2.0"
35 #if defined(_MSC_VER) || defined(__MINGW32__)
36 #define SSL2SP_NAME_W L"Microsoft SSL 2.0"
37 #else
38 static const WCHAR SSL2SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
39 ' ','S','S','L',' ','2','.','0',0 };
40 #endif
41 #define SSL2SP_NAME WINELIB_NAME_AW(SSL2SP_NAME_)
43 #define SSL3SP_NAME_A "Microsoft SSL 3.0"
44 #if defined(_MSC_VER) || defined(__MINGW32__)
45 #define SSL3SP_NAME_W L"Microsoft SSL 3.0"
46 #else
47 static const WCHAR SSL3SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
48 ' ','S','S','L',' ','3','.','0',0 };
49 #endif
50 #define SSL3SP_NAME WINELIB_NAME_AW(SSL3SP_NAME_)
52 #define TLS1SP_NAME_A "Microsoft TLS 1.0"
53 #if defined(_MSC_VER) || defined(__MINGW32__)
54 #define TLS1SP_NAME_W L"Microsoft TLS 1.0"
55 #else
56 static const WCHAR TLS1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
57 ' ','T','L','S',' ','1','.','0',0 };
58 #endif
59 #define TLS1SP_NAME WINELIB_NAME_AW(TLS1SP_NAME_)
61 #define PCT1SP_NAME_A "Microsoft PCT 1.0"
62 #if defined(_MSC_VER) || defined(__MINGW32__)
63 #define PCT1SP_NAME_W L"Microsoft PCT 1.0"
64 #else
65 static const WCHAR PCT1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
66 ' ','P','C','T',' ','1','.','0',0 };
67 #endif
68 #define PCT1SP_NAME WINELIB_NAME_AW(PCT1SP_NAME_)
70 #define SCHANNEL_NAME_A "Schannel"
71 #if defined(_MSC_VER) || defined(__MINGW32__)
72 #define SCHANNEL_NAME_W L"Schannel"
73 #else
74 static const WCHAR SCHANNEL_NAME_W[] = { 'S','c','h','a','n','n','e','l',0 };
75 #endif
76 #define SCHANNEL_NAME WINELIB_NAME_AW(SCHANNEL_NAME_)
78 #define SCH_CRED_V1 1
79 #define SCH_CRED_V2 2
80 #define SCH_CRED_VERSION 2
81 #define SCH_CRED_V3 3
82 #define SCHANNEL_CRED_VERSION 4
84 #define SCHANNEL_RENEGOTIATE 0
85 #define SCHANNEL_SHUTDOWN 1
86 #define SCHANNEL_ALERT 2
87 #define SCHANNEL_SESSION 3
89 #define SP_PROT_ALL 0xffffffff
90 #define SP_PROT_UNI_CLIENT 0x80000000
91 #define SP_PROT_UNI_SERVER 0x40000000
92 #define SP_PROT_DTLS1_2_SERVER 0x00040000
93 #define SP_PROT_DTLS1_2_CLIENT 0x00080000
94 #define SP_PROT_DTLS_SERVER 0x00010000
95 #define SP_PROT_DTLS_CLIENT 0x00020000
96 #define SP_PROT_DTLS1_0_SERVER SP_PROT_DTLS_SERVER
97 #define SP_PROT_DTLS1_0_CLIENT SP_PROT_DTLS_CLIENT
98 #define SP_PROT_TLS1_3_SERVER 0x00001000
99 #define SP_PROT_TLS1_3_CLIENT 0x00002000
100 #define SP_PROT_TLS1_2_CLIENT 0x00000800
101 #define SP_PROT_TLS1_2_SERVER 0x00000400
102 #define SP_PROT_TLS1_1_CLIENT 0x00000200
103 #define SP_PROT_TLS1_1_SERVER 0x00000100
104 #define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT
105 #define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER
106 #define SP_PROT_TLS1_CLIENT 0x00000080
107 #define SP_PROT_TLS1_SERVER 0x00000040
108 #define SP_PROT_SSL3_CLIENT 0x00000020
109 #define SP_PROT_SSL3_SERVER 0x00000010
110 #define SP_PROT_SSL2_CLIENT 0x00000008
111 #define SP_PROT_SSL2_SERVER 0x00000004
112 #define SP_PROT_PCT1_CLIENT 0x00000002
113 #define SP_PROT_PCT1_SERVER 0x00000001
114 #define SP_PROT_NONE 0x00000000
116 #define SP_PROT_UNI (SP_PROT_UNI_CLIENT | SP_PROT_UNI_SERVER)
117 #define SP_PROT_DTLS (SP_PROT_DTLS_SERVER | SP_PROT_DTLS_CLIENT)
118 #define SP_PROT_DTLS1_0 (SP_PROT_DTLS1_0_SERVER | SP_PROT_DTLS1_0_CLIENT)
119 #define SP_PROT_DTLS1_2 (SP_PROT_DTLS1_2_SERVER | SP_PROT_DTLS1_2_CLIENT)
120 #define SP_PROT_TLS1_3 (SP_PROT_TLS1_3_CLIENT | SP_PROT_TLS1_3_SERVER)
121 #define SP_PROT_TLS1_2 (SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_2_SERVER)
122 #define SP_PROT_TLS1_1 (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_1_SERVER)
123 #define SP_PROT_TLS1_0 (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_0_SERVER)
124 #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER)
125 #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER)
126 #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER)
127 #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER)
129 #define SP_PROT_SSL3TLS1_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_TLS1_CLIENT)
130 #define SP_PROT_SSL3TLS1_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_TLS1_SERVER)
131 #define SP_PROT_SSL3TLS1_X_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_TLS1_X_CLIENT)
132 #define SP_PROT_SSL3TLS1_X_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_TLS1_X_SERVER)
133 #define SP_PROT_TLS1_X_CLIENT ( SP_PROT_TLS1_0_CLIENT \
134 | SP_PROT_TLS1_1_CLIENT \
135 | SP_PROT_TLS1_2_CLIENT \
136 | SP_PROT_TLS1_3_CLIENT )
137 #define SP_PROT_TLS1_X_SERVER ( SP_PROT_TLS1_0_SERVER \
138 | SP_PROT_TLS1_1_SERVER \
139 | SP_PROT_TLS1_2_SERVER \
140 | SP_PROT_TLS1_3_SERVER )
141 #define SP_PROT_TLS1_1PLUS_CLIENT ( SP_PROT_TLS1_1_CLIENT \
142 | SP_PROT_TLS1_2_CLIENT \
143 | SP_PROT_TLS1_3_CLIENT)
144 #define SP_PROT_TLS1_1PLUS_SERVER ( SP_PROT_TLS1_1_SERVER \
145 | SP_PROT_TLS1_2_SERVER \
146 | SP_PROT_TLS1_3_SERVER )
147 #define SP_PROT_DTLS1_X_SERVER ( SP_PROT_DTLS1_0_SERVER \
148 | SP_PROT_DTLS1_2_SERVER )
149 #define SP_PROT_DTLS1_X_CLIENT ( SP_PROT_DTLS1_0_CLIENT \
150 | SP_PROT_DTLS1_2_CLIENT )
151 #define SP_PROT_DTLS1_X ( SP_PROT_DTLS1_X_SERVER \
152 | SP_PROT_DTLS1_X_CLIENT )
153 #define SP_PROT_CLIENTS (SP_PROT_PCT1_CLIENT | SP_PROT_SSL2_CLIENT | SP_PROT_SSL3_CLIENT \
154 | SP_PROT_TLS1_CLIENT | SP_PROT_UNI_CLIENT)
155 #define SP_PROT_SERVERS (SP_PROT_PCT1_SERVER | SP_PROT_SSL2_SERVER | SP_PROT_SSL3_SERVER \
156 | SP_PROT_TLS1_SERVER | SP_PROT_UNI_SERVER)
157 #define SP_PROT_X_CLIENTS ( SP_PROT_CLIENTS \
158 | SP_PROT_TLS1_X_CLIENT \
159 | SP_PROT_DTLS1_X_CLIENT)
160 #define SP_PROT_X_SERVERS ( SP_PROT_SERVERS \
161 | SP_PROT_TLS1_X_SERVER \
162 | SP_PROT_DTLS1_X_SERVER)
164 #define SP_PROT_SSL3TLS1 (SP_PROT_SSL3 | SP_PROT_TLS1)
165 #define SP_PROT_SSL3TLS1_X (SP_PROT_SSL3 | SP_PROT_TLS1_X)
166 #define SP_PROT_TLS1_X (SP_PROT_TLS1_X_CLIENT | SP_PROT_TLS1_X_SERVER)
167 #define SP_PROT_TLS1_1PLUS (SP_PROT_TLS1_1PLUS_CLIENT | SP_PROT_TLS1_1PLUS_SERVER)
169 #define SCH_CRED_NO_SYSTEM_MAPPER 2
170 #define SCH_CRED_NO_SERVERNAME_CHECK 4
171 #define SCH_CRED_MANUAL_CRED_VALIDATION 8
172 #define SCH_CRED_NO_DEFAULT_CREDS 16
173 #define SCH_CRED_AUTO_CRED_VALIDATION 32
174 #define SCH_CRED_USE_DEFAULT_CREDS 64
175 #define SCH_CRED_REVOCATION_CHECK_CHAIN_END_CERT 256
176 #define SCH_CRED_REVOCATION_CHECK_CHAIN 512
177 #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024
178 #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 2048
179 #define SCH_CRED_IGNORE_REVOCATION_OFFLINE 4096
181 #define SECPKG_ATTR_ISSUER_LIST 0x50
182 #define SECPKG_ATTR_REMOTE_CRED 0x51
183 #define SECPKG_ATTR_LOCAL_CRED 0x52
184 #define SECPKG_ATTR_REMOTE_CERT_CONTEXT 0x53
185 #define SECPKG_ATTR_LOCAL_CERT_CONTEXT 0x54
186 #define SECPKG_ATTR_ROOT_STORE 0x55
187 #define SECPKG_ATTR_SUPPORTED_ALGS 0x56
188 #define SECPKG_ATTR_CIPHER_STRENGTHS 0x57
189 #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 0x58
190 #define SECPKG_ATTR_ISSUER_LIST_EX 0x59
191 #define SECPKG_ATTR_CONNECTION_INFO 0x5a
192 #define SECPKG_ATTR_EAP_KEY_BLOCK 0x5b
193 #define SECPKG_ATTR_MAPPED_CRED_ATTR 0x5c
194 #define SECPKG_ATTR_SESSION_INFO 0x5d
195 #define SECPKG_ATTR_APP_DATA 0x5e
197 #define UNISP_RPC_ID 14
199 struct _HMAPPER;
201 typedef struct _SCHANNEL_CRED
203 DWORD dwVersion;
204 DWORD cCreds;
205 PCCERT_CONTEXT *paCred;
206 HCERTSTORE hRootStore;
207 DWORD cMappers;
208 struct _HMAPPER **aphMappers;
209 DWORD cSupportedAlgs;
210 ALG_ID *palgSupportedAlgs;
211 DWORD grbitEnabledProtocols;
212 DWORD dwMinimumCipherStrength;
213 DWORD dwMaximumCipherStrength;
214 DWORD dwSessionLifespan;
215 DWORD dwFlags;
216 DWORD dwCredFormat;
217 } SCHANNEL_CRED, *PSCHANNEL_CRED;
219 typedef struct _SecPkgCred_SupportedAlgs
221 DWORD cSupportedAlgs;
222 ALG_ID *palgSupportedAlgs;
223 } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
225 typedef struct _SecPkgCred_CipherStrengths
227 DWORD dwMinimumCipherStrength;
228 DWORD dwMaximumCipherStrength;
229 } SecPkgCred_CipherStrengths, *PSecPkgCred_CipherStrengths;
231 typedef struct _SecPkgCred_SupportedProtocols
233 DWORD grbitProtocol;
234 } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols;
236 typedef struct _SecPkgContext_IssuerListInfoEx
238 PCERT_NAME_BLOB aIssuers;
239 DWORD cIssuers;
240 } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx;
242 typedef struct _SecPkgContext_ConnectionInfo
244 DWORD dwProtocol;
245 ALG_ID aiCipher;
246 DWORD dwCipherStrength;
247 ALG_ID aiHash;
248 DWORD dwHashStrength;
249 ALG_ID aiExch;
250 DWORD dwExchStrength;
251 } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;
253 #endif /* __WINE_SCHANNEL_H__ */