ngtcp2_crypto_generate_retry_token
Synopsis
#include <ngtcp2/ngtcp2_crypto.h>
-
ngtcp2_ssize ngtcp2_crypto_generate_retry_token(uint8_t *token, const uint8_t *secret, size_t secretlen, uint32_t version, const ngtcp2_sockaddr *remote_addr, ngtcp2_socklen remote_addrlen, const ngtcp2_cid *retry_scid, const ngtcp2_cid *odcid, ngtcp2_tstamp ts)
ngtcp2_crypto_generate_retry_token()
generates a token in the buffer pointed by token that is sent with Retry packet. The buffer pointed by token must have at leastNGTCP2_CRYPTO_MAX_RETRY_TOKENLEN
bytes long. The successfully generated token starts withNGTCP2_CRYPTO_TOKEN_MAGIC_RETRY
. secret of length secretlen is a keying material to generate keys to encrypt the token. version is QUIC version. remote_addr of length remote_addrlen is an address of client. retry_scid is a Source Connection ID chosen by server, and set in Retry packet. odcid is a Destination Connection ID in Initial packet sent by client. ts is the timestamp when the token is generated.This function returns the length of generated token if it succeeds, or -1.