Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto Remove erroneous '2 *' from 'bzero(*sched, 2 ...



details:   https://anonhg.NetBSD.org/src/rev/68c4b57edee8
branches:  trunk
changeset: 555488:68c4b57edee8
user:      jonathan <jonathan%NetBSD.org@localhost>
date:      Tue Nov 18 23:01:39 2003 +0000

description:
Remove erroneous '2 *' from 'bzero(*sched, 2 * sizeof(rijndael_ctx));'
After using AES from sys/crypto, we only malloc sizeof(rijndael_ctx),
and we were bzero()ing past the end of the aes ctx, leading to panics.

diffstat:

 sys/opencrypto/xform.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r efb4ede16c14 -r 68c4b57edee8 sys/opencrypto/xform.c
--- a/sys/opencrypto/xform.c    Tue Nov 18 23:00:04 2003 +0000
+++ b/sys/opencrypto/xform.c    Tue Nov 18 23:01:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.c,v 1.12 2003/11/16 12:07:50 tls Exp $ */
+/*     $NetBSD: xform.c,v 1.13 2003/11/18 23:01:39 jonathan Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $    */
 /*     $OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $     */
 
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.12 2003/11/16 12:07:50 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.13 2003/11/18 23:01:39 jonathan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -563,7 +563,7 @@
 static void
 rijndael128_zerokey(u_int8_t **sched)
 {
-       bzero(*sched, 2 * sizeof(rijndael_ctx));
+       bzero(*sched, sizeof(rijndael_ctx));
        FREE(*sched, M_CRYPTO_DATA);
        *sched = NULL;
 }



Home | Main Index | Thread Index | Old Index