]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD STA: Configure TK to the driver using AP MLD address
authorRohan Dutta <quic_drohan@quicinc.com>
Thu, 3 Nov 2022 08:08:48 +0000 (13:38 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 6 Nov 2022 21:36:49 +0000 (23:36 +0200)
Configure TK to the driver with AP MLD address with MLO is used. Current
changes are handling only EAPOL-Key 4-way handshake and FILS
authentication cases, i.e., FT protocol case needs to be addressed
separately.

Signed-off-by: Rohan Dutta <quic_drohan@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
src/rsn_supp/wpa.c
src/rsn_supp/wpa_ft.c

index 658abd1126dab17da3e43e9bf0ffa33ce1517e0f..15e44106e96270bf0647822090188516e9dbfd57 100644 (file)
@@ -1068,13 +1068,13 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
                wpa_hexdump(MSG_DEBUG, "WPA: RSC", key_rsc, rsclen);
        }
 
-       if (wpa_sm_set_key(sm, alg, sm->bssid, sm->keyidx_active, 1, key_rsc,
-                          rsclen, sm->ptk.tk, keylen,
+       if (wpa_sm_set_key(sm, alg, wpa_sm_get_auth_addr(sm), sm->keyidx_active,
+                          1, key_rsc, rsclen, sm->ptk.tk, keylen,
                           KEY_FLAG_PAIRWISE | key_flag) < 0) {
                wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-                       "WPA: Failed to set PTK to the driver (alg=%d keylen=%d bssid="
+                       "WPA: Failed to set PTK to the driver (alg=%d keylen=%d auth_addr="
                        MACSTR " idx=%d key_flag=0x%x)",
-                       alg, keylen, MAC2STR(sm->bssid),
+                       alg, keylen, MAC2STR(wpa_sm_get_auth_addr(sm)),
                        sm->keyidx_active, key_flag);
                return -1;
        }
@@ -1114,14 +1114,16 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
 static int wpa_supplicant_activate_ptk(struct wpa_sm *sm)
 {
        wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
-               "WPA: Activate PTK (idx=%d bssid=" MACSTR ")",
-               sm->keyidx_active, MAC2STR(sm->bssid));
+               "WPA: Activate PTK (idx=%d auth_addr=" MACSTR ")",
+               sm->keyidx_active, MAC2STR(wpa_sm_get_auth_addr(sm)));
 
-       if (wpa_sm_set_key(sm, 0, sm->bssid, sm->keyidx_active, 0, NULL, 0,
-                          NULL, 0, KEY_FLAG_PAIRWISE_RX_TX_MODIFY) < 0) {
+       if (wpa_sm_set_key(sm, 0, wpa_sm_get_auth_addr(sm), sm->keyidx_active,
+                          0, NULL, 0, NULL, 0,
+                          KEY_FLAG_PAIRWISE_RX_TX_MODIFY) < 0) {
                wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-                       "WPA: Failed to activate PTK for TX (idx=%d bssid="
-                       MACSTR ")", sm->keyidx_active, MAC2STR(sm->bssid));
+                       "WPA: Failed to activate PTK for TX (idx=%d auth_addr="
+                       MACSTR ")", sm->keyidx_active,
+                       MAC2STR(wpa_sm_get_auth_addr(sm)));
                return -1;
        }
        return 0;
@@ -5234,12 +5236,13 @@ int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len)
        rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
        wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver",
                        sm->ptk.tk, keylen);
-       if (wpa_sm_set_key(sm, alg, sm->bssid, 0, 1, null_rsc, rsclen,
+       if (wpa_sm_set_key(sm, alg, wpa_sm_get_auth_addr(sm), 0, 1,
+                          null_rsc, rsclen,
                           sm->ptk.tk, keylen, KEY_FLAG_PAIRWISE_RX_TX) < 0) {
                wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-                       "FILS: Failed to set PTK to the driver (alg=%d keylen=%d bssid="
+                       "FILS: Failed to set PTK to the driver (alg=%d keylen=%d auth_addr="
                        MACSTR ")",
-                       alg, keylen, MAC2STR(sm->bssid));
+                       alg, keylen, MAC2STR(wpa_sm_get_auth_addr(sm)));
                goto fail;
        }
 
index 815dc4277f81e7c88d3c869694d603b2071bbfff..3204af7549f0e43f25d54affecf87eb501300e2c 100644 (file)
@@ -494,6 +494,7 @@ static int wpa_ft_install_ptk(struct wpa_sm *sm, const u8 *bssid)
        alg = wpa_cipher_to_alg(sm->pairwise_cipher);
        keylen = wpa_cipher_key_len(sm->pairwise_cipher);
 
+       /* TODO: AP MLD address for MLO */
        if (wpa_sm_set_key(sm, alg, bssid, 0, 1, null_rsc, sizeof(null_rsc),
                           (u8 *) sm->ptk.tk, keylen,
                           KEY_FLAG_PAIRWISE_RX_TX) < 0) {