mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
Fixes following review
Fixes issue of not zeroing entire block on reset and conditional compilation.
This commit is contained in:
parent
ea680197f8
commit
2127932fb8
|
@ -59,8 +59,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define mbedtls_calloc calloc
|
#define mbedtls_calloc calloc
|
||||||
#define mbedtls_free free
|
#define mbedtls_free free
|
||||||
#if defined(MBEDTLS_SELF_TEST) && ( defined(MBEDTLS_AES_C) || \
|
#if defined(MBEDTLS_SELF_TEST)
|
||||||
defined(MBEDTLS_DES_C) )
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define mbedtls_printf printf
|
#define mbedtls_printf printf
|
||||||
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C || MBEDTLS_DES_C */
|
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C || MBEDTLS_DES_C */
|
||||||
|
@ -388,8 +387,9 @@ int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx )
|
||||||
/* Reset the internal state */
|
/* Reset the internal state */
|
||||||
cmac_ctx->unprocessed_len = 0;
|
cmac_ctx->unprocessed_len = 0;
|
||||||
mbedtls_zeroize( cmac_ctx->unprocessed_block,
|
mbedtls_zeroize( cmac_ctx->unprocessed_block,
|
||||||
sizeof( cmac_ctx->unprocessed_len ) );
|
sizeof( cmac_ctx->unprocessed_block ));
|
||||||
mbedtls_zeroize( cmac_ctx->state, MBEDTLS_CIPHER_BLKSIZE_MAX );
|
mbedtls_zeroize( cmac_ctx->state,
|
||||||
|
sizeof( cmac_ctx->state ) );
|
||||||
cmac_ctx->padding_flag = 1;
|
cmac_ctx->padding_flag = 1;
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
Loading…
Reference in a new issue