Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Mobile.Tls13Handshake

NEW UNIT (TLS 1.3).

  Wire-level encode/decode for the TLS 1.3-specific handshake extensions and
  messages, kept separate from the (TLS 1.2) state machine in
  StreamSec.Mobile.Tls so that the existing code is untouched. The handshake
  DRIVER (TTLS_HandshakeProtocol in StreamSec.Mobile.TlsLayer) calls these from
  HandleClientHello / HandleServerHello / the post-ServerHello flight; the
  integration points are noted in comments.

  It REUSES:
    * tBytes / byte helpers from stDERUtils, hashing from stSecUtils;
    * the HKDF key schedule in StreamSec.Mobile.Tls13KeySchedule (for the
      Finished verify_data).

  Versions, groups and signature schemes are handled as their 16-bit wire
  values (TTls13WordArray) to keep this unit independent of the heavier
  StreamSec.Mobile.Tls state-machine unit. It does NOT do key agreement: the
  caller supplies the raw key_share public bytes (computed by the existing
  EC/FFC code) and the resulting shared secret (fed to the key schedule).

Feature notes: TLS implementation notes (RFC map)

Classes, interfaces and records

recordTTls13PskOffer

One entry of the client's OfferedPsks (RFC 8446 sec.4.2.11): a ticket identity + its obfuscated_ticket_age, paired positionally with its PskBinderEntry.

Identity: tBytes; ObfAge: UInt32; Binder: tBytes;

classTTls13Transcript

Running transcript for the TLS 1.3 key schedule and Finished/CertificateVerify (RFC 8446 sec.4.4.1). The driver feeds every handshake message (the raw msg_type||length||body bytes, in order) via Update, and reads CurrentHash at the points the RFC requires (ClientHello..ServerHello, ..server Finished, ..client Finished). Messages are buffered and hashed on demand, which keeps the implementation independent of any incremental-hash cloning support.

constructor Create(aHashClass: THashClass); procedure Update(const aMessage: tBytes); function CurrentHash: tBytes;
Delegates to TTls13KeySchedule.TranscriptHash, forwarding fHashClass and fData, and returns its result.
procedure SwitchToMessageHash;
On HelloRetryRequest the transcript is replaced by the synthetic "message_hash" message wrapping Hash(ClientHello1) (RFC 8446 sec.4.4.1).
property HashClass: THashClass read fHashClass;

Types (enumerations, sets, aliases)

arrayTTls13WordArray

  TTls13WordArray = array of Word;

arrayTTls13PskOfferArray

  TTls13PskOfferArray = array of TTls13PskOffer;

Routines