Mbed TLS v3.6.1
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 #if !defined(MBEDTLS_USE_PSA_CRYPTO)
19 #if defined(MBEDTLS_THREADING_C)
20 #include "mbedtls/threading.h"
21 #endif
22 #endif /* !MBEDTLS_USE_PSA_CRYPTO */
23 
31 #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT
32 #define MBEDTLS_SSL_COOKIE_TIMEOUT 60
33 #endif
34 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
44 typedef struct mbedtls_ssl_cookie_ctx {
45 #if defined(MBEDTLS_USE_PSA_CRYPTO)
47  psa_algorithm_t MBEDTLS_PRIVATE(psa_hmac_alg);
48 #else
50 #endif /* MBEDTLS_USE_PSA_CRYPTO */
51 #if !defined(MBEDTLS_HAVE_TIME)
52  unsigned long MBEDTLS_PRIVATE(serial);
53 #endif
54  unsigned long MBEDTLS_PRIVATE(timeout);
57 #if !defined(MBEDTLS_USE_PSA_CRYPTO)
58 #if defined(MBEDTLS_THREADING_C)
60 #endif
61 #endif /* !MBEDTLS_USE_PSA_CRYPTO */
63 
68 
73  int (*f_rng)(void *, unsigned char *, size_t),
74  void *p_rng);
75 
86 
91 
96 
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif /* ssl_cookie.h */
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:134
psa_key_id_t mbedtls_svc_key_id_t
Definition: crypto_types.h:292
Build-time configuration info.
Macro wrapper for struct's members.
#define MBEDTLS_PRIVATE(member)
SSL/TLS functions.
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:2976
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:2993
Threading abstraction layer.