mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-01 23:20:59 +00:00
ccm: zeroize buffers before and after usage
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
5eba1d82a2
commit
142f09fb96
|
@ -246,6 +246,10 @@ static int ccm_auth_crypt( mbedtls_ccm_context *ctx, int mode, size_t length,
|
||||||
if( add_len > 0xFF00 )
|
if( add_len > 0xFF00 )
|
||||||
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
||||||
|
|
||||||
|
mbedtls_platform_zeroize( b, 16 );
|
||||||
|
mbedtls_platform_zeroize( y, 16 );
|
||||||
|
mbedtls_platform_zeroize( ctr, 16 );
|
||||||
|
|
||||||
q = (uint_fast8_t) (16 - 1 - iv_len);
|
q = (uint_fast8_t) (16 - 1 - iv_len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -390,6 +394,10 @@ static int ccm_auth_crypt( mbedtls_ccm_context *ctx, int mode, size_t length,
|
||||||
CTR_CRYPT( y, y, 16 );
|
CTR_CRYPT( y, y, 16 );
|
||||||
mbedtls_platform_memcpy( tag, y, tag_len );
|
mbedtls_platform_memcpy( tag, y, tag_len );
|
||||||
|
|
||||||
|
mbedtls_platform_zeroize( b, 16 );
|
||||||
|
mbedtls_platform_zeroize( y, 16 );
|
||||||
|
mbedtls_platform_zeroize( ctr, 16 );
|
||||||
|
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue