From cd182a57d4824bb8fff13935d57011d650c4d896 Mon Sep 17 00:00:00 2001 From: "guojing33@huawei.com" Date: Mon, 29 Aug 2022 08:45:36 +0800 Subject: [PATCH] return fail to client for wpa 0829 Signed-off-by: guojing33@huawei.com --- .../wpa_supplicant/ctrl_iface_udp.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface_udp.c index b069d84..59112bd 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface_udp.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface_udp.c @@ -644,21 +644,42 @@ static void wpa_supplicant_global_ctrl_iface_receive(int sock, void *eloop_ctx, } if (os_strncmp(buf, "COOKIE=", 7) != 0) { +#ifdef CONFIG_OPEN_HARMONY_PATCH + wpa_printf(MSG_WARNING, "CTLR: No cookie in the request - " + "drop request"); + reply_len = 1; + goto done; +#else wpa_printf(MSG_DEBUG, "CTLR: No cookie in the request - " "drop request"); return; +#endif } if (hexstr2bin(buf + 7, cookie, COOKIE_LEN) < 0) { +#ifdef CONFIG_OPEN_HARMONY_PATCH + wpa_printf(MSG_WARNING, "CTLR: Invalid cookie format in the " + "request - drop request"); + reply_len = 1; + goto done; +#else wpa_printf(MSG_DEBUG, "CTLR: Invalid cookie format in the " "request - drop request"); return; +#endif } if (os_memcmp(cookie, priv->cookie, COOKIE_LEN) != 0) { +#ifdef CONFIG_OPEN_HARMONY_PATCH + wpa_printf(MSG_WARNING, "CTLR: Invalid cookie in the request - " + "drop request"); + reply_len = 1; + goto done; +#else wpa_printf(MSG_DEBUG, "CTLR: Invalid cookie in the request - " "drop request"); return; +#endif } pos = buf + 7 + 2 * COOKIE_LEN; -- Gitee