[PATCH 1/1] MKA: fix basic set body encoding

Michael Braun michael-dev at fami-braun.de
Thu Aug 17 12:47:01 PDT 2017


From: Michael Braun <michael.braun at fem.tu-ilmenau.de>

IEEE 802.1X-2010 Figure 11-7 explaines that
"Parameter set body length" is exclusive
of the suffix padding.

This fixes variable length encoding when
ckn length is not a multiple of 4 bytes.

Signed-off-by: Michael Braun <michael-dev at fami-braun.de>
---
 src/pae/ieee802_1x_kay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index ff55f88..20451bf 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -694,7 +694,8 @@ ieee802_1x_mka_encode_basic_body(
 {
 	struct ieee802_1x_mka_basic_body *body;
 	struct ieee802_1x_kay *kay = participant->kay;
-	unsigned int length = ieee802_1x_mka_basic_body_length(participant);
+	unsigned int length = sizeof(struct ieee802_1x_mka_basic_body);
+	length += participant->ckn.len;
 
 	body = wpabuf_put(buf, length);
 
-- 
2.1.4




More information about the Hostap mailing list