]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 2/4
authorJouni Malinen <jouni@codeaurora.org>
Fri, 1 May 2020 17:02:48 +0000 (20:02 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 3 May 2020 21:37:44 +0000 (00:37 +0300)
Do not allow association to continue if the local configuration enables
PFS and the station indicates it supports PFS, but PFS was not
negotiated for the association.

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

index fad0623b07fc555938ddc25003b5dba775faf268..cbaf9f738d81fff61ea6a03362139f98eb0ecb20 100644 (file)
@@ -3079,6 +3079,24 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
        }
 #endif /* CONFIG_P2P */
 
+#ifdef CONFIG_DPP2
+       if (kde.dpp_kde) {
+               wpa_printf(MSG_DEBUG,
+                          "DPP: peer Protocol Version %u Flags 0x%x",
+                          kde.dpp_kde[0], kde.dpp_kde[1]);
+               if (sm->wpa_key_mgmt == WPA_KEY_MGMT_DPP &&
+                   wpa_auth->conf.dpp_pfs != 2 &&
+                   (kde.dpp_kde[1] & DPP_KDE_PFS_ALLOWED) &&
+                   !sm->dpp_z) {
+                       wpa_printf(MSG_INFO,
+                                  "DPP: Peer indicated it supports PFS and local configuration allows this, but PFS was not negotiated for the association");
+                       wpa_sta_disconnect(wpa_auth, sm->addr,
+                                          WLAN_REASON_PREV_AUTH_NOT_VALID);
+                       return;
+               }
+       }
+#endif /* CONFIG_DPP2 */
+
 #ifdef CONFIG_IEEE80211R_AP
        if (sm->wpa == WPA_VERSION_WPA2 && wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
                /*