From patchwork Mon Jan 13 11:37:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 1222089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tu-ilmenau.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=fsqF2tfv; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47xBRG5vGdz9s29 for ; Mon, 13 Jan 2020 22:38:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=giliLcoY/zoTDK9+plmJFKNAyci82346wdhXH2LD+G0=; b=fsqF2tfvqn7djeIwI804g03bok 6tvb2PSYKga+t26fuI09DXlQOWlPU6PDznAo+bCD0j4oUEQ8EB4cWh+sDIPZgGJq30vJ4QhIjDr3/ FbBjg4b/bM/uVqNZj7dfCSK+N0NmUoX0XrYZNUcOaq6ai6jJ2FnRPIf1pADqcewbHeJpjyCSRP6A6 1JyCXvm9+p1gQjhv5Z/ABYqePYCmFXpZ7YDr82ILDhF6NZQEk/eP1tkdIUknbKv47Uvg/5Cpo8pG4 m8ODbH7Qg5/Y9xZq1W+Mle5VfBcDGsAPivR/F96+sNZxTVkNeCvXjfVPahG3QMZ/OCkwSOyGdtR8c R2jTVoCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqy2e-0005ZJ-IF; Mon, 13 Jan 2020 11:37:56 +0000 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqy2b-0005Wj-1O for hostap@lists.infradead.org; Mon, 13 Jan 2020 11:37:54 +0000 Received: from thunderstorm.prakinf.tu-ilmenau.de (thunderstorm.prakinf.tu-ilmenau.de [141.24.212.108]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id 5F824580068; Mon, 13 Jan 2020 12:37:47 +0100 (CET) From: Markus Theil To: hostap@lists.infradead.org Subject: [PATCH 1/4] driver: add rsn pre-auth rx event Date: Mon, 13 Jan 2020 12:37:32 +0100 Message-Id: <20200113113735.32182-2-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200113113735.32182-1-markus.theil@tu-ilmenau.de> References: <20200113113735.32182-1-markus.theil@tu-ilmenau.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_033753_235017_68182981 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [141.24.186.67 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Theil MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch adds an event for receiving pre-auth frames directly from drivers. Source and destination MACs are included in the corresponding struct to allow for forwarding of pre-auth frames in AP mode. Signed-off-by: Markus Theil --- src/drivers/driver.h | 31 +++++++++++++++++++++++++++++++ src/drivers/driver_common.c | 1 + 2 files changed, 32 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 9bdf88011..65dc5de97 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -4636,6 +4636,14 @@ enum wpa_event_type { */ EVENT_EAPOL_RX, + /** + * EVENT_RSN_PREAUTH_RX - Report received RSN Pre-auth frame + * + * When in AP mode with hostapd, this event is required to be used to + * deliver the receive RSN Pre-auth frames from the driver. + */ + EVENT_RSN_PREAUTH_RX, + /** * EVENT_SIGNAL_CHANGE - Indicate change in signal strength * @@ -5531,6 +5539,16 @@ union wpa_event_data { size_t data_len; } eapol_rx; + /** + * struct rsn_preauth_rx - Data for EVENT_RSN_PREAUTH_RX events + */ + struct rsn_preauth_rx { + const u8 *src; + const u8 *dst; + const u8 *data; + size_t data_len; + } rsn_preauth_rx; + /** * signal_change - Data for EVENT_SIGNAL_CHANGE events */ @@ -5854,6 +5872,19 @@ static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data, wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event); } +static inline void drv_event_rsn_preauth_rx(void *ctx, const u8 *src, + const u8 *dst, const u8 *data, + size_t data_len) +{ + union wpa_event_data event; + os_memset(&event, 0, sizeof(event)); + event.rsn_preauth_rx.src = src; + event.rsn_preauth_rx.dst = dst; + event.rsn_preauth_rx.data = data; + event.rsn_preauth_rx.data_len = data_len; + wpa_supplicant_event(ctx, EVENT_RSN_PREAUTH_RX, &event); +} + /* driver_common.c */ void wpa_scan_results_free(struct wpa_scan_results *res); diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c index 731c6a3b1..d6cb4cf74 100644 --- a/src/drivers/driver_common.c +++ b/src/drivers/driver_common.c @@ -52,6 +52,7 @@ const char * event_to_string(enum wpa_event_type event) E2S(RX_PROBE_REQ); E2S(NEW_STA); E2S(EAPOL_RX); + E2S(RSN_PREAUTH_RX); E2S(SIGNAL_CHANGE); E2S(INTERFACE_ENABLED); E2S(INTERFACE_DISABLED);