rsaenh/tests: Run the tests in the Base and Strong providers too.
[wine.git] / include / schannel.h
blob2e1a9f662f35a5d840c6ad86d5dd97917491d1a9
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(__GNUC__)
26 #define UNISP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
27 ' ','U','n','i','f','i','e','d',' ','S','e','c','u','r','i','t','y',' ',\
28 'P','r','o','t','o','c','o','l',' ','P','r','o','v','i','d','e','r',0 }
29 #elif defined(_MSC_VER)
30 #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider"
31 #else
32 static const WCHAR UNISP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
33 ' ','U','n','i','f','i','e','d',' ','S','e','c','u','r','i','t','y',' ',
34 'P','r','o','t','o','c','o','l',' ','P','r','o','v','i','d','e','r',0 };
35 #endif
36 #define UNISP_NAME WINELIB_NAME_AW(UNISP_NAME_)
38 #define SSL2SP_NAME_A "Microsoft SSL 2.0"
39 #if defined(__GNUC__)
40 #define SSL2SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
41 ' ','S','S','L',' ','2','.','0',0 }
42 #elif defined(_MSC_VER)
43 #define SSL2SP_NAME_W L"Microsoft SSL 2.0"
44 #else
45 static const WCHAR SSL2SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
46 ' ','S','S','L',' ','2','.','0',0 };
47 #endif
48 #define SSL2SP_NAME WINELIB_NAME_AW(SSL2SP_NAME_)
50 #define SSL3SP_NAME_A "Microsoft SSL 3.0"
51 #if defined(__GNUC__)
52 #define SSL3SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
53 ' ','S','S','L',' ','3','.','0',0 }
54 #elif defined(_MSC_VER)
55 #define SSL3SP_NAME_W L"Microsoft SSL 3.0"
56 #else
57 static const WCHAR SSL3SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
58 ' ','S','S','L',' ','3','.','0',0 };
59 #endif
60 #define SSL3SP_NAME WINELIB_NAME_AW(SSL3SP_NAME_)
62 #define TLS1SP_NAME_A "Microsoft TLS 1.0"
63 #if defined(__GNUC__)
64 #define TLS1SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
65 ' ','T','L','S',' ','1','.','0',0 }
66 #elif defined(_MSC_VER)
67 #define TLS1SP_NAME_W L"Microsoft TLS 1.0"
68 #else
69 static const WCHAR TLS1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
70 ' ','T','L','S',' ','1','.','0',0 };
71 #endif
72 #define TLS1SP_NAME WINELIB_NAME_AW(TLS1SP_NAME_)
74 #define PCT1SP_NAME_A "Microsoft PCT 1.0"
75 #if defined(__GNUC__)
76 #define PCT1SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
77 ' ','P','C','T',' ','1','.','0',0 }
78 #elif defined(_MSC_VER)
79 #define PCT1SP_NAME_W L"Microsoft PCT 1.0"
80 #else
81 static const WCHAR PCT1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
82 ' ','P','C','T',' ','1','.','0',0 };
83 #endif
84 #define PCT1SP_NAME WINELIB_NAME_AW(PCT1SP_NAME_)
86 #define SCHANNEL_NAME_A "Schannel"
87 #if defined(__GNUC__)
88 #define SCHANNEL_NAME_W (const WCHAR []){ 'S','c','h','a','n','n','e','l',0 }
89 #elif defined(_MSC_VER)
90 #define SCHANNEL_NAME_W L"Schannel"
91 #else
92 static const WCHAR SCHANNEL_NAME_W[] = { 'S','c','h','a','n','n','e','l',0 };
93 #endif
94 #define SCHANNEL_NAME WINELIB_NAME_AW(SCHANNEL_NAME_)
96 #define SCH_CRED_V1 1
97 #define SCH_CRED_V2 2
98 #define SCH_CRED_VERSION 2
99 #define SCH_CRED_V3 3
100 #define SCHANNEL_CRED_VERSION 4
102 #define SCHANNEL_RENEGOTIATE 0
103 #define SCHANNEL_SHUTDOWN 1
104 #define SCHANNEL_ALERT 2
105 #define SCHANNEL_SESSION 3
107 #define SP_PROT_ALL 0xffffffff
108 #define SP_PROT_UNI_CLIENT 0x80000000
109 #define SP_PROT_UNI_SERVER 0x40000000
110 #define SP_PROT_TLS1_2_CLIENT 0x00000800
111 #define SP_PROT_TLS1_2_SERVER 0x00000400
112 #define SP_PROT_TLS1_1_CLIENT 0x00000200
113 #define SP_PROT_TLS1_1_SERVER 0x00000100
114 #define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT
115 #define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER
116 #define SP_PROT_TLS1_CLIENT 0x00000080
117 #define SP_PROT_TLS1_SERVER 0x00000040
118 #define SP_PROT_SSL3_CLIENT 0x00000020
119 #define SP_PROT_SSL3_SERVER 0x00000010
120 #define SP_PROT_SSL2_CLIENT 0x00000008
121 #define SP_PROT_SSL2_SERVER 0x00000004
122 #define SP_PROT_PCT1_CLIENT 0x00000002
123 #define SP_PROT_PCT1_SERVER 0x00000001
124 #define SP_PROT_NONE 0x00000000
126 #define SP_PROT_UNI (SP_PROT_UNI_CLIENT | SP_PROT_UNI_SERVER)
127 #define SP_PROT_TLS1_2 (SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_2_SERVER)
128 #define SP_PROT_TLS1_1 (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_1_SERVER)
129 #define SP_PROT_TLS1_0 (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_0_SERVER)
130 #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER)
131 #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER)
132 #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER)
133 #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER)
135 #define SP_PROT_SSL3TLS1_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_TLS1_CLIENT)
136 #define SP_PROT_SSL3TLS1_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_TLS1_SERVER)
137 #define SP_PROT_SSL3TLS1_X_CLIENTS (SP_PROT_SSL3_CLIENT | SP_PROT_TLS1_X_CLIENT)
138 #define SP_PROT_SSL3TLS1_X_SERVERS (SP_PROT_SSL3_SERVER | SP_PROT_TLS1_X_SERVER)
139 #define SP_PROT_TLS1_X_CLIENT (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT)
140 #define SP_PROT_TLS1_X_SERVER (SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER)
141 #define SP_PROT_TLS1_1PLUS_CLIENT (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT)
142 #define SP_PROT_TLS1_1PLUS_SERVER (SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER)
143 #define SP_PROT_CLIENTS (SP_PROT_PCT1_CLIENT | SP_PROT_SSL2_CLIENT | SP_PROT_SSL3_CLIENT \
144 | SP_PROT_TLS1_CLIENT | SP_PROT_UNI_CLIENT)
145 #define SP_PROT_SERVERS (SP_PROT_PCT1_SERVER | SP_PROT_SSL2_SERVER | SP_PROT_SSL3_SERVER \
146 | SP_PROT_TLS1_SERVER | SP_PROT_UNI_SERVER)
147 #define SP_PROT_X_CLIENTS (SP_PROT_CLIENTS | SP_PROT_TLS1_X_CLIENT)
148 #define SP_PROT_X_SERVERS (SP_PROT_SERVERS | SP_PROT_TLS1_X_SERVER)
150 #define SP_PROT_SSL3TLS1 (SP_PROT_SSL3 | SP_PROT_TLS1)
151 #define SP_PROT_SSL3TLS1_X (SP_PROT_SSL3 | SP_PROT_TLS1_X)
152 #define SP_PROT_TLS1_X (SP_PROT_TLS1_X_CLIENT | SP_PROT_TLS1_X_SERVER)
153 #define SP_PROT_TLS1_1PLUS (SP_PROT_TLS1_1PLUS_CLIENT | SP_PROT_TLS1_1PLUS_SERVER)
155 #define SCH_CRED_NO_SYSTEM_MAPPER 2
156 #define SCH_CRED_NO_SERVERNAME_CHECK 4
157 #define SCH_CRED_MANUAL_CRED_VALIDATION 8
158 #define SCH_CRED_NO_DEFAULT_CREDS 16
159 #define SCH_CRED_AUTO_CRED_VALIDATION 32
160 #define SCH_CRED_USE_DEFAULT_CREDS 64
161 #define SCH_CRED_REVOCATION_CHECK_CHAIN_END_CERT 256
162 #define SCH_CRED_REVOCATION_CHECK_CHAIN 512
163 #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024
164 #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 2048
165 #define SCH_CRED_IGNORE_REVOCATION_OFFLINE 4096
167 #define SECPKG_ATTR_ISSUER_LIST 0x50
168 #define SECPKG_ATTR_REMOTE_CRED 0x51
169 #define SECPKG_ATTR_LOCAL_CRED 0x52
170 #define SECPKG_ATTR_REMOTE_CERT_CONTEXT 0x53
171 #define SECPKG_ATTR_LOCAL_CERT_CONTEXT 0x54
172 #define SECPKG_ATTR_ROOT_STORE 0x55
173 #define SECPKG_ATTR_SUPPORTED_ALGS 0x56
174 #define SECPKG_ATTR_CIPHER_STRENGTHS 0x57
175 #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 0x58
176 #define SECPKG_ATTR_ISSUER_LIST_EX 0x59
177 #define SECPKG_ATTR_CONNECTION_INFO 0x5a
178 #define SECPKG_ATTR_EAP_KEY_BLOCK 0x5b
179 #define SECPKG_ATTR_MAPPED_CRED_ATTR 0x5c
180 #define SECPKG_ATTR_SESSION_INFO 0x5d
181 #define SECPKG_ATTR_APP_DATA 0x5e
183 #define UNISP_RPC_ID 14
185 struct _HMAPPER;
187 typedef struct _SCHANNEL_CRED
189 DWORD dwVersion;
190 DWORD cCreds;
191 PCCERT_CONTEXT *paCred;
192 HCERTSTORE hRootStore;
193 DWORD cMappers;
194 struct _HMAPPER **aphMappers;
195 DWORD cSupportedAlgs;
196 ALG_ID *palgSupportedAlgs;
197 DWORD grbitEnabledProtocols;
198 DWORD dwMinimumCipherStrength;
199 DWORD dwMaximumCipherStrength;
200 DWORD dwSessionLifespan;
201 DWORD dwFlags;
202 DWORD dwCredFormat;
203 } SCHANNEL_CRED, *PSCHANNEL_CRED;
205 typedef struct _SecPkgCred_SupportedAlgs
207 DWORD cSupportedAlgs;
208 ALG_ID *palgSupportedAlgs;
209 } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
211 typedef struct _SecPkgCred_CipherStrengths
213 DWORD dwMinimumCipherStrength;
214 DWORD dwMaximumCipherStrength;
215 } SecPkgCred_CipherStrengths, *PSecPkgCred_CipherStrengths;
217 typedef struct _SecPkgCred_SupportedProtocols
219 DWORD grbitProtocol;
220 } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols;
222 typedef struct _SecPkgContext_IssuerListInfoEx
224 PCERT_NAME_BLOB aIssuers;
225 DWORD cIssuers;
226 } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx;
228 typedef struct _SecPkgContext_ConnectionInfo
230 DWORD dwProtocol;
231 ALG_ID aiCipher;
232 DWORD dwCipherStrength;
233 ALG_ID aiHash;
234 DWORD dwHashStrength;
235 ALG_ID aiExch;
236 DWORD dwExchStrength;
237 } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;
239 #endif /* __WINE_SCHANNEL_H__ */