Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Fix that ah_algorithm_lookup and esp_algorithm_...
details: https://anonhg.NetBSD.org/src/rev/b8ea59aeb52a
branches: trunk
changeset: 352862:b8ea59aeb52a
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Apr 13 01:32:57 2017 +0000
description:
Fix that ah_algorithm_lookup and esp_algorithm_lookup don't handle some algorithms
Unrelated upper limit values, AH_ALG_MAX and ESP_ALG_MAX, prevented some
algorithms from being looked up.
diffstat:
sys/netipsec/xform_ah.c | 7 +++----
sys/netipsec/xform_esp.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diffs (56 lines):
diff -r 2cc2b524bc03 -r b8ea59aeb52a sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c Thu Apr 13 01:24:34 2017 +0000
+++ b/sys/netipsec/xform_ah.c Thu Apr 13 01:32:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_ah.c,v 1.45 2017/04/06 09:20:07 ozaki-r Exp $ */
+/* $NetBSD: xform_ah.c,v 1.46 2017/04/13 01:32:57 ozaki-r Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
/*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.45 2017/04/06 09:20:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.46 2017/04/13 01:32:57 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -130,8 +130,7 @@
const struct auth_hash *
ah_algorithm_lookup(int alg)
{
- if (alg >= AH_ALG_MAX)
- return NULL;
+
switch (alg) {
case SADB_X_AALG_NULL:
return &auth_hash_null;
diff -r 2cc2b524bc03 -r b8ea59aeb52a sys/netipsec/xform_esp.c
--- a/sys/netipsec/xform_esp.c Thu Apr 13 01:24:34 2017 +0000
+++ b/sys/netipsec/xform_esp.c Thu Apr 13 01:32:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_esp.c,v 1.48 2017/04/10 14:19:22 christos Exp $ */
+/* $NetBSD: xform_esp.c,v 1.49 2017/04/13 01:32:57 ozaki-r Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.48 2017/04/10 14:19:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.49 2017/04/13 01:32:57 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -116,8 +116,7 @@
const struct enc_xform *
esp_algorithm_lookup(int alg)
{
- if (alg >= ESP_ALG_MAX)
- return NULL;
+
switch (alg) {
case SADB_EALG_DESCBC:
return &enc_xform_des;
Home |
Main Index |
Thread Index |
Old Index