RetroArch
Macros | Functions
ssl_cookie.c File Reference
#include "mbedtls/config.h"
#include "mbedtls/platform.h"
#include "mbedtls/ssl_cookie.h"
#include "mbedtls/ssl_internal.h"
#include <string.h>
#include "arc4_alt.h"
Include dependency graph for ssl_cookie.c:

Macros

#define COOKIE_MD   MBEDTLS_MD_SHA224
 
#define COOKIE_MD_OUTLEN   32
 
#define COOKIE_HMAC_LEN   28
 
#define COOKIE_LEN   ( 4 + COOKIE_HMAC_LEN )
 

Functions

void mbedtls_ssl_cookie_init (mbedtls_ssl_cookie_ctx *ctx)
 Initialize cookie context. More...
 
void mbedtls_ssl_cookie_set_timeout (mbedtls_ssl_cookie_ctx *ctx, unsigned long delay)
 Set expiration delay for cookies (Default MBEDTLS_SSL_COOKIE_TIMEOUT) More...
 
void mbedtls_ssl_cookie_free (mbedtls_ssl_cookie_ctx *ctx)
 Free cookie context. More...
 
int mbedtls_ssl_cookie_setup (mbedtls_ssl_cookie_ctx *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
 Setup cookie context (generate keys) More...
 
static int ssl_cookie_hmac (mbedtls_md_context_t *hmac_ctx, const unsigned char time[4], unsigned char **p, unsigned char *end, const unsigned char *cli_id, size_t cli_id_len)
 
int mbedtls_ssl_cookie_write (void *p_ctx, unsigned char **p, unsigned char *end, const unsigned char *cli_id, size_t cli_id_len)
 
int mbedtls_ssl_cookie_check (void *p_ctx, const unsigned char *cookie, size_t cookie_len, const unsigned char *cli_id, size_t cli_id_len)
 

Macro Definition Documentation

◆ COOKIE_HMAC_LEN

#define COOKIE_HMAC_LEN   28

◆ COOKIE_LEN

#define COOKIE_LEN   ( 4 + COOKIE_HMAC_LEN )

◆ COOKIE_MD

#define COOKIE_MD   MBEDTLS_MD_SHA224

◆ COOKIE_MD_OUTLEN

#define COOKIE_MD_OUTLEN   32

Function Documentation

◆ mbedtls_ssl_cookie_check()

int mbedtls_ssl_cookie_check ( void p_ctx,
const unsigned char *  cookie,
size_t  cookie_len,
const unsigned char *  cli_id,
size_t  cli_id_len 
)
Here is the call graph for this function:

◆ mbedtls_ssl_cookie_free()

void mbedtls_ssl_cookie_free ( mbedtls_ssl_cookie_ctx ctx)

Free cookie context.

Here is the call graph for this function:

◆ mbedtls_ssl_cookie_init()

void mbedtls_ssl_cookie_init ( mbedtls_ssl_cookie_ctx ctx)

Initialize cookie context.

Here is the call graph for this function:

◆ mbedtls_ssl_cookie_set_timeout()

void mbedtls_ssl_cookie_set_timeout ( mbedtls_ssl_cookie_ctx ctx,
unsigned long  delay 
)

Set expiration delay for cookies (Default MBEDTLS_SSL_COOKIE_TIMEOUT)

Parameters
ctxCookie contex
delayDelay, in seconds if HAVE_TIME, or in number of cookies issued in the meantime. 0 to disable expiration (NOT recommended)

◆ mbedtls_ssl_cookie_setup()

int mbedtls_ssl_cookie_setup ( mbedtls_ssl_cookie_ctx ctx,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)

Setup cookie context (generate keys)

Here is the call graph for this function:

◆ mbedtls_ssl_cookie_write()

int mbedtls_ssl_cookie_write ( void p_ctx,
unsigned char **  p,
unsigned char *  end,
const unsigned char *  cli_id,
size_t  cli_id_len 
)
Here is the call graph for this function:

◆ ssl_cookie_hmac()

static int ssl_cookie_hmac ( mbedtls_md_context_t hmac_ctx,
const unsigned char  time[4],
unsigned char **  p,
unsigned char *  end,
const unsigned char *  cli_id,
size_t  cli_id_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: