Function s2n_tls_sys::s2n_psk_set_secret

source ·
pub unsafe extern "C" fn s2n_psk_set_secret(
    psk: *mut s2n_psk,
    secret: *const u8,
    secret_size: u16
) -> c_int
Expand description

Sets the out-of-band/externally provisioned secret for a given external PSK object.

§Safety

Note that the secret is copied into s2n-tls memory and the caller is responsible for freeing the memory associated with the secret input.

Deriving a shared secret from a password or other low-entropy source is not secure and is subject to dictionary attacks. See https://tools.ietf.org/rfc/rfc8446#section-2.2 for more information.

@param psk A pointer to a PSK object to be updated with the secret. @param secret The secret in raw bytes format to be copied. @param secret_size The length of the pre-shared secret being set.