summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-09-30 16:59:10 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-09-30 16:59:10 +0000
commitf3944bad15b7931964771d52b1842a0505b23e25 (patch)
tree75a19714f53ed92b126b140d46d43e7579e5ad2a /sbin
parentac8589a58d3b4068596fe91aaad823d3c69f8396 (diff)
Don't accept AUTH payloads with invalid auth_method 0.
Fixes duplicate AUTH payload detection. ok patrick@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iked/ikev2_pld.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sbin/iked/ikev2_pld.c b/sbin/iked/ikev2_pld.c
index 4ddcbe7300b..728727202c0 100644
--- a/sbin/iked/ikev2_pld.c
+++ b/sbin/iked/ikev2_pld.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2_pld.c,v 1.98 2020/09/30 16:55:16 tobhe Exp $ */
+/* $OpenBSD: ikev2_pld.c,v 1.99 2020/09/30 16:59:09 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -900,6 +900,12 @@ ikev2_validate_auth(struct iked_message *msg, size_t offset, size_t left,
}
memcpy(auth, msgbuf + offset, sizeof(*auth));
+ if (auth->auth_method == 0) {
+ log_info("%s: malformed payload: invalid auth method",
+ __func__);
+ return (-1);
+ }
+
return (0);
}