mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
crypto/fsl: Clear the memory when blob decapsulation fails
issue: blob decapsulation operation store the decrypted data
in memory even if ICV check failed.
fix: clear the blob data output memory.
Fixes: c5de15cbc8
(crypto/fsl: Add command for encapsulating/decapsulating blobs)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Tested-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
This commit is contained in:
parent
e3b330e489
commit
cc84edddd1
1 changed files with 4 additions and 0 deletions
|
@ -71,6 +71,10 @@ int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
|
|||
ret = run_descriptor_jr(desc);
|
||||
|
||||
if (ret) {
|
||||
/* clear the blob data output buffer */
|
||||
memset(dst, 0x00, len);
|
||||
size = ALIGN(len, ARCH_DMA_MINALIGN);
|
||||
flush_dcache_range((unsigned long)dst, (unsigned long)dst + size);
|
||||
printf("Error in blob decapsulation: %d\n", ret);
|
||||
} else {
|
||||
size = ALIGN(len, ARCH_DMA_MINALIGN);
|
||||
|
|
Loading…
Reference in a new issue