1 #ifndef _SCHANNEL_H 2 #define _SCHANNEL_H 3 4 #include <wincrypt.h> 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #define SCHANNEL_NAME_A "Schannel" 11 #define SCHANNEL_NAME_W L"Schannel" 12 #ifdef UNICODE 13 #define SCHANNEL_NAME SCHANNEL_NAME_W 14 #else 15 #define SCHANNEL_NAME SCHANNEL_NAME_A 16 #endif 17 18 #define SCH_CRED_V1 1 19 #define SCH_CRED_V2 2 20 #define SCH_CRED_VERSION 2 21 #define SCH_CRED_V3 3 22 #define SCHANNEL_CRED_VERSION 4 23 24 #define SCHANNEL_RENEGOTIATE 0 25 #define SCHANNEL_SHUTDOWN 1 26 #define SCHANNEL_ALERT 2 27 #define SCHANNEL_SESSION 3 28 29 #define SP_PROT_SSL2_CLIENT 8 30 #define SP_PROT_SSL3_CLIENT 32 31 #define SP_PROT_TLS1_CLIENT 128 32 #define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT 33 #define SP_PROT_TLS1_1_CLIENT 512 34 #define SP_PROT_TLS1_2_CLIENT 2048 35 #define SP_PROT_TLS1_3_CLIENT 8192 36 37 #define SP_PROT_SSL2_SERVER 4 38 #define SP_PROT_SSL3_SERVER 16 39 #define SP_PROT_TLS1_SERVER 64 40 #define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER 41 #define SP_PROT_TLS1_1_SERVER 256 42 #define SP_PROT_TLS1_2_SERVER 1024 43 44 #define SP_PROT_PCT1_CLIENT 2 45 #define SP_PROT_PCT1_SERVER 1 46 47 #define SP_PROT_TLS1 (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER) 48 #define SP_PROT_SSL3 (SP_PROT_SSL3_CLIENT | SP_PROT_SSL3_SERVER) 49 #define SP_PROT_SSL2 (SP_PROT_SSL2_CLIENT | SP_PROT_SSL2_SERVER) 50 #define SP_PROT_PCT1 (SP_PROT_PCT1_CLIENT | SP_PROT_PCT1_SERVER) 51 52 #define SP_PROT_TLS1_1PLUS_CLIENT (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT) 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_USE_DEFAULT_CREDS 64 60 #define SCH_CRED_REVOCATION_CHECK_CHAIN_END_CERT 256 61 #define SCH_CRED_REVOCATION_CHECK_CHAIN 512 62 #define SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 1024 63 #define SCH_CRED_IGNORE_NO_REVOCATION_CHECK 2048 64 #define SCH_CRED_IGNORE_REVOCATION_OFFLINE 4096 65 66 #define SECPKG_ATTR_ISSUER_LIST 0x50 67 #define SECPKG_ATTR_REMOTE_CRED 0x51 68 #define SECPKG_ATTR_LOCAL_CRED 0x52 69 #define SECPKG_ATTR_REMOTE_CERT_CONTEXT 0x53 70 #define SECPKG_ATTR_LOCAL_CERT_CONTEXT 0x54 71 #define SECPKG_ATTR_ROOT_STORE 0x55 72 #define SECPKG_ATTR_SUPPORTED_ALGS 0x56 73 #define SECPKG_ATTR_CIPHER_STRENGTHS 0x57 74 #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 0x58 75 #define SECPKG_ATTR_ISSUER_LIST_EX 0x59 76 #define SECPKG_ATTR_CONNECTION_INFO 0x5a 77 #define SECPKG_ATTR_EAP_KEY_BLOCK 0x5b 78 #define SECPKG_ATTR_MAPPED_CRED_ATTR 0x5c 79 #define SECPKG_ATTR_SESSION_INFO 0x5d 80 #define SECPKG_ATTR_APP_DATA 0x5e 81 82 #define UNISP_RPC_ID 14 83 84 struct _HMAPPER; 85 86 typedef struct _SCHANNEL_CRED 87 { 88 DWORD dwVersion; 89 DWORD cCreds; 90 PCCERT_CONTEXT *paCred; 91 HCERTSTORE hRootStore; 92 DWORD cMappers; 93 struct _HMAPPER **aphMappers; 94 DWORD cSupportedAlgs; 95 ALG_ID *palgSupportedAlgs; 96 DWORD grbitEnabledProtocols; 97 DWORD dwMinimumCipherStrength; 98 DWORD dwMaximumCipherStrength; 99 DWORD dwSessionLifespan; 100 DWORD dwFlags; 101 DWORD dwCredFormat; 102 } SCHANNEL_CRED, *PSCHANNEL_CRED; 103 104 typedef struct _SecPkgCred_SupportedAlgs 105 { 106 DWORD cSupportedAlgs; 107 ALG_ID *palgSupportedAlgs; 108 } SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs; 109 110 typedef struct _SecPkgCred_CipherStrengths 111 { 112 DWORD dwMinimumCipherStrength; 113 DWORD dwMaximumCipherStrength; 114 } SecPkgCred_CipherStrengths, *PSecPkgCred_CipherStrengths; 115 116 typedef struct _SecPkgCred_SupportedProtocols 117 { 118 DWORD grbitProtocol; 119 } SecPkgCred_SupportedProtocols, *PSecPkgCred_SupportedProtocols; 120 121 typedef struct _SecPkgContext_IssuerListInfoEx 122 { 123 PCERT_NAME_BLOB aIssuers; 124 DWORD cIssuers; 125 } SecPkgContext_IssuerListInfoEx, *PSecPkgContext_IssuerListInfoEx; 126 127 typedef struct _SecPkgContext_ConnectionInfo 128 { 129 DWORD dwProtocol; 130 ALG_ID aiCipher; 131 DWORD dwCipherStrength; 132 ALG_ID aiHash; 133 DWORD dwHashStrength; 134 ALG_ID aiExch; 135 DWORD dwExchStrength; 136 } SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo; 137 138 #ifdef __cplusplus 139 } 140 #endif 141 142 #endif /* _SCHANNEL_H */ 143