cipher: Fix IDEA cipher for clearing memory.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Nov 2016 05:34:16 +0000 (14:34 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Nov 2016 05:34:16 +0000 (14:34 +0900)
* cipher/idea.c (invert_key): Use wipememory, since this kind of memset
may be removed by compiler optimization.

--
Reported-by: Zhaomo Yang and Brian Johannesmeyer
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
cipher/idea.c

index 14234cf..ffe821d 100644 (file)
@@ -152,7 +152,7 @@ invert_key( u16 *ek, u16 dk[IDEA_KEYLEN] )
     *--p = t2;
     *--p = t1;
     memcpy(dk, temp, sizeof(temp) );
-    memset(temp, 0, sizeof(temp) );  /* burn temp */
+    wipememory(temp, sizeof(temp));
 }