1 /***********************************************************************\
2 *                               schannel.d                              *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.schannel;
12 version(Windows):
13 
14 import win32.wincrypt;
15 private import win32.windef;
16 
17 const DWORD SCHANNEL_CRED_VERSION = 4;
18 const SCHANNEL_SHUTDOWN           = 1;
19 /* Comment from MinGW
20 	? Do these belong here or in wincrypt.h
21  */
22 enum : DWORD {
23 	AUTHTYPE_CLIENT = 1,
24 	AUTHTYPE_SERVER = 2
25 }
26 
27 const DWORD
28 	SP_PROT_PCT1_SERVER = 0x01,
29 	SP_PROT_PCT1_CLIENT = 0x02,
30 	SP_PROT_SSL2_SERVER = 0x04,
31 	SP_PROT_SSL2_CLIENT = 0x08,
32 	SP_PROT_SSL3_SERVER = 0x10,
33 	SP_PROT_SSL3_CLIENT = 0x20,
34 	SP_PROT_TLS1_SERVER = 0x40,
35 	SP_PROT_TLS1_CLIENT = 0x80,
36 	SP_PROT_PCT1        = SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER,
37 	SP_PROT_TLS1        = SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER,
38 	SP_PROT_SSL2        = SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER,
39 	SP_PROT_SSL3        = SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER;
40 
41 const DWORD
42 	SCH_CRED_NO_SYSTEM_MAPPER                    = 0x0002,
43 	SCH_CRED_NO_SERVERNAME_CHECK                 = 0x0004,
44 	SCH_CRED_MANUAL_CRED_VALIDATION              = 0x0008,
45 	SCH_CRED_NO_DEFAULT_CREDS                    = 0x0010,
46 	SCH_CRED_AUTO_CRED_VALIDATION                = 0x0020,
47 	SCH_CRED_USE_DEFAULT_CREDS                   = 0x0040,
48 	SCH_CRED_REVOCATION_CHECK_END_CERT           = 0x0100,
49 	SCH_CRED_REVOCATION_CHECK_CHAIN              = 0x0200,
50 	SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x0400,
51 	SCH_CRED_IGNORE_NO_REVOCATION_CHECK          = 0x0800,
52 	SCH_CRED_IGNORE_REVOCATION_OFFLINE           = 0x1000;
53 
54 // No definition - presumably an opaque structure
55 struct _HMAPPER;
56 
57 struct SCHANNEL_CRED {
58 	DWORD           dwVersion = SCHANNEL_CRED_VERSION;
59 	DWORD           cCreds;
60 	PCCERT_CONTEXT* paCred;
61 	HCERTSTORE      hRootStore;
62 	DWORD           cMappers;
63 	_HMAPPER**      aphMappers;
64 	DWORD           cSupportedAlgs;
65 	ALG_ID*         palgSupportedAlgs;
66 	DWORD           grbitEnabledProtocols;
67 	DWORD           dwMinimumCypherStrength;
68 	DWORD           dwMaximumCypherStrength;
69 	DWORD           dwSessionLifespan;
70 	DWORD           dwFlags;
71 	DWORD           reserved;
72 }
73 alias SCHANNEL_CRED* PSCHANNEL_CRED;
74 
75 struct SecPkgCred_SupportedAlgs {
76 	DWORD   cSupportedAlgs;
77 	ALG_ID* palgSupportedAlgs;
78 }
79 alias SecPkgCred_SupportedAlgs* PSecPkgCred_SupportedAlgs;
80 
81 struct SecPkgCred_CypherStrengths {
82 	DWORD dwMinimumCypherStrength;
83 	DWORD dwMaximumCypherStrength;
84 }
85 alias SecPkgCred_CypherStrengths* PSecPkgCred_CypherStrengths;
86 
87 struct SecPkgCred_SupportedProtocols {
88 	DWORD grbitProtocol;
89 }
90 alias SecPkgCred_SupportedProtocols* PSecPkgCred_SupportedProtocols;
91 
92 struct SecPkgContext_IssuerListInfoEx {
93 	PCERT_NAME_BLOB aIssuers;
94 	DWORD           cIssuers;
95 }
96 alias SecPkgContext_IssuerListInfoEx* PSecPkgContext_IssuerListInfoEx;
97 
98 struct SecPkgContext_ConnectionInfo {
99 	DWORD  dwProtocol;
100 	ALG_ID aiCipher;
101 	DWORD  dwCipherStrength;
102 	ALG_ID aiHash;
103 	DWORD  dwHashStrength;
104 	ALG_ID aiExch;
105 	DWORD  dwExchStrength;
106 }
107 alias SecPkgContext_ConnectionInfo* PSecPkgContext_ConnectionInfo;