Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 Use BF_ecb_encrypt() instead of using BF_encryp...
details: https://anonhg.NetBSD.org/src/rev/fb992251af5b
branches: trunk
changeset: 550996:fb992251af5b
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Aug 27 00:08:31 2003 +0000
description:
Use BF_ecb_encrypt() instead of using BF_encrypt()/BF_decrypt()
directly. Reviewed by itojun.
diffstat:
sys/netinet6/esp_core.c | 24 ++++--------------------
1 files changed, 4 insertions(+), 20 deletions(-)
diffs (54 lines):
diff -r 142633b4df89 -r fb992251af5b sys/netinet6/esp_core.c
--- a/sys/netinet6/esp_core.c Wed Aug 27 00:05:26 2003 +0000
+++ b/sys/netinet6/esp_core.c Wed Aug 27 00:08:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_core.c,v 1.32 2003/08/26 16:37:37 thorpej Exp $ */
+/* $NetBSD: esp_core.c,v 1.33 2003/08/27 00:08:31 thorpej Exp $ */
/* $KAME: esp_core.c,v 1.53 2001/11/27 09:47:30 sakane Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.32 2003/08/26 16:37:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.33 2003/08/27 00:08:31 thorpej Exp $");
#include "opt_inet.h"
@@ -481,16 +481,8 @@
u_int8_t *s;
u_int8_t *d;
{
- /* HOLY COW! BF_decrypt() takes values in host byteorder */
- BF_LONG t[2];
- bcopy(s, t, sizeof(t));
- t[0] = ntohl(t[0]);
- t[1] = ntohl(t[1]);
- BF_decrypt(t, (BF_KEY *)sav->sched);
- t[0] = htonl(t[0]);
- t[1] = htonl(t[1]);
- bcopy(t, d, sizeof(t));
+ BF_ecb_encrypt(s, d, (BF_KEY *)sav->sched, 0);
return 0;
}
@@ -501,16 +493,8 @@
u_int8_t *s;
u_int8_t *d;
{
- /* HOLY COW! BF_encrypt() takes values in host byteorder */
- BF_LONG t[2];
- bcopy(s, t, sizeof(t));
- t[0] = ntohl(t[0]);
- t[1] = ntohl(t[1]);
- BF_encrypt(t, (BF_KEY *)sav->sched);
- t[0] = htonl(t[0]);
- t[1] = htonl(t[1]);
- bcopy(t, d, sizeof(t));
+ BF_ecb_encrypt(s, d, (BF_KEY *)sav->sched, 1);
return 0;
}
Home |
Main Index |
Thread Index |
Old Index