]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCV: Report validation errors for (Re)Association Request frames
authorJouni Malinen <jouni@codeaurora.org>
Mon, 25 May 2020 17:46:32 +0000 (20:46 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 25 May 2020 17:46:32 +0000 (20:46 +0300)
Add the OCV-FAILURE control interface event to notify upper layers of
OCV validation issues in FT and FILS (Re)Association Request frames.

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

index b54580efe6406b83d0efef796472ec9cdd6bce56..c4bf434f2a5bdbcb9ab71e7aadbc00a68854392f 100644 (file)
@@ -24,6 +24,7 @@
 #include "common/dpp.h"
 #include "common/ocv.h"
 #include "common/wpa_common.h"
+#include "common/wpa_ctrl.h"
 #include "radius/radius.h"
 #include "radius/radius_client.h"
 #include "p2p/p2p.h"
@@ -3511,6 +3512,9 @@ static int check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                                         tx_chanwidth, tx_seg1_idx) != 0) {
                        wpa_printf(MSG_WARNING, "FILS: OCV failed: %s",
                                   ocv_errorstr);
+                       wpa_msg(hapd->msg_ctx, MSG_INFO, OCV_FAILURE "addr="
+                               MACSTR " frame=fils-reassoc-req error=%s",
+                               MAC2STR(sta->addr), ocv_errorstr);
                        return WLAN_STATUS_UNSPECIFIED_FAILURE;
                }
        }
index f52a872c340ad62768faf9088cdb7d3d6c291438..1a1fa24207224f9b6d62d800ec46551261f49b42 100644 (file)
@@ -14,6 +14,7 @@
 #include "common/ieee802_11_defs.h"
 #include "common/ieee802_11_common.h"
 #include "common/ocv.h"
+#include "common/wpa_ctrl.h"
 #include "drivers/driver.h"
 #include "crypto/aes.h"
 #include "crypto/aes_siv.h"
@@ -3467,6 +3468,11 @@ int wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
                if (ocv_verify_tx_params(parse.oci, parse.oci_len, &ci,
                                         tx_chanwidth, tx_seg1_idx) != 0) {
                        wpa_printf(MSG_WARNING, "OCV failed: %s", ocv_errorstr);
+                       if (sm->wpa_auth->conf.msg_ctx)
+                               wpa_msg(sm->wpa_auth->conf.msg_ctx, MSG_INFO,
+                                       OCV_FAILURE "addr=" MACSTR
+                                       " frame=ft-reassoc-req error=%s",
+                                       MAC2STR(sm->addr), ocv_errorstr);
                        return WLAN_STATUS_UNSPECIFIED_FAILURE;
                }
        }