浏览代码

[crypto] Fix wrong setup in function aes_wrap

Use explicit size in memset because 8 bytes must be set always.

This problem was reported by cppcheck.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Stefan Weil 12 年前
父节点
当前提交
ede37e493d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/crypto/aes_wrap.c

+ 1
- 1
src/crypto/aes_wrap.c 查看文件

@@ -48,7 +48,7 @@ int aes_wrap ( const void *kek, const void *src, void *dest, int nblk )
48 48
 	cipher_setkey ( &aes_algorithm, aes_ctx, kek, 16 );
49 49
 
50 50
 	/* Set up */
51
-	memset ( A, 0xA6, sizeof ( A ) );
51
+	memset ( A, 0xA6, 8 );
52 52
 	memmove ( dest + 8, src, nblk * 8 );
53 53
 
54 54
 	/* Wrap */

正在加载...
取消
保存