]> git.ipfire.org Git - thirdparty/hostap.git/commit
WPA: Fix wpa_parse_kde_ies() handling with vendor specific elements
authorJouni Malinen <jouni@codeaurora.org>
Thu, 23 Apr 2020 20:30:23 +0000 (23:30 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 24 Apr 2020 14:06:50 +0000 (17:06 +0300)
commit4d9c313f2a6dc092caee55299062de897bddd6ea
tree63ddc8048a6a7c3442ef7837a24d907e0132723f
parent1025a9052c6e3cc066fb01af10833da20783e1d8
WPA: Fix wpa_parse_kde_ies() handling with vendor specific elements

Documentation of the return values for wpa_parse_vendor_specific() and
wpa_parse_generic() were not accurate and the parsing results from these
were not really handled appropriately. There is no point in calling
wpa_parse_vendor_specific() if wpa_parse_generic() recognizes a KDE. Not
that this would break anything in practice, but still, it looks
confusing.

The part about handling wpa_parse_vendor_specific() return value can, at
least in theory, break some cases where an unexpectedly short KDE/vendor
specific element were present and something would need to be recognized
after it. That does not really happen with any standard compliant
implementation and this is unlikely to cause any real harm, but it is
clearer to handle this more appropriately even for any theoretical case,
including misbehavior of a peer device.

Instead of stopping parsing on too short vendor specific element,
continue parsing the following KDEs/IEs. Skip the
wpa_parse_vendor_specific() call when a KDE has been recognized. Also
fix the return value documentation for wpa_parse_generic() and remove
the useless return value from wpa_parse_vendor_specific().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/wpa_common.c