-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for TLS v1.3 #86
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef WINTLS_DETAIL_SSPI_COMPAT_HPP | ||
#define WINTLS_DETAIL_SSPI_COMPAT_HPP | ||
|
||
// for SCH_CREDENTIALS | ||
#ifndef SCHANNEL_USE_BLACKLISTS | ||
#define SCHANNEL_USE_BLACKLISTS | ||
#define WINTLS_SCHANNEL_USE_BLACKLISTS_DEFINED | ||
#endif // SCHANNEL_USE_BLACKLISTS | ||
|
||
#include <sdkddkver.h> | ||
#include <SubAuth.h> | ||
#include <schannel.h> | ||
|
||
#if (WDK_NTDDI_VERSION < NTDDI_WIN10_19H1) | ||
typedef enum _eTlsAlgorithmUsage | ||
{ | ||
TlsParametersCngAlgUsageKeyExchange, | ||
TlsParametersCngAlgUsageSignature, | ||
TlsParametersCngAlgUsageCipher, | ||
TlsParametersCngAlgUsageDigest, | ||
TlsParametersCngAlgUsageCertSig | ||
} eTlsAlgorithmUsage; | ||
|
||
typedef struct _CRYPTO_SETTINGS | ||
{ | ||
eTlsAlgorithmUsage eAlgorithmUsage; | ||
UNICODE_STRING strCngAlgId; | ||
DWORD cChainingModes; | ||
PUNICODE_STRING rgstrChainingModes; | ||
DWORD dwMinBitLength; | ||
DWORD dwMaxBitLength; | ||
} CRYPTO_SETTINGS, * PCRYPTO_SETTINGS; | ||
|
||
typedef struct _TLS_PARAMETERS | ||
{ | ||
DWORD cAlpnIds; | ||
PUNICODE_STRING rgstrAlpnIds; | ||
DWORD grbitDisabledProtocols; | ||
DWORD cDisabledCrypto; | ||
PCRYPTO_SETTINGS pDisabledCrypto; | ||
DWORD dwFlags; | ||
} TLS_PARAMETERS, * PTLS_PARAMETERS; | ||
|
||
typedef struct _SCH_CREDENTIALS | ||
{ | ||
DWORD dwVersion; | ||
DWORD dwCredFormat; | ||
DWORD cCreds; | ||
PCCERT_CONTEXT* paCred; | ||
HCERTSTORE hRootStore; | ||
|
||
DWORD cMappers; | ||
struct _HMAPPER **aphMappers; | ||
|
||
DWORD dwSessionLifespan; | ||
DWORD dwFlags; | ||
DWORD cTlsParameters; | ||
PTLS_PARAMETERS pTlsParameters; | ||
} SCH_CREDENTIALS, * PSCH_CREDENTIALS; | ||
#endif // (NTDDI_VERSION < NTDDI_WIN10_19H1) | ||
|
||
#ifdef WINTLS_SCHANNEL_USE_BLACKLISTS_DEFINED | ||
#undef SCHANNEL_USE_BLACKLISTS | ||
#endif // WINTLS_SCHANNEL_USE_BLACKLISTS_DEFINED | ||
|
||
#endif // WINTLS_DETAIL_SSPI_COMPAT_HPP |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
#define WINTLS_UNICODE_UNDEFINED | ||
#endif // UNICODE | ||
|
||
#include <schannel.h> | ||
#include <wintls/detail/sspi_compat.hpp> | ||
#include <security.h> | ||
|
||
#ifdef WINTLS_SECURITY_WIN32_DEFINED | ||
|
@@ -29,4 +29,5 @@ | |
#define UNICODE | ||
#endif // WINTLS_UNICODE_UNDEFINED | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mentioned that these structs only needed to be defined when building on some older versions of Windows. Could you please move them to an appropriately named header file and then only include that file if we are building on a version of Windows where they are needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already moved to |
||
#endif // WINTLS_DETAIL_SSPI_TYPES_HPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To play nicer with clients I think this should be guarded by an ifdef similar to what is done with
SECURITY_WIN32
andUNICODE
insspi_types.h
so it keeps being either defined or not after this header has been included, eg. guard it withWINTLS_SCHANNEL_USE_BLACKLISTS
and undefine it if it wasn't already defined.