summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-07-16 00:44:50 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-07-16 00:44:50 +0000
commitac785f94611fbd9982cf774662303716c09fa736 (patch)
tree689b54a602d890543fe88ee8227466f973e9e829 /sbin
parent485ab950773954738670e276448fbe691810e065 (diff)
Merge with EOM 1.19
author: niklas Do not try to establish an encryption key for AH
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/pf_key_v2.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index b090743ad53..ee6f4d8de1e 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pf_key_v2.c,v 1.14 1999/07/08 17:49:35 niklas Exp $ */
-/* $EOM: pf_key_v2.c,v 1.18 1999/07/08 16:48:40 niklas Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.15 1999/07/16 00:44:49 niklas Exp $ */
+/* $EOM: pf_key_v2.c,v 1.19 1999/07/16 00:29:11 niklas Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -890,19 +890,22 @@ pf_key_v2_set_spi (struct sa *sa, struct proto *proto, int incoming)
goto cleanup;
key = 0;
- len = sizeof *key + PF_KEY_V2_ROUND (keylen);
- key = malloc (len);
- if (!key)
- goto cleanup;
- key->sadb_key_exttype = SADB_EXT_KEY_ENCRYPT;
- key->sadb_key_len = len / PF_KEY_V2_CHUNK;
- key->sadb_key_bits = keylen * 8;
- key->sadb_key_reserved = 0;
- memcpy (key + 1, iproto->keymat[incoming], keylen);
- if (pf_key_v2_msg_add (update, (struct sadb_ext *)key,
- PF_KEY_V2_NODE_MALLOCED) == -1)
- goto cleanup;
- key = 0;
+ if (keylen)
+ {
+ len = sizeof *key + PF_KEY_V2_ROUND (keylen);
+ key = malloc (len);
+ if (!key)
+ goto cleanup;
+ key->sadb_key_exttype = SADB_EXT_KEY_ENCRYPT;
+ key->sadb_key_len = len / PF_KEY_V2_CHUNK;
+ key->sadb_key_bits = keylen * 8;
+ key->sadb_key_reserved = 0;
+ memcpy (key + 1, iproto->keymat[incoming], keylen);
+ if (pf_key_v2_msg_add (update, (struct sadb_ext *)key,
+ PF_KEY_V2_NODE_MALLOCED) == -1)
+ goto cleanup;
+ key = 0;
+ }
/* XXX Here can identity and sensitivity extensions be setup. */