mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Externals: Update mbedtls to 2.4.1
The latest version has tons of security fixes (which is expected for a library such as mbedtls). Updating also allows getting rid of a few deprecation warnings.
This commit is contained in:
12
Externals/mbedtls/library/ssl_ticket.c
vendored
12
Externals/mbedtls/library/ssl_ticket.c
vendored
@ -27,16 +27,16 @@
|
||||
|
||||
#if defined(MBEDTLS_SSL_TICKET_C)
|
||||
|
||||
#include "mbedtls/ssl_ticket.h"
|
||||
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#define mbedtls_calloc calloc
|
||||
#define mbedtls_free free
|
||||
#define mbedtls_free free
|
||||
#endif
|
||||
|
||||
#include "mbedtls/ssl_ticket.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
@ -69,7 +69,7 @@ static int ssl_ticket_gen_key( mbedtls_ssl_ticket_context *ctx,
|
||||
mbedtls_ssl_ticket_key *key = ctx->keys + index;
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
key->generation_time = (uint32_t) time( NULL );
|
||||
key->generation_time = (uint32_t) mbedtls_time( NULL );
|
||||
#endif
|
||||
|
||||
if( ( ret = ctx->f_rng( ctx->p_rng, key->name, sizeof( key->name ) ) ) != 0 )
|
||||
@ -98,7 +98,7 @@ static int ssl_ticket_update_keys( mbedtls_ssl_ticket_context *ctx )
|
||||
#else
|
||||
if( ctx->ticket_lifetime != 0 )
|
||||
{
|
||||
uint32_t current_time = (uint32_t) time( NULL );
|
||||
uint32_t current_time = (uint32_t) mbedtls_time( NULL );
|
||||
uint32_t key_time = ctx->keys[ctx->active].generation_time;
|
||||
|
||||
if( current_time > key_time &&
|
||||
@ -451,7 +451,7 @@ int mbedtls_ssl_ticket_parse( void *p_ticket,
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
{
|
||||
/* Check for expiration */
|
||||
time_t current_time = time( NULL );
|
||||
mbedtls_time_t current_time = mbedtls_time( NULL );
|
||||
|
||||
if( current_time < session->start ||
|
||||
(uint32_t)( current_time - session->start ) > ctx->ticket_lifetime )
|
||||
|
Reference in New Issue
Block a user