eve.tls.windows.schannel
Windows SChannel TLS Implementation (EXPERIMENTAL)
WARNING: This module is experimental. The API may change and security properties have not been fully audited. Do not use in production without independent security review.
This module provides TLS/SSL support for Windows using the native SChannel (Secure Channel) SSPI provider. SChannel is the Windows built-in SSL/TLS implementation requiring no external dependencies.
The implementation wraps the SSPI API to provide a clean interface matching the eve.tls.api contract.
Version Compatibility:
- Minimum: Windows Vista / Server 2008 (SSPI base API)
- TLS 1.2: Fully supported (Windows 7 / Server 2008 R2+)
- ALPN: Windows 8.1 / Server 2012 R2+
- TLS 1.3: Windows 10 1809 / Server 2019+
SSPI bindings are locally declared and audited against Windows SDK headers. All type sizes use platform-correct widths (size_t for DWORD_PTR/UINT_PTR, uint for DWORD/ULONG, void* for opaque handles).
Copyright
Types 10
Security status codes
Credential handle
size_t dwLowersize_t dwUpperContext handle
size_t dwLowersize_t dwUpperTimestamp structure
uint dwLowDateTimeuint dwHighDateTimeSecurity buffer
uint cbBufferuint bufferTypevoid * pvBufferSecurity buffer descriptor
Stream sizes for encryption
uint cbHeaderuint cbTraileruint cbMaximumMessageuint cBuffersuint cbBlockSizeSChannel credentials
uint dwVersionuint cCredsvoid * * paCredvoid * hRootStoreuint cMappersvoid * * aphMappersuint cSupportedAlgsuint * palgSupportedAlgsuint grbitEnabledProtocolsuint dwMinimumCipherStrengthuint dwMaximumCipherStrengthuint dwSessionLifespanuint dwFlagsuint dwCredFormatSChannel credential handle wrapper.
Manages the lifecycle of SSPI credentials used for TLS connections. Credentials are acquired based on the TlsContext configuration and must be released when no longer needed.
TlsErrorCode initialize(ref const(TlsContext) ctx) @trusted nothrowInitialize credentials from a TLS context.SChannel TLS Stream.
Provides TLS encryption/decryption over an underlying transport. This struct wraps the SSPI/SChannel API to implement the TLS stream interface defined in eve.tls.api.
Parameters
Transport | The underlying transport type (must support read/write). |
TlsIoInterest ioInterest() const pure @safe nothrow @nogcGet the current I/O interest for the underlying transport.this(Transport * transport, TlsContext ctx)Construct a TLS stream over the given transport.Functions 2
Variables 66
SECPKG_CRED_OUTBOUND = 0x00000002SECPKG_CRED_INBOUND = 0x00000001ISC_REQ_SEQUENCE_DETECT = 0x00000008ISC_REQ_REPLAY_DETECT = 0x00000004ISC_REQ_CONFIDENTIALITY = 0x00000010ISC_REQ_USE_SUPPLIED_CREDS = 0x00000080ISC_REQ_ALLOCATE_MEMORY = 0x00000100ISC_REQ_STREAM = 0x00008000ISC_REQ_MANUAL_CRED_VALIDATION = 0x00080000ASC_REQ_SEQUENCE_DETECT = 0x00000008ASC_REQ_REPLAY_DETECT = 0x00000004ASC_REQ_CONFIDENTIALITY = 0x00000010ASC_REQ_ALLOCATE_MEMORY = 0x00000100ASC_REQ_STREAM = 0x00008000SECBUFFER_VERSION = 0SECBUFFER_EMPTY = 0SECBUFFER_DATA = 1SECBUFFER_TOKEN = 2SECBUFFER_EXTRA = 5SECBUFFER_STREAM_TRAILER = 6SECBUFFER_STREAM_HEADER = 7SECBUFFER_ALERT = 17SCHANNEL_CRED_VERSION = 4SCH_CRED_NO_DEFAULT_CREDS = 0x00000010SCH_CRED_MANUAL_CRED_VALIDATION = 0x00000008SCH_USE_STRONG_CRYPTO = 0x00400000SP_PROT_TLS1_0_CLIENT = 0x00000080SP_PROT_TLS1_0_SERVER = 0x00000040SP_PROT_TLS1_1_CLIENT = 0x00000200SP_PROT_TLS1_1_SERVER = 0x00000100SP_PROT_TLS1_2_CLIENT = 0x00000800SP_PROT_TLS1_2_SERVER = 0x00000400SP_PROT_TLS1_3_CLIENT = 0x00002000SP_PROT_TLS1_3_SERVER = 0x00001000SEC_E_OK = 0x00000000SEC_I_CONTINUE_NEEDED = 0x00090312SEC_E_INCOMPLETE_MESSAGE = 0x80090318SEC_I_INCOMPLETE_CREDENTIALS = 0x00090320SEC_I_CONTEXT_EXPIRED = 0x00090317SEC_E_INTERNAL_ERROR = 0x80090304SEC_E_INVALID_HANDLE = 0x80090301SEC_E_INVALID_TOKEN = 0x80090308SEC_E_CERT_EXPIRED = 0x80090328SEC_E_CERT_UNKNOWN = 0x80090327SEC_E_UNTRUSTED_ROOT = 0x80090325SEC_E_WRONG_PRINCIPAL = 0x80090322SECPKG_ATTR_STREAM_SIZES = 4SECPKG_ATTR_REMOTE_CERT_CONTEXT = 0x40SECPKG_ATTR_APPLICATION_PROTOCOL = 0x5CSECBUFFER_SEND_GENERIC_TLS_EXTENSION = 45SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS_Negotiated = 3SecPkgApplicationProtocolNegotiationExt_ALPN = 2TLS1_ALPN_EXTENSION = 0x0010SOCKET_ERROR = - 1WSAEWOULDBLOCK = 10035CERT_NAME_SIMPLE_DISPLAY_TYPE = 4CERT_NAME_ISSUER_FLAG = 0x00000001CERT_STORE_PROV_MEMORY = 2CERT_STORE_ADD_ALWAYS = 4X509_ASN_ENCODING = 0x00000001PKCS_7_ASN_ENCODING = 0x00010000CRYPT_STRING_BASE64HEADER = 0x00000000CRYPT_STRING_BASE64_ANY = 0x00000006PKCS12_NO_PERSIST_KEY = 0x00008000CERT_FIND_ANY = 0CERT_ENCODING_TYPE = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING