From: Stefan Weil Date: Wed, 4 Apr 2012 16:16:00 +0000 (+0200) Subject: [crypto] Fix wrong setup in function aes_wrap X-Git-Tag: v1.20.1~1858 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ede37e493d61c0cfbe04ab38bcc9819216756abf;p=thirdparty%2Fipxe.git [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 Signed-off-by: Michael Brown --- diff --git a/src/crypto/aes_wrap.c b/src/crypto/aes_wrap.c index 46ef016f5..f59fbf91b 100644 --- a/src/crypto/aes_wrap.c +++ b/src/crypto/aes_wrap.c @@ -48,7 +48,7 @@ int aes_wrap ( const void *kek, const void *src, void *dest, int nblk ) cipher_setkey ( &aes_algorithm, aes_ctx, kek, 16 ); /* Set up */ - memset ( A, 0xA6, sizeof ( A ) ); + memset ( A, 0xA6, 8 ); memmove ( dest + 8, src, nblk * 8 ); /* Wrap */