webrtc_dtls13_msg (webrtc v0.1.0)
View SourceDTLS 1.3 handshake message and extension codec (RFC 8446 §4, RFC 9147 §5). ClientHello and ServerHello share the DTLS 1.2 layout and are handled by webrtc_dtls_msg; this module covers the messages and extensions that only exist in (D)TLS 1.3.
decode/2 and ext/3 never raise: malformed input gives {error, decode_error}.
Summary
Functions
The ClientHello pre_shared_key extension with one identity and a binder of BinderLen zero octets, filled by the caller (it must be the last extension, RFC 8446 §4.2.11).
The connection ID we want to receive (RFC 9146 §3).
early_data, empty in ClientHello and EncryptedExtensions (RFC 8446 §4.2.10).
Decode a 1.3 extension carried as {Type, Data} by the hello codec, in the context of the message that carried it.
True for the message types decode/2 handles.
The synthetic message_hash message replacing ClientHello1 in the transcript after a HelloRetryRequest (RFC 8446 §4.4.1).
psk_key_exchange_modes with psk_dhe_ke only: resumption keeps (EC)DHE and forward secrecy (RFC 8446 §4.2.9).
The ServerHello pre_shared_key extension.
A handshake message as it enters the DTLS 1.3 transcript: the TLS 1.3 header without message_seq and fragment fields (RFC 9147 §5.2).
Functions
-spec client_psk_ext(binary(), 0..4294967295, pos_integer()) -> {41, binary()}.
The ClientHello pre_shared_key extension with one identity and a binder of BinderLen zero octets, filled by the caller (it must be the last extension, RFC 8446 §4.2.11).
The connection ID we want to receive (RFC 9146 §3).
-spec early_data_ext() -> {42, binary()}.
early_data, empty in ClientHello and EncryptedExtensions (RFC 8446 §4.2.10).
-spec ext(client_hello | server_hello | hello_retry_request, atom(), [{term(), term()}]) -> undefined | {ok, term()} | {error, decode_error}.
Decode a 1.3 extension carried as {Type, Data} by the hello codec, in the context of the message that carried it.
-spec hrr_group_ext(0..65535) -> {51, binary()}.
True for the message types decode/2 handles.
The synthetic message_hash message replacing ClientHello1 in the transcript after a HelloRetryRequest (RFC 8446 §4.4.1).
-spec psk_modes_ext() -> {45, binary()}.
psk_key_exchange_modes with psk_dhe_ke only: resumption keeps (EC)DHE and forward secrecy (RFC 8446 §4.2.9).
-spec selected_version_ext() -> {43, binary()}.
-spec server_psk_ext(0..65535) -> {41, binary()}.
The ServerHello pre_shared_key extension.
-spec supported_versions_ext([0..65535]) -> {43, binary()}.
-spec transcript_msg(webrtc_dtls_msg:msg_type(), binary()) -> binary().
A handshake message as it enters the DTLS 1.3 transcript: the TLS 1.3 header without message_seq and fragment fields (RFC 9147 §5.2).