]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix unicast argument for set_wep_key() from EAPOL supplicant
authorAlexander Wetzel <alexander@wetzel-home.de>
Wed, 4 Mar 2020 17:16:49 +0000 (18:16 +0100)
committerJouni Malinen <j@w1.fi>
Wed, 4 Mar 2020 21:59:49 +0000 (23:59 +0200)
The unicast parameter in set_wep_key() is only expected to be set to 0
or 1. Without this patch we set unicast to 0x80 instead of 1. Since
unicast is used as boolean that is working fine but violates the
documented API.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
src/eapol_supp/eapol_supp_sm.c

index 1734d6efb1b6d2b93ebe203daeb8c6f9f46e49dc..7f04b01078c6e07c488448aaad1ccbdfa23521d2 100644 (file)
@@ -843,7 +843,7 @@ static void eapol_sm_processKey(struct eapol_sm *sm)
 
        if (sm->ctx->set_wep_key &&
            sm->ctx->set_wep_key(sm->ctx->ctx,
-                                key->key_index & IEEE8021X_KEY_INDEX_FLAG,
+                                !!(key->key_index & IEEE8021X_KEY_INDEX_FLAG),
                                 key->key_index & IEEE8021X_KEY_INDEX_MASK,
                                 datakey, key_len) < 0) {
                wpa_printf(MSG_WARNING, "EAPOL: Failed to set WEP key to the "