mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 10:20:45 +00:00
Clear temporary buffer after block crypt operation.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
parent
a9cbdfbb34
commit
c52220d775
@ -127,13 +127,15 @@ static int mbedtls_ccm_crypt( mbedtls_ccm_context *ctx,
|
|||||||
if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, ctx->ctr, 16, tmp_buf,
|
if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, ctx->ctr, 16, tmp_buf,
|
||||||
&olen ) ) != 0 )
|
&olen ) ) != 0 )
|
||||||
{
|
{
|
||||||
ctx->state |= CCM_STATE__ERROR; \
|
ctx->state |= CCM_STATE__ERROR;
|
||||||
|
mbedtls_platform_zeroize(tmp_buf, sizeof(tmp_buf));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = 0; i < use_len; i++ )
|
for( i = 0; i < use_len; i++ )
|
||||||
output[i] = input[i] ^ tmp_buf[offset + i];
|
output[i] = input[i] ^ tmp_buf[offset + i];
|
||||||
|
|
||||||
|
mbedtls_platform_zeroize(tmp_buf, sizeof(tmp_buf));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user