| 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 | #ifndef __WINE_SCHANNEL_H__
 | 
|---|
| 19 | #define __WINE_SCHANNEL_H__
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #include <wincrypt.h>
 | 
|---|
| 22 | 
 | 
|---|
| 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_)
 | 
|---|
| 37 | 
 | 
|---|
| 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_)
 | 
|---|
| 49 | 
 | 
|---|
| 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_)
 | 
|---|
| 61 | 
 | 
|---|
| 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_)
 | 
|---|
| 73 | 
 | 
|---|
| 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_)
 | 
|---|
| 85 | 
 | 
|---|
| 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_)
 | 
|---|
| 95 | 
 | 
|---|
| 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
 | 
|---|
| 101 | 
 | 
|---|
| 102 | #define SCHANNEL_RENEGOTIATE 0
 | 
|---|
| 103 | #define SCHANNEL_SHUTDOWN    1
 | 
|---|
| 104 | #define SCHANNEL_ALERT       2
 | 
|---|
| 105 | #define SCHANNEL_SESSION     3
 | 
|---|
| 106 | 
 | 
|---|
| 107 | #define SP_PROT_TLS1_CLIENT 128
 | 
|---|
| 108 | #define SP_PROT_TLS1_SERVER 64
 | 
|---|
| 109 | #define SP_PROT_SSL3_CLIENT 32
 | 
|---|
| 110 | #define SP_PROT_SSL3_SERVER 16
 | 
|---|
| 111 | #define SP_PROT_SSL2_CLIENT 8
 | 
|---|
| 112 | #define SP_PROT_SSL2_SERVER 4
 | 
|---|
| 113 | #define SP_PROT_PCT1_CLIENT 2
 | 
|---|
| 114 | #define SP_PROT_PCT1_SERVER 1
 | 
|---|
| 115 | 
 | 
|---|
| 116 | #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER)
 | 
|---|
| 117 | #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER)
 | 
|---|
| 118 | #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER)
 | 
|---|
| 119 | #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER)
 | 
|---|
| 120 | 
 | 
|---|
| 121 | #define SCH_CRED_NO_SYSTEM_MAPPER                    2
 | 
|---|
| 122 | #define SCH_CRED_NO_SERVERNAME_CHECK                 4
 | 
|---|
| 123 | #define SCH_CRED_MANUAL_CRED_VALIDATION              8
 | 
|---|
| 124 | #define SCH_CRED_NO_DEFAULT_CREDS                    16
 | 
|---|
| 125 | #define SCH_CRED_AUTO_CRED_VALIDATION                32
 | 
|---|
| 126 | #define SCH_CRED_USE_DEFAULT_CREDS                   64
 | 
|---|
| 127 | #define SCH_CRED_REVOCATION_CHECK_CHAIN_END_CERT     256
 | 
|---|
| 128 | #define SCH_CRED_REVOCATION_CHECK_CHAIN              512
 | 
|---|
| 129 | #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024
 | 
|---|
| 130 | #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK          2048
 | 
|---|
| 131 | #define SCH_CRED_IGNORE_REVOCATION_OFFLINE           4096
 | 
|---|
| 132 | 
 | 
|---|
| 133 | #define SECPKG_ATTR_ISSUER_LIST         0x50
 | 
|---|
| 134 | #define SECPKG_ATTR_REMOTE_CRED         0x51
 | 
|---|
| 135 | #define SECPKG_ATTR_LOCAL_CRED          0x52
 | 
|---|
| 136 | #define SECPKG_ATTR_REMOTE_CERT_CONTEXT 0x53
 | 
|---|
| 137 | #define SECPKG_ATTR_LOCAL_CERT_CONTEXT  0x54
 | 
|---|
| 138 | #define SECPKG_ATTR_ROOT_STORE          0x55
 | 
|---|
| 139 | #define SECPKG_ATTR_SUPPORTED_ALGS      0x56
 | 
|---|
| 140 | #define SECPKG_ATTR_CIPHER_STRENGTHS    0x57
 | 
|---|
| 141 | #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 0x58
 | 
|---|
| 142 | #define SECPKG_ATTR_ISSUER_LIST_EX      0x59
 | 
|---|
| 143 | #define SECPKG_ATTR_CONNECTION_INFO     0x5a
 | 
|---|
| 144 | #define SECPKG_ATTR_EAP_KEY_BLOCK       0x5b
 | 
|---|
| 145 | #define SECPKG_ATTR_MAPPED_CRED_ATTR    0x5c
 | 
|---|
| 146 | #define SECPKG_ATTR_SESSION_INFO        0x5d
 | 
|---|
| 147 | #define SECPKG_ATTR_APP_DATA            0x5e
 | 
|---|
| 148 | 
 | 
|---|
| 149 | #define UNISP_RPC_ID 14
 | 
|---|
| 150 | 
 | 
|---|
| 151 | struct _HMAPPER;
 | 
|---|
| 152 | 
 | 
|---|
| 153 | typedef struct _SCHANNEL_CRED
 | 
|---|
| 154 | {
 | 
|---|
| 155 |     DWORD dwVersion;
 | 
|---|
| 156 |     DWORD cCreds;
 | 
|---|
| 157 |     PCCERT_CONTEXT *paCred;
 | 
|---|
| 158 |     HCERTSTORE hRootStore;
 | 
|---|
| 159 |     DWORD cMappers;
 | 
|---|
| 160 |     struct _HMAPPER **aphMappers;
 | 
|---|
| 161 |     DWORD cSupportedAlgs;
 | 
|---|
| 162 |     ALG_ID *palgSupportedAlgs;
 | 
|---|
| 163 |     DWORD grbitEnabledProtocols;
 | 
|---|
| 164 |     DWORD dwMinimumCipherStrength;
 | 
|---|
| 165 |     DWORD dwMaximumCipherStrength;
 | 
|---|
| 166 |     DWORD dwSessionLength;
 | 
|---|
| 167 |     DWORD dwFlags;
 | 
|---|
| 168 |     DWORD reserved;
 | 
|---|
| 169 | } SCHANNEL_CRED, *PSCHANNEL_CRED;
 | 
|---|
| 170 | 
 | 
|---|
| 171 | typedef struct _SecPkgCred_SupportedAlgs
 | 
|---|
| 172 | {
 | 
|---|
| 173 |     DWORD cSupportedAlgs;
 | 
|---|
| 174 |     ALG_ID *palgSupportedAlgs;
 | 
|---|
| 175 | } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
 | 
|---|
| 176 | 
 | 
|---|
| 177 | typedef struct _SecPkgCred_CipherStrengths
 | 
|---|
| 178 | {
 | 
|---|
| 179 |     DWORD dwMinimumCipherStrength;
 | 
|---|
| 180 |     DWORD dwMaximumCipherStrength;
 | 
|---|
| 181 | } SecPkgCred_CipherStrengths, *PSecPkgCred_CipherStrengths;
 | 
|---|
| 182 | 
 | 
|---|
| 183 | typedef struct _SecPkgCred_SupportedProtocols
 | 
|---|
| 184 | {
 | 
|---|
| 185 |     DWORD grbitProtocol;
 | 
|---|
| 186 | } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols;
 | 
|---|
| 187 | 
 | 
|---|
| 188 | typedef struct _SecPkgContext_IssuerListInfoEx
 | 
|---|
| 189 | {
 | 
|---|
| 190 |     PCERT_NAME_BLOB aIssuers;
 | 
|---|
| 191 |     DWORD cIssuers;
 | 
|---|
| 192 | } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx;
 | 
|---|
| 193 | 
 | 
|---|
| 194 | typedef struct _SecPkgContext_ConnectionInfo
 | 
|---|
| 195 | {
 | 
|---|
| 196 |     DWORD dwProtocol;
 | 
|---|
| 197 |     ALG_ID aiCipher;
 | 
|---|
| 198 |     DWORD dwCipherStrength;
 | 
|---|
| 199 |     ALG_ID aiHash;
 | 
|---|
| 200 |     DWORD dwHashStrength;
 | 
|---|
| 201 |     ALG_ID aiExch;
 | 
|---|
| 202 |     DWORD dwExchStrength;
 | 
|---|
| 203 | } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;
 | 
|---|
| 204 | 
 | 
|---|
| 205 | #endif /* __WINE_SCHANNEL_H__ */
 | 
|---|