]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Don't try to set NULL WEP default key
authorAlexander Wetzel <alexander@wetzel-home.de>
Wed, 4 Mar 2020 17:16:50 +0000 (18:16 +0100)
committerJouni Malinen <j@w1.fi>
Wed, 4 Mar 2020 22:03:56 +0000 (00:03 +0200)
hostapd_broadcast_wep_set() can be called without a WEP key set.
Don't try to install a default key in that case.

This patch is not critical for the new API. With key_flag we just would
report an (ignored) error and do nothing. With the patch we simply do
nothing.

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

index a6a95debf2609d24846b4904dda761cada5ed27c..f2e964ac038df1b4813405e6b4a7d21c662e41b0 100644 (file)
@@ -336,7 +336,7 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd)
        struct hostapd_ssid *ssid = &hapd->conf->ssid;
 
        idx = ssid->wep.idx;
-       if (ssid->wep.default_len &&
+       if (ssid->wep.default_len && ssid->wep.key[idx] &&
            hostapd_drv_set_key(hapd->conf->iface,
                                hapd, WPA_ALG_WEP, broadcast_ether_addr, idx, 0,
                                1, NULL, 0, ssid->wep.key[idx],