Mbed TLS v4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ssl_cookie.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright The Mbed TLS Contributors
8  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9  */
10 #ifndef MBEDTLS_SSL_COOKIE_H
11 #define MBEDTLS_SSL_COOKIE_H
12 #include "mbedtls/private_access.h"
13 
14 #include "mbedtls/build_info.h"
15 
16 #include "mbedtls/ssl.h"
17 
18 
26 #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT
27 #define MBEDTLS_SSL_COOKIE_TIMEOUT 60
28 #endif
29 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 typedef struct mbedtls_ssl_cookie_ctx {
40  mbedtls_svc_key_id_t MBEDTLS_PRIVATE(psa_hmac_key);
41  psa_algorithm_t MBEDTLS_PRIVATE(psa_hmac_alg);
42 #if !defined(MBEDTLS_HAVE_TIME)
43  unsigned long MBEDTLS_PRIVATE(serial);
44 #endif
45  unsigned long MBEDTLS_PRIVATE(timeout);
49 
54 
59 
69 void mbedtls_ssl_cookie_set_timeout(mbedtls_ssl_cookie_ctx *ctx, unsigned long delay);
70 
75 
80 
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* ssl_cookie.h */
int mbedtls_ssl_cookie_write_t(void *ctx, unsigned char **p, unsigned char *end, const unsigned char *info, size_t ilen)
Callback type: generate a cookie.
Definition: ssl.h:2873
int mbedtls_ssl_cookie_check_t(void *ctx, const unsigned char *cookie, size_t clen, const unsigned char *info, size_t ilen)
Callback type: verify a cookie.
Definition: ssl.h:2890
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:127
Build-time configuration info.
SSL/TLS functions.