OSDN Git Service

10714f6cde5a30de8942dc8900e3ea6c17d05a85
[mingw/mingw-org-wsl.git] / include / schannel.h
1 /**
2  * @file schannel.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _SCHANNEL_H
25 #define _SCHANNEL_H
26 #pragma GCC system_header
27
28 #include <wincrypt.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define SCHANNEL_CRED_VERSION 4
35 #define SCHANNEL_SHUTDOWN 1
36 /* ? Do these belong here or in wincrypt.h */
37 #define AUTHTYPE_CLIENT 1
38 #define AUTHTYPE_SERVER 2
39
40 #define SP_PROT_TLS1_CLIENT 128
41 #define SP_PROT_TLS1_SERVER 64
42 #define SP_PROT_SSL3_CLIENT 32
43 #define SP_PROT_SSL3_SERVER 16
44 #define SP_PROT_SSL2_CLIENT 8
45 #define SP_PROT_SSL2_SERVER 4
46 #define SP_PROT_PCT1_SERVER 1
47 #define SP_PROT_PCT1_CLIENT 2
48
49 #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT|SP_PROT_PCT1_SERVER)
50 #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT|SP_PROT_TLS1_SERVER)
51 #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT|SP_PROT_SSL2_SERVER)
52 #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT|SP_PROT_SSL3_SERVER)
53
54 #define SCH_CRED_NO_SYSTEM_MAPPER 2
55 #define SCH_CRED_NO_SERVERNAME_CHECK 4
56 #define SCH_CRED_MANUAL_CRED_VALIDATION 8
57 #define SCH_CRED_NO_DEFAULT_CREDS 16
58 #define SCH_CRED_AUTO_CRED_VALIDATION 32
59 #define SCH_CRED_REVOCATION_CHECK_CHAIN 512
60 #define SCH_CRED_REVOCATION_CHECK_END_CERT 256
61 #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024
62 #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 2048
63 #define SCH_CRED_IGNORE_REVOCATION_OFFLINE 4096
64 #define SCH_CRED_USE_DEFAULT_CREDS 64
65
66 typedef struct _SCHANNEL_CRED {
67         DWORD dwVersion;
68         DWORD cCreds;
69         PCCERT_CONTEXT* paCred;
70         HCERTSTORE hRootStore;
71         DWORD cMappers;
72         struct _HMAPPER** aphMappers;
73         DWORD cSupportedAlgs;
74         ALG_ID* palgSupportedAlgs;
75         DWORD grbitEnabledProtocols;
76         DWORD dwMinimumCypherStrength;
77         DWORD dwMaximumCypherStrength;
78         DWORD dwSessionLifespan;
79         DWORD dwFlags;
80         DWORD reserved;
81 } SCHANNEL_CRED, *PSCHANNEL_CRED;
82 typedef struct _SecPkgCred_SupportedAlgs {
83         DWORD cSupportedAlgs;
84         ALG_ID* palgSupportedAlgs;
85 } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
86 typedef struct _SecPkgCred_CypherStrengths {
87         DWORD dwMinimumCypherStrength;
88         DWORD dwMaximumCypherStrength;
89 } SecPkgCred_CypherStrengths, *PSecPkgCred_CypherStrengths;
90 typedef struct _SecPkgCred_SupportedProtocols {
91         DWORD grbitProtocol;
92 } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols;
93 typedef struct _SecPkgContext_IssuerListInfoEx {
94         PCERT_NAME_BLOB aIssuers;
95         DWORD cIssuers;
96 } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx;
97 typedef struct _SecPkgContext_ConnectionInfo {
98         DWORD dwProtocol;
99         ALG_ID aiCipher;
100         DWORD dwCipherStrength;
101         ALG_ID aiHash;
102         DWORD dwHashStrength;
103         ALG_ID aiExch;
104         DWORD dwExchStrength;
105 } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif /* _SCHANNEL_H */