diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/tegra20/crypto.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/tegra20/crypto.c b/arch/arm/mach-tegra/tegra20/crypto.c index eae79217d4..58d6662f6d 100644 --- a/arch/arm/mach-tegra/tegra20/crypto.c +++ b/arch/arm/mach-tegra/tegra20/crypto.c @@ -50,6 +50,7 @@ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst, u32 num_aes_blocks) { u8 tmp_data[AES_KEY_LENGTH]; + u8 iv[AES_KEY_LENGTH] = {0}; u8 left[AES_KEY_LENGTH]; u8 k1[AES_KEY_LENGTH]; u8 *cbc_chain_data; @@ -61,7 +62,7 @@ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst, for (i = 0; i < AES_KEY_LENGTH; i++) tmp_data[i] = 0; - aes_cbc_encrypt_blocks(key_schedule, tmp_data, left, 1); + aes_cbc_encrypt_blocks(key_schedule, iv, tmp_data, left, 1); left_shift_vector(left, k1, sizeof(left)); @@ -102,6 +103,7 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src, { u32 num_aes_blocks; u8 key_schedule[AES_EXPAND_KEY_LENGTH]; + u8 iv[AES_KEY_LENGTH] = {0}; debug("encrypt_and_sign: length = %d\n", length); @@ -116,7 +118,8 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src, if (oper & SECURITY_ENCRYPT) { /* Perform this in place, resulting in src being encrypted. */ debug("encrypt_and_sign: begin encryption\n"); - aes_cbc_encrypt_blocks(key_schedule, src, src, num_aes_blocks); + aes_cbc_encrypt_blocks(key_schedule, iv, src, src, + num_aes_blocks); debug("encrypt_and_sign: end encryption\n"); } |