]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Fix build without CONFIG_TESTING_OPTIONS=y
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 6 Apr 2022 21:44:46 +0000 (00:44 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 6 Apr 2022 21:47:31 +0000 (00:47 +0300)
force_kdk_derivation is defined within CONFIG_TESTING_OPTIONS, so need
to use matching condition when accessing it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/ieee802_11.c
wpa_supplicant/pasn_supplicant.c

index 15fdcbd621e8bf9c6bee78cb717eca0b2327d9cc..d2b718974222cc2b3dc2cd0a24be1e30a4d43296 100644 (file)
@@ -3121,6 +3121,7 @@ static void handle_auth_pasn_1(struct hostapd_data *hapd, struct sta_info *sta,
        int ret, inc_y;
        bool derive_keys;
        u32 i;
+       bool derive_kdk;
 
        if (!groups)
                groups = default_groups;
@@ -3160,10 +3161,14 @@ static void handle_auth_pasn_1(struct hostapd_data *hapd, struct sta_info *sta,
        sta->pasn->akmp = rsn_data.key_mgmt;
        sta->pasn->cipher = rsn_data.pairwise_cipher;
 
-       if (hapd->conf->force_kdk_derivation ||
-           ((hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF) &&
-            ieee802_11_rsnx_capab_len(elems.rsnxe, elems.rsnxe_len,
-                                      WLAN_RSNX_CAPAB_SECURE_LTF)))
+       derive_kdk = (hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF) &&
+               ieee802_11_rsnx_capab_len(elems.rsnxe, elems.rsnxe_len,
+                                         WLAN_RSNX_CAPAB_SECURE_LTF);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (!derive_kdk)
+               derive_kdk = hapd->conf->force_kdk_derivation;
+#endif /* CONFIG_TESTING_OPTIONS */
+       if (derive_kdk)
                sta->pasn->kdk_len = WPA_KDK_MAX_LEN;
        else
                sta->pasn->kdk_len = 0;
index baf4c2643e4263d3f07acde99b2ab2733b479b63..dc21b6a3c32959a53e201a08982e4f81858f66a6 100644 (file)
@@ -1000,6 +1000,7 @@ static int wpas_pasn_start(struct wpa_supplicant *wpa_s, const u8 *bssid,
        struct wpa_ssid *ssid = NULL;
        struct wpabuf *frame;
        int ret;
+       bool derive_kdk;
 
        /* TODO: Currently support only ECC groups */
        if (!dragonfly_suitable_group(group, 1)) {
@@ -1079,9 +1080,14 @@ static int wpas_pasn_start(struct wpa_supplicant *wpa_s, const u8 *bssid,
        pasn->group = group;
        pasn->freq = freq;
 
-       if (wpa_s->conf->force_kdk_derivation ||
-           (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF &&
-            ieee802_11_rsnx_capab(beacon_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
+       derive_kdk = (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF) &&
+               ieee802_11_rsnx_capab(beacon_rsnxe,
+                                     WLAN_RSNX_CAPAB_SECURE_LTF);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (!derive_kdk)
+               derive_kdk = wpa_s->conf->force_kdk_derivation;
+#endif /* CONFIG_TESTING_OPTIONS */
+       if (derive_kdk)
                pasn->kdk_len = WPA_KDK_MAX_LEN;
        else
                pasn->kdk_len = 0;