Documentation

Documentation

Includes

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

threading.h

#include "threading.h"
#include "threading.h"

Macros

#define MBEDTLS_SSL_COOKIE_H


      
      
#define MBEDTLS_SSL_COOKIE_TIMEOUT    60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */

      

Functions

void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx );
/**
 * \brief          Initialize cookie context
 */
int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng );
/**
 * \brief          Setup cookie context (generate keys)
 */
void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay );
/**
 * \brief          Set expiration delay for cookies
 *                 (Default MBEDTLS_SSL_COOKIE_TIMEOUT)
 *
 * \param ctx      Cookie contex
 * \param delay    Delay, in seconds if HAVE_TIME, or in number of cookies
 *                 issued in the meantime.
 *                 0 to disable expiration (NOT recommended)
 */
void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx );
/**
 * \brief          Free cookie context
 */

Vars

mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write;
/**
 * \brief          Generate cookie, see \c mbedtls_ssl_cookie_write_t
 */
mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check;
/**
 * \brief          Verify cookie, see \c mbedtls_ssl_cookie_write_t
 */

Consts

Types

Typedefs

typedef struct mbedtls_ssl_cookie_ctx
{
   mbedtls_md_context_t   hmac_ctx;  /*!< context for the HMAC portion   */
#if !defined(MBEDTLS_HAVE_TIME)
   unsigned long  serial;    /*!< serial number for expiration   */
#endif
   unsigned long  timeout;   /*!< timeout delay, in seconds if HAVE_TIME,
                                     or in number of tickets issued */

#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;
#endif
} mbedtls_ssl_cookie_ctx;
/**
 * \brief          Context for the default cookie functions.
 */