Function s2n_tls_sys::s2n_client_hello_get_raw_message

source ·
pub unsafe extern "C" fn s2n_client_hello_get_raw_message(
    ch: *mut s2n_client_hello,
    out: *mut u8,
    max_length: u32
) -> isize
Expand description

Copies max_length bytes of the ClientHello message into the out buffer. The ClientHello instrumented using this function will have the Random bytes zero-ed out.

Note: SSLv2 ClientHello messages follow a different structure than more modern ClientHello messages. See RFC5246. In addition, due to how s2n-tls parses SSLv2 ClientHellos, the raw message is missing the first three bytes (the msg_type and version) and instead begins with the cipher_specs. To determine whether a ClientHello is an SSLv2 ClientHello, you will need to use s2n_connection_get_client_hello_version(). To get the protocol version advertised in the SSLv2 ClientHello (which may be higher than SSLv2), you will need to use s2n_connection_get_client_protocol_version().

@param ch The Client Hello handle @param out The destination buffer for the raw Client Hello @param max_length The size of out in bytes @returns The number of copied bytes