#include "common.h"
#if defined(MBEDTLS_SSL_TICKET_C)
#include "mbedtls/platform.h"
#include "ssl_misc.h"
#include "mbedtls/ssl_ticket.h"
#include "mbedtls/error.h"
#include "mbedtls/platform_util.h"
#include <string.h>
#if defined(MBEDTLS_USE_PSA_CRYPTO)
static int local_err_translation(psa_status_t status)
{
return psa_status_to_mbedtls(status, psa_to_ssl_errors,
ARRAY_LENGTH(psa_to_ssl_errors),
psa_generic_status_to_mbedtls);
}
#define PSA_TO_MBEDTLS_ERR …
#endif
void mbedtls_ssl_ticket_init(mbedtls_ssl_ticket_context *ctx)
{ … }
#define MAX_KEY_BYTES …
#define TICKET_KEY_NAME_BYTES …
#define TICKET_IV_BYTES …
#define TICKET_CRYPT_LEN_BYTES …
#define TICKET_AUTH_TAG_BYTES …
#define TICKET_MIN_LEN …
#define TICKET_ADD_DATA_LEN …
MBEDTLS_CHECK_RETURN_CRITICAL
static int ssl_ticket_gen_key(mbedtls_ssl_ticket_context *ctx,
unsigned char index)
{ … }
MBEDTLS_CHECK_RETURN_CRITICAL
static int ssl_ticket_update_keys(mbedtls_ssl_ticket_context *ctx)
{ … }
int mbedtls_ssl_ticket_rotate(mbedtls_ssl_ticket_context *ctx,
const unsigned char *name, size_t nlength,
const unsigned char *k, size_t klength,
uint32_t lifetime)
{ … }
int mbedtls_ssl_ticket_setup(mbedtls_ssl_ticket_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
mbedtls_cipher_type_t cipher,
uint32_t lifetime)
{ … }
int mbedtls_ssl_ticket_write(void *p_ticket,
const mbedtls_ssl_session *session,
unsigned char *start,
const unsigned char *end,
size_t *tlen,
uint32_t *ticket_lifetime)
{ … }
static mbedtls_ssl_ticket_key *ssl_ticket_select_key(
mbedtls_ssl_ticket_context *ctx,
const unsigned char name[4])
{ … }
int mbedtls_ssl_ticket_parse(void *p_ticket,
mbedtls_ssl_session *session,
unsigned char *buf,
size_t len)
{ … }
void mbedtls_ssl_ticket_free(mbedtls_ssl_ticket_context *ctx)
{ … }
#endif