Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-3]: src/sys/netinet6 Pull up revision 1.2 (requested by elad in t...
details: https://anonhg.NetBSD.org/src/rev/7a17b5738fdd
branches: netbsd-3
changeset: 576803:7a17b5738fdd
user: jdc <jdc%NetBSD.org@localhost>
date: Thu Jul 28 20:12:23 2005 +0000
description:
Pull up revision 1.2 (requested by elad in ticket #630).
PR/30821: SUZUKI, Shinsuike: IPsec-AH is always calculated using the
same key in AES-XCBC-MAC
diffstat:
sys/netinet6/ah_aesxcbcmac.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diffs (61 lines):
diff -r 8ac4880491b1 -r 7a17b5738fdd sys/netinet6/ah_aesxcbcmac.c
--- a/sys/netinet6/ah_aesxcbcmac.c Sun Jul 24 21:15:48 2005 +0000
+++ b/sys/netinet6/ah_aesxcbcmac.c Thu Jul 28 20:12:23 2005 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: ah_aesxcbcmac.c,v 1.1 2003/07/25 09:48:17 itojun Exp $ */
-/* $KAME: ah_aesxcbcmac.c,v 1.2 2003/07/20 00:29:37 itojun Exp $ */
+/* $NetBSD: ah_aesxcbcmac.c,v 1.1.16.1 2005/07/28 20:12:23 jdc Exp $ */
+/* $KAME: ah_aesxcbcmac.c,v 1.7 2004/06/02 05:53:14 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998 and 2003 WIDE Project.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ah_aesxcbcmac.c,v 1.1 2003/07/25 09:48:17 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ah_aesxcbcmac.c,v 1.1.16.1 2005/07/28 20:12:23 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -79,6 +79,7 @@
u_int8_t k3seed[AES_BLOCKSIZE] = { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 };
u_int32_t r_ks[(RIJNDAEL_MAXNR+1)*4];
aesxcbc_ctx *ctx;
+ u_int8_t k1[AES_BLOCKSIZE];
if (!state)
panic("ah_aes_xcbc_mac_init: what?");
@@ -94,14 +95,15 @@
if ((ctx->r_nr = rijndaelKeySetupEnc(r_ks,
(char *)_KEYBUF(sav->key_auth), AES_BLOCKSIZE * 8)) == 0)
return -1;
- if (rijndaelKeySetupEnc(ctx->r_k1s, k1seed, AES_BLOCKSIZE * 8) == 0)
- return -1;
- if (rijndaelKeySetupEnc(ctx->r_k2s, k2seed, AES_BLOCKSIZE * 8) == 0)
- return -1;
- if (rijndaelKeySetupEnc(ctx->r_k3s, k3seed, AES_BLOCKSIZE * 8) == 0)
- return -1;
+ rijndaelEncrypt(r_ks, ctx->r_nr, k1seed, k1);
rijndaelEncrypt(r_ks, ctx->r_nr, k2seed, ctx->k2);
rijndaelEncrypt(r_ks, ctx->r_nr, k3seed, ctx->k3);
+ if (rijndaelKeySetupEnc(ctx->r_k1s, k1, AES_BLOCKSIZE * 8) == 0)
+ return -1;
+ if (rijndaelKeySetupEnc(ctx->r_k2s, ctx->k2, AES_BLOCKSIZE * 8) == 0)
+ return -1;
+ if (rijndaelKeySetupEnc(ctx->r_k3s, ctx->k3, AES_BLOCKSIZE * 8) == 0)
+ return -1;
return 0;
}
@@ -152,8 +154,8 @@
addr += AES_BLOCKSIZE;
}
if (addr < ep) {
- bcopy(addr, ctx->buf, ep - addr);
- ctx->buflen = ep - addr;
+ bcopy(addr, ctx->buf + ctx->buflen, ep - addr);
+ ctx->buflen += ep - addr;
}
}
Home |
Main Index |
Thread Index |
Old Index