1 | /*
|
---|
2 | * Copyright (C) 2005 Juan Lang
|
---|
3 | *
|
---|
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.
|
---|
8 | *
|
---|
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.
|
---|
13 | *
|
---|
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
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef __WINE_SCHANNEL_H__
|
---|
29 | #define __WINE_SCHANNEL_H__
|
---|
30 |
|
---|
31 | #include <wincrypt.h>
|
---|
32 |
|
---|
33 | /* Package names */
|
---|
34 | #define UNISP_NAME_A "Microsoft Unified Security Protocol Provider"
|
---|
35 | #if defined(__GNUC__)
|
---|
36 | #define UNISP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
|
---|
37 | ' ','U','n','i','f','i','e','d',' ','S','e','c','u','r','i','t','y',' ',\
|
---|
38 | 'P','r','o','t','o','c','o','l',' ','P','r','o','v','i','d','e','r',0 }
|
---|
39 | #elif defined(_MSC_VER)
|
---|
40 | #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider"
|
---|
41 | #else
|
---|
42 | static const WCHAR UNISP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
|
---|
43 | ' ','U','n','i','f','i','e','d',' ','S','e','c','u','r','i','t','y',' ',
|
---|
44 | 'P','r','o','t','o','c','o','l',' ','P','r','o','v','i','d','e','r',0 };
|
---|
45 | #endif
|
---|
46 | #define UNISP_NAME WINELIB_NAME_AW(UNISP_NAME_)
|
---|
47 |
|
---|
48 | #define SSL2SP_NAME_A "Microsoft SSL 2.0"
|
---|
49 | #if defined(__GNUC__)
|
---|
50 | #define SSL2SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
|
---|
51 | ' ','S','S','L',' ','2','.','0',0 }
|
---|
52 | #elif defined(_MSC_VER)
|
---|
53 | #define SSL2SP_NAME_W L"Microsoft SSL 2.0"
|
---|
54 | #else
|
---|
55 | static const WCHAR SSL2SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
|
---|
56 | ' ','S','S','L',' ','2','.','0',0 };
|
---|
57 | #endif
|
---|
58 | #define SSL2SP_NAME WINELIB_NAME_AW(SSL2SP_NAME_)
|
---|
59 |
|
---|
60 | #define SSL3SP_NAME_A "Microsoft SSL 3.0"
|
---|
61 | #if defined(__GNUC__)
|
---|
62 | #define SSL3SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
|
---|
63 | ' ','S','S','L',' ','3','.','0',0 }
|
---|
64 | #elif defined(_MSC_VER)
|
---|
65 | #define SSL3SP_NAME_W L"Microsoft SSL 3.0"
|
---|
66 | #else
|
---|
67 | static const WCHAR SSL3SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
|
---|
68 | ' ','S','S','L',' ','3','.','0',0 };
|
---|
69 | #endif
|
---|
70 | #define SSL3SP_NAME WINELIB_NAME_AW(SSL3SP_NAME_)
|
---|
71 |
|
---|
72 | #define TLS1SP_NAME_A "Microsoft TLS 1.0"
|
---|
73 | #if defined(__GNUC__)
|
---|
74 | #define TLS1SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
|
---|
75 | ' ','T','L','S',' ','1','.','0',0 }
|
---|
76 | #elif defined(_MSC_VER)
|
---|
77 | #define TLS1SP_NAME_W L"Microsoft TLS 1.0"
|
---|
78 | #else
|
---|
79 | static const WCHAR TLS1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
|
---|
80 | ' ','T','L','S',' ','1','.','0',0 };
|
---|
81 | #endif
|
---|
82 | #define TLS1SP_NAME WINELIB_NAME_AW(TLS1SP_NAME_)
|
---|
83 |
|
---|
84 | #define PCT1SP_NAME_A "Microsoft PCT 1.0"
|
---|
85 | #if defined(__GNUC__)
|
---|
86 | #define PCT1SP_NAME_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',\
|
---|
87 | ' ','P','C','T',' ','1','.','0',0 }
|
---|
88 | #elif defined(_MSC_VER)
|
---|
89 | #define PCT1SP_NAME_W L"Microsoft PCT 1.0"
|
---|
90 | #else
|
---|
91 | static const WCHAR PCT1SP_NAME_W[] = { 'M','i','c','r','o','s','o','f','t',
|
---|
92 | ' ','P','C','T',' ','1','.','0',0 };
|
---|
93 | #endif
|
---|
94 | #define PCT1SP_NAME WINELIB_NAME_AW(PCT1SP_NAME_)
|
---|
95 |
|
---|
96 | #define SCHANNEL_NAME_A "Schannel"
|
---|
97 | #if defined(__GNUC__)
|
---|
98 | #define SCHANNEL_NAME_W (const WCHAR []){ 'S','c','h','a','n','n','e','l',0 }
|
---|
99 | #elif defined(_MSC_VER)
|
---|
100 | #define SCHANNEL_NAME_W L"Schannel"
|
---|
101 | #else
|
---|
102 | static const WCHAR SCHANNEL_NAME_W[] = { 'S','c','h','a','n','n','e','l',0 };
|
---|
103 | #endif
|
---|
104 | #define SCHANNEL_NAME WINELIB_NAME_AW(SCHANNEL_NAME_)
|
---|
105 |
|
---|
106 | #define SCH_CRED_V1 1
|
---|
107 | #define SCH_CRED_V2 2
|
---|
108 | #define SCH_CRED_VERSION 2
|
---|
109 | #define SCH_CRED_V3 3
|
---|
110 | #define SCHANNEL_CRED_VERSION 4
|
---|
111 |
|
---|
112 | #define SCHANNEL_RENEGOTIATE 0
|
---|
113 | #define SCHANNEL_SHUTDOWN 1
|
---|
114 | #define SCHANNEL_ALERT 2
|
---|
115 | #define SCHANNEL_SESSION 3
|
---|
116 |
|
---|
117 | #define SP_PROT_TLS1_CLIENT 128
|
---|
118 | #define SP_PROT_TLS1_SERVER 64
|
---|
119 | #define SP_PROT_SSL3_CLIENT 32
|
---|
120 | #define SP_PROT_SSL3_SERVER 16
|
---|
121 | #define SP_PROT_SSL2_CLIENT 8
|
---|
122 | #define SP_PROT_SSL2_SERVER 4
|
---|
123 | #define SP_PROT_PCT1_CLIENT 2
|
---|
124 | #define SP_PROT_PCT1_SERVER 1
|
---|
125 |
|
---|
126 | #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER)
|
---|
127 | #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER)
|
---|
128 | #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER)
|
---|
129 | #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER)
|
---|
130 |
|
---|
131 | #define SCH_CRED_NO_SYSTEM_MAPPER 2
|
---|
132 | #define SCH_CRED_NO_SERVERNAME_CHECK 4
|
---|
133 | #define SCH_CRED_MANUAL_CRED_VALIDATION 8
|
---|
134 | #define SCH_CRED_NO_DEFAULT_CREDS 16
|
---|
135 | #define SCH_CRED_AUTO_CRED_VALIDATION 32
|
---|
136 | #define SCH_CRED_USE_DEFAULT_CREDS 64
|
---|
137 | #define SCH_CRED_REVOCATION_CHECK_CHAIN_END_CERT 256
|
---|
138 | #define SCH_CRED_REVOCATION_CHECK_CHAIN 512
|
---|
139 | #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024
|
---|
140 | #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 2048
|
---|
141 | #define SCH_CRED_IGNORE_REVOCATION_OFFLINE 4096
|
---|
142 |
|
---|
143 | #define SECPKG_ATTR_ISSUER_LIST 0x50
|
---|
144 | #define SECPKG_ATTR_REMOTE_CRED 0x51
|
---|
145 | #define SECPKG_ATTR_LOCAL_CRED 0x52
|
---|
146 | #define SECPKG_ATTR_REMOTE_CERT_CONTEXT 0x53
|
---|
147 | #define SECPKG_ATTR_LOCAL_CERT_CONTEXT 0x54
|
---|
148 | #define SECPKG_ATTR_ROOT_STORE 0x55
|
---|
149 | #define SECPKG_ATTR_SUPPORTED_ALGS 0x56
|
---|
150 | #define SECPKG_ATTR_CIPHER_STRENGTHS 0x57
|
---|
151 | #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 0x58
|
---|
152 | #define SECPKG_ATTR_ISSUER_LIST_EX 0x59
|
---|
153 | #define SECPKG_ATTR_CONNECTION_INFO 0x5a
|
---|
154 | #define SECPKG_ATTR_EAP_KEY_BLOCK 0x5b
|
---|
155 | #define SECPKG_ATTR_MAPPED_CRED_ATTR 0x5c
|
---|
156 | #define SECPKG_ATTR_SESSION_INFO 0x5d
|
---|
157 | #define SECPKG_ATTR_APP_DATA 0x5e
|
---|
158 |
|
---|
159 | #define UNISP_RPC_ID 14
|
---|
160 |
|
---|
161 | struct _HMAPPER;
|
---|
162 |
|
---|
163 | typedef struct _SCHANNEL_CRED
|
---|
164 | {
|
---|
165 | DWORD dwVersion;
|
---|
166 | DWORD cCreds;
|
---|
167 | PCCERT_CONTEXT *paCred;
|
---|
168 | HCERTSTORE hRootStore;
|
---|
169 | DWORD cMappers;
|
---|
170 | struct _HMAPPER **aphMappers;
|
---|
171 | DWORD cSupportedAlgs;
|
---|
172 | ALG_ID *palgSupportedAlgs;
|
---|
173 | DWORD grbitEnabledProtocols;
|
---|
174 | DWORD dwMinimumCipherStrength;
|
---|
175 | DWORD dwMaximumCipherStrength;
|
---|
176 | DWORD dwSessionLifespan;
|
---|
177 | DWORD dwFlags;
|
---|
178 | DWORD dwCredFormat;
|
---|
179 | } SCHANNEL_CRED, *PSCHANNEL_CRED;
|
---|
180 |
|
---|
181 | typedef struct _SecPkgCred_SupportedAlgs
|
---|
182 | {
|
---|
183 | DWORD cSupportedAlgs;
|
---|
184 | ALG_ID *palgSupportedAlgs;
|
---|
185 | } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
|
---|
186 |
|
---|
187 | typedef struct _SecPkgCred_CipherStrengths
|
---|
188 | {
|
---|
189 | DWORD dwMinimumCipherStrength;
|
---|
190 | DWORD dwMaximumCipherStrength;
|
---|
191 | } SecPkgCred_CipherStrengths, *PSecPkgCred_CipherStrengths;
|
---|
192 |
|
---|
193 | typedef struct _SecPkgCred_SupportedProtocols
|
---|
194 | {
|
---|
195 | DWORD grbitProtocol;
|
---|
196 | } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols;
|
---|
197 |
|
---|
198 | typedef struct _SecPkgContext_IssuerListInfoEx
|
---|
199 | {
|
---|
200 | PCERT_NAME_BLOB aIssuers;
|
---|
201 | DWORD cIssuers;
|
---|
202 | } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx;
|
---|
203 |
|
---|
204 | typedef struct _SecPkgContext_ConnectionInfo
|
---|
205 | {
|
---|
206 | DWORD dwProtocol;
|
---|
207 | ALG_ID aiCipher;
|
---|
208 | DWORD dwCipherStrength;
|
---|
209 | ALG_ID aiHash;
|
---|
210 | DWORD dwHashStrength;
|
---|
211 | ALG_ID aiExch;
|
---|
212 | DWORD dwExchStrength;
|
---|
213 | } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;
|
---|
214 |
|
---|
215 | #endif /* __WINE_SCHANNEL_H__ */
|
---|