Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto fix a logics bug (which has been here from th...



details:   https://anonhg.NetBSD.org/src/rev/5352df1eb70e
branches:  trunk
changeset: 765191:5352df1eb70e
user:      drochner <drochner%NetBSD.org@localhost>
date:      Sat May 21 10:04:03 2011 +0000

description:
fix a logics bug (which has been here from the beginning) which made
that only 96 random bits were used for IV generation,
this caused eg that the last 4 bytes of the IV in ESP/AES-CBC
were constant, leaking kernel memory
affects FAST_IPSEC only

diffstat:

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

diffs (27 lines):

diff -r 671c7bad491a -r 5352df1eb70e sys/opencrypto/cryptosoft.c
--- a/sys/opencrypto/cryptosoft.c       Sat May 21 07:30:42 2011 +0000
+++ b/sys/opencrypto/cryptosoft.c       Sat May 21 10:04:03 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptosoft.c,v 1.30 2011/05/05 17:44:39 drochner Exp $ */
+/*     $NetBSD: cryptosoft.c,v 1.31 2011/05/21 10:04:03 drochner Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.2.2.1 2002/11/21 23:34:23 sam Exp $       */
 /*     $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */
 
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.30 2011/05/05 17:44:39 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.31 2011/05/21 10:04:03 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,7 +95,7 @@
                else {
                        /* Get random IV */
                        for (i = 0;
-                           i + sizeof (u_int32_t) < EALG_MAX_BLOCK_LEN;
+                           i + sizeof (u_int32_t) <= EALG_MAX_BLOCK_LEN;
                            i += sizeof (u_int32_t)) {
                                u_int32_t temp = arc4random();
 



Home | Main Index | Thread Index | Old Index