]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 3/4
authorJouni Malinen <jouni@codeaurora.org>
Fri, 1 May 2020 17:06:57 +0000 (20:06 +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/rsn_supp/wpa.c

index 22dd542f3702be43225fae76d164051c0474bbc0..84ff1e1bd7979f54eb39b00cb11458a7c4842900 100644 (file)
@@ -1715,6 +1715,20 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
        }
 #endif /* CONFIG_OCV */
 
+#ifdef CONFIG_DPP2
+       if (ie.dpp_kde) {
+               wpa_printf(MSG_DEBUG,
+                          "DPP: peer Protocol Version %u Flags 0x%x",
+                          ie.dpp_kde[0], ie.dpp_kde[1]);
+               if (sm->key_mgmt == WPA_KEY_MGMT_DPP && sm->dpp_pfs != 2 &&
+                   (ie.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");
+                       goto failed;
+               }
+       }
+#endif /* CONFIG_DPP2 */
+
        if (sm->use_ext_key_id &&
            wpa_supplicant_install_ptk(sm, key, KEY_FLAG_RX))
                goto failed;