From: Sabrina Dubroca Date: Tue, 19 Jul 2016 09:56:53 +0000 (+0200) Subject: mka: Fix length when encoding SAK-use X-Git-Tag: hostap_2_6~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12447457bf09bc9ba5d1e4a5718cd4298425c435;p=thirdparty%2Fhostap.git mka: Fix length when encoding SAK-use The room we actually use is length. This could also mess up the receiver, since it will advance by the actual length (as indicated by the parameter body's length), which could differ from the offset at which we stored the next item. Signed-off-by: Sabrina Dubroca --- diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index 66972fc88..d0c3125d4 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -1156,7 +1156,7 @@ ieee802_1x_mka_encode_sak_use_body( u32 pn = 1; length = ieee802_1x_mka_get_sak_use_length(participant); - body = wpabuf_put(buf, sizeof(struct ieee802_1x_mka_sak_use_body)); + body = wpabuf_put(buf, length); body->type = MKA_SAK_USE; set_mka_param_body_len(body, length - MKA_HDR_LEN);