ngtcp2_conn_install_0rtt_key
Synopsis
#include <ngtcp2/ngtcp2.h>
-
int ngtcp2_conn_install_0rtt_key(ngtcp2_conn *conn, const ngtcp2_crypto_aead_ctx *aead_ctx, const uint8_t *iv, size_t ivlen, const ngtcp2_crypto_cipher_ctx *hp_ctx)
ngtcp2_conn_install_0rtt_key()
installs packet protection AEAD cipher context object aead_ctx, IV iv of length ivlen, and packet header protection cipher context object hp_ctx to encrypt (for client) or decrypt (for server) 0-RTT packets.ivlen must be the minimum length of AEAD nonce, or 8 bytes if that is larger.
If this function succeeds, conn takes ownership of aead_ctx and hp_ctx.
ngtcp2_callbacks.delete_crypto_aead_ctx
andngtcp2_callbacks.delete_crypto_cipher_ctx
will be called to delete these objects when they are no longer used. If this function fails, the caller is responsible to delete them.This function returns 0 if it succeeds, or one of the following negative error codes:
NGTCP2_ERR_NOMEM
Out of memory.