summaryrefslogtreecommitdiffstats
path: root/sbin/setkey
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-05-13 15:46:28 +0000
committerume <ume@FreeBSD.org>2004-05-13 15:46:28 +0000
commite439e07721fe1b7ce6b76555539f14337adac972 (patch)
treea08b25b174fb98dfea88555ed15ab5e4703f8334 /sbin/setkey
parent851a0de9b7e887aded61557133b5bba072d96e1e (diff)
downloadFreeBSD-src-e439e07721fe1b7ce6b76555539f14337adac972.zip
FreeBSD-src-e439e07721fe1b7ce6b76555539f14337adac972.tar.gz
check if the null encryption is supported or not.
Requested by: bms Obtained from: KAME
Diffstat (limited to 'sbin/setkey')
-rw-r--r--sbin/setkey/parse.y12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y
index 0693a96..d6bb8c4 100644
--- a/sbin/setkey/parse.y
+++ b/sbin/setkey/parse.y
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: parse.y,v 1.81 2003/07/01 04:01:48 itojun Exp $ */
+/* $KAME: parse.y,v 1.82 2004/04/15 08:03:57 sakane Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
@@ -323,6 +323,11 @@ enc_alg
p_key_enc_len = 0;
p_key_enc = NULL;
+ if (ipsec_check_keylen(SADB_EXT_SUPPORTED_ENCRYPT,
+ p_alg_enc, PFKEY_UNUNIT64(p_key_enc_len)) < 0) {
+ yyerror(ipsec_strerror());
+ return -1;
+ }
}
| ALG_ENC key_string {
if ($1 < 0) {
@@ -349,6 +354,11 @@ enc_alg
p_key_enc_len = 0;
p_key_enc = NULL;
+ if (ipsec_check_keylen(SADB_EXT_SUPPORTED_ENCRYPT,
+ p_alg_enc, PFKEY_UNUNIT64(p_key_enc_len)) < 0) {
+ yyerror(ipsec_strerror());
+ return -1;
+ }
}
| ALG_ENC_DESDERIV key_string
{
OpenPOWER on IntegriCloud