ddn.net.tls.tls12
TLS 1.2 handshake engine (RFC 5246).
Implements TLS 1.2 client and server handshakes as resumable state machines with ECDHE key exchange and AES-GCM cipher suites.
Types 4
TLS 1.2 client handshake phases.
Each phase represents a discrete step in the client handshake state machine. The handshake progresses forward through these phases.
TLS 1.2 client handshake engine.
Drives the client side of a TLS 1.2 handshake over a record layer using a resumable state machine. After successful handshake, provides the AEAD cipher and negotiated parameters for application data exchange.
Call handshake() repeatedly until it returns TlsProgress.DONE.
RecordLayer recordLayer_Tls12Prf prf_TranscriptHash transcript_string serverName_TlsVerifyMode verifyMode_TlsVerifyCallback verifyCallback_string[] alpnProtocols_NativeTlsTrustStore trustStore_string negotiatedAlpn_CipherSuiteId negotiatedCipher_ProtocolVersion negotiatedVersion_ubyte[32] clientRandom_ubyte[32] serverRandom_ubyte[] preMasterSecret_ubyte[] masterSecret_X25519PrivateKey ecdhePrivate_EcdhP256Store * ecdhP256Store_NamedGroup selectedGroup_TlsCertificateChain peerCerts_TlsSession tlsSession_TlsAead clientWriteAead_TlsAead serverReadAead_Tls12HandshakePhase phase_SecureRandom rng_TlsProgress handshake()Performs or continues the TLS 1.2 client handshake.ubyte[] buildClientHello(SecureRandom rng)void processServerHello(TlsRecord rec)void processCertificate(TlsRecord rec)void verifyPeerCertificates()void processServerKeyExchange(TlsRecord rec)void verifyServerKeyExchangeSignature(SignatureScheme sigScheme,
const(ubyte)[] signature, const(ubyte)[] message)void processServerHelloDone(TlsRecord rec)void updateTranscriptAndPushRemaining(TlsRecord rec, const(ubyte)[] data)ubyte[] buildClientKeyExchange()void deriveKeys()ubyte[] buildFinished()void processChangeCipherSpec(TlsRecord rec)void processServerFinished(TlsRecord rec)ubyte[] encryptRecord(ubyte[] handshakeMsg, TlsAead aead)ubyte[] tls12Aad(ContentType contentType, size_t payloadLen, ulong seqNum)Tls13TrafficKeys makeTrafficKeys(const(ubyte)[] key, const(ubyte)[] iv, size_t keyLen)this(RecordLayer recordLayer, string serverName,
TlsVerifyMode verifyMode, TlsVerifyCallback verifyCallback,
string[] alpnProtocols, NativeTlsTrustStore trustStore = null)Constructs a TLS 1.2 client handshake engine.EcdhP256StoreHeap storage for EcdhP256 since it's a struct.TLS 1.2 server handshake phases.
Each phase represents a discrete step in the server handshake state machine. The handshake progresses forward through these phases.
TLS 1.2 server handshake engine.
Drives the server side of a TLS 1.2 handshake over a record layer using a resumable state machine. After successful handshake, provides the AEAD ciphers and negotiated parameters for application data exchange.
Call handshake() repeatedly until it returns TlsProgress.DONE.
RecordLayer recordLayer_Tls12Prf prf_TranscriptHash transcript_TlsVerifyMode verifyMode_TlsVerifyCallback verifyCallback_string[] alpnProtocols_string negotiatedAlpn_CipherSuiteId negotiatedCipher_ProtocolVersion negotiatedVersion_string serverName_TlsCertificateChain peerCerts_TlsSession tlsSession_ubyte[32] clientRandom_ubyte[32] serverRandom_ubyte[] preMasterSecret_ubyte[] masterSecret_X25519PrivateKey ecdhePrivate_TlsAead clientReadAead_TlsAead serverWriteAead_ubyte[][] serverCertChainDer_string serverPrivateKeyPem_PrivateKey privateKey_SignatureScheme sigScheme_Tls12ServerHandshakePhase phase_SecureRandom rng_TlsProgress handshake()Performs or continues the TLS 1.2 server handshake.void processClientHello(TlsRecord rec)void parseServerName(const(ubyte)[] extData)void parseClientAlpn(const(ubyte)[] extData)void selectCipherSuite(CipherSuiteId[] clientCiphers)ubyte[] buildServerHello(SecureRandom rng)ubyte[] buildCertificate()ubyte[] buildServerKeyExchange(SecureRandom rng)ubyte[] buildServerHelloDone()void processClientKeyExchange(TlsRecord rec)void deriveKeys()void processChangeCipherSpec(TlsRecord rec)void processClientFinished(TlsRecord rec)ubyte[] buildServerFinished()ubyte[] encryptRecord(ubyte[] handshakeMsg, TlsAead aead)ubyte[] tls12Aad(ContentType contentType, size_t payloadLen, ulong seqNum)void parsePrivateKey()ubyte[] computeSignature(const(ubyte)[] message)this(RecordLayer recordLayer, TlsVerifyMode verifyMode,
TlsVerifyCallback verifyCallback, string[] alpnProtocols,
ubyte[][] certChainDer, string certChainPem, string privateKeyPem)Constructs a TLS 1.2 server handshake engine.Functions 1
bool verifyRsaPkcs1Signature(RSAPublicKey key, SignatureScheme sigScheme,
const(ubyte)[] message, const(ubyte)[] signature)Verifies an RSA PKCS#1 v1.5 signature for TLS 1.2 `ServerKeyExchange`.