Server Hello/Hello Retry Request

class siotls.contents.handshakes.server_hello.HelloRetryRequest

Hello Retry Request handshake as defined in RFC 8446 Section 4.1.4. Replies to a ClientHello when that message lacks a KeyShareRequest entry for the server’s selected key exchange algorithm. Mandates the client to try again, this time with a valid key share request.

cipher_suite: CipherSuites | int

The cipher suite that will be used to encrypt this connection.

Selected from the Client Hello’s cipher_suites according to the server’s preference in its TLSConfiguration cipher_suites.

extensions: dict[ExtensionType | int, Extension]

Same as ServerHello.extensions but KeyShareRetry must be present.

msg_type: HandshakeType | HandshakeType_ = 2

The numeric identifier for both ServerHello and HelloRetryRequest.

This message is indeed a Hello Retry Request only if random is equal to:

b'\xcf!\xadt\xe5\x9aa\x11\xbe\x1d\x8c\x02\x1ee\xb8\x91\xc2\xa2\x11\x16z\xbb\x8c^\x07\x9e\t\xe2\xc8\xa83\x9c'
random: bytes = b'\xcf!\xadt\xe5\x9aa\x11\xbe\x1d\x8c\x02\x1ee\xb8\x91\xc2\xa2\x11\x16z\xbb\x8c^\x07\x9e\t\xe2\xc8\xa83\x9c'

A fake random value that is actually the sha256 of b"HelloRetryRequest" and that is used to desambiguate this handshake from ServerHello.

class siotls.contents.handshakes.server_hello.ServerHello

Server Hello handshake as defined in RFC 8446 Section 4.1.2. Conveys the server’s selected cryptographic algorithms and other parameters required to setup encryption.

Note: this handshake, together with ClientHello, are the only two messages that are not encrypted.

See also EncryptedExtensions that follow this handshake and that conveys the other extensions, but encrypted.

__init__(random, legacy_session_id_echo, cipher_suite, extensions)
Parameters:

extensions (list[Extension])

cipher_suite: CipherSuites | int

The cipher suite that will be used to encrypt this connection.

Selected from the Client Hello’s cipher_suites according to the server’s preference in its TLSConfiguration cipher_suites.

extensions: dict[ExtensionType | int, Extension]

The extensions, indexed by siotls.iana.ExtensionType, that finalize the negotiation of cryptographic settings and other parameters required to setup encryption.

msg_type: HandshakeType | HandshakeType_ = 2

The numeric identifier for both ServerHello and HelloRetryRequest.

This message is indeed a Server Hello only if random is different from HelloRetryRequest.random.

random: bytes

32 bytes generated by a secure random number generator.