summaryrefslogtreecommitdiff
path: root/sbin/iked/ikev2_msg.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2010-06-14 11:33:56 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2010-06-14 11:33:56 +0000
commitc85961103b5258cf63dabc3cc217afc966353660 (patch)
treeae5090f701eaac3ab381db288be7d4216ac43c16 /sbin/iked/ikev2_msg.c
parent825ac1c1726f39a4efe4221044ae718b0b17d399 (diff)
restructure code a bit to move closer to initiator mode:
- split responder/initiator- specific code into different functions and use shared functions for common stuff. - first parse the received message and store information in the temporary message struct instead of modifying the ike sa in the parsing code directly.
Diffstat (limited to 'sbin/iked/ikev2_msg.c')
-rw-r--r--sbin/iked/ikev2_msg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/iked/ikev2_msg.c b/sbin/iked/ikev2_msg.c
index 34ff1f9153a..11a22fe7d31 100644
--- a/sbin/iked/ikev2_msg.c
+++ b/sbin/iked/ikev2_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2_msg.c,v 1.3 2010/06/14 08:55:59 reyk Exp $ */
+/* $OpenBSD: ikev2_msg.c,v 1.4 2010/06/14 11:33:55 reyk Exp $ */
/* $vantronix: ikev2.c,v 1.101 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -804,6 +804,9 @@ ikev2_msg_frompeer(struct iked_message *msg)
struct iked_sa *sa = msg->msg_sa;
struct ike_header *hdr;
+ if (msg->msg_decrypted)
+ msg = msg->msg_decrypted;
+
if (sa == NULL ||
(hdr = ibuf_seek(msg->msg_data, 0, sizeof(*hdr))) == NULL)
return (0);