From patchwork Thu Sep 5 09:33:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Bilal_Hatipo=C4=9Flu?= X-Patchwork-Id: 1158323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mFS+F62A"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LgL8xsHZ"; 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 46PFr66x6nz9sBF for ; Thu, 5 Sep 2019 19:33:58 +1000 (AEST) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=++GV19jbN7vgqMUFGREXJ8ALv7BmHUw5YXi04V9TLIU=; b=mFS+F62Aqfd6tp JnrPfaVy4iQNL4OFY9kM4YEjmMsWDCR0BU0KHKzsto7t/nFxoz8KeCWjbSJf2IrxaEo48jw1yFKrm LKkAatzX30wd+I0YuhT39RhJpXL3gFtBoPm7As23gSf19n2voSMB3/3J8onuOOCJnVEBdf/Pa9/CM EqIYJt7waWNbzTgWqG4xul4Q2M0WitwzG6NabfXnntgd2n7OwnRx8BZnCDY95PYKALpPLWqgVjpHz 22mgCZeL8vMzmmcvkUphEse/OZQ+8Bs2JI7527sgBwVCXvrLSbcKTa3AWHgZgN01v1wh0SRneodNf we21Zl9CkQQYN0/pagww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i5o9M-0002dk-3p; Thu, 05 Sep 2019 09:33:56 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i5o9I-0002dO-Mo for hostap@lists.infradead.org; Thu, 05 Sep 2019 09:33:54 +0000 Received: by mail-wm1-x334.google.com with SMTP id p13so2098417wmh.1 for ; Thu, 05 Sep 2019 02:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=dCLhz6M4Jrnq0Arn69k0t7IJbKgjBE8fWOVbbi66am0=; b=LgL8xsHZT5hLLZ7iflkCK6/5O5vx1j902uyHR8G5qygpu8oUFurdP4pLAyPBjwSsXn HmcPGg1fxdHp9Q2SsRcqJR7otoZ2TQCCOoFDvqBH7Xqg14nG21CEaBSL7y6sYURYa9oA bhCWkjkhG2zkLqMx8zeC8bkXdaBxKOxhzIgzGvf/LZLgFPKwUsm+abQ6I1/KM81R2+aE CA4X5mf/lwnMg6VZLw33ZX7jWHzxzXRlCOiPv+JS1aKLAFDKupOlehZbc8DkuJn42m6G hBEepehrMr4FgaQSwNCYdyPfrjBZ7PfFZu8cb20eAtqYlxyXgboc554wXl0IKz7ssQBC r2Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dCLhz6M4Jrnq0Arn69k0t7IJbKgjBE8fWOVbbi66am0=; b=oEIFZR4ExTPqgLIGBLuGfnD0zgXpkifDIzvzfykWWoFWDdASPK3/TgK94xTY+JQFdX WINth3fW6DAz0rqTI6GSrgGe88UjFl8DQ3l8cKNAHJja+5mdP1XUUejpFoI6h7VnitUL Ngmrcyh86mAHbABanE9aprETriFaY2TKR0UG35EiqJbeuvAmudY1MtGmhOzesPDMt6mY NnImRoUyZTWTDVB5ql8LVSEDZmb0WPtkgwOHkYWtnwwRv4vON1RrK2Y6z+9miFqn+wE0 hPeHdebdUqZMK1IChwSc+hiCuyDtLObVMdlvMqkvt69bxkfnxD7zmfDM1f9pJNWuluzt royw== X-Gm-Message-State: APjAAAURkmNpKMd5wsASoyFaeWApbIej5sCg8Zcoz9YvgcqoiFRi7dUW HtIfNzSpiYzP9jGOJuMZK1la9IiyGQc= X-Google-Smtp-Source: APXvYqyKQ2HIG+gou1/MWjyw1fqc5djGX3sijtfNoFbIaqXp8xl+lCB/1mlPcUQdbfb2JcLzMPSyLQ== X-Received: by 2002:a1c:a94b:: with SMTP id s72mr2113335wme.9.1567676030567; Thu, 05 Sep 2019 02:33:50 -0700 (PDT) Received: from bilal-desktop.test.airties.com ([91.220.65.2]) by smtp.gmail.com with ESMTPSA id z142sm4845116wmc.24.2019.09.05.02.33.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Sep 2019 02:33:50 -0700 (PDT) From: bilalhp@gmail.com To: hostap@lists.infradead.org Subject: [PATCH v2] Implement wps-pin-active and wps-cancel events Date: Thu, 5 Sep 2019 12:33:44 +0300 Message-Id: <1567676024-19946-1-git-send-email-bilalhp@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567520411-24933-1-git-send-email-bilal.hatipoglu@airties.com> References: <1567520411-24933-1-git-send-email-bilal.hatipoglu@airties.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190905_023352_747907_C84197E4 X-CRM114-Status: GOOD ( 12.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:334 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bilalhp[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bilal Hatipoglu WPS_EVENT_CANCEL is added to indicate cancellation of WPS operation for any reason in hostapd/wpa_supplicant. WPS_EVENT_PIN_ACTIVE is added to indicate when a PIN operation is triggered in supplicant. Signed-off-by: Veli Demirel Signed-off-by: Bilal Hatipoglu Signed-off-by: Veli Demirel Signed-off-by: Bilal Hatipoglu --- src/ap/wps_hostapd.c | 1 + src/common/wpa_ctrl.h | 2 ++ wpa_supplicant/wps_supplicant.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 6161cdb..2f1af11 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -1425,6 +1425,7 @@ static int wps_cancel(struct hostapd_data *hapd, void *ctx) data->count++; wps_registrar_wps_cancel(hapd->wps->registrar); ap_for_each_sta(hapd, ap_sta_wps_cancel, NULL); + wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_CANCEL); } return 0; diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index b24ae63..3a3e69b 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -299,6 +299,8 @@ extern "C" { #define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED " #define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED " #define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED " +#define WPS_EVENT_PIN_ACTIVE "WPS-PIN-ACTIVE " +#define WPS_EVENT_CANCEL "WPS-CANCEL " #define AP_STA_CONNECTED "AP-STA-CONNECTED " #define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED " #define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH " diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 0579274..f953218 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -1286,6 +1286,9 @@ static int wpas_wps_start_dev_pw(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "WPS: Failed to set phase1 '%s'", val); return -1; } + + wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_PIN_ACTIVE); + if (wpa_s->wps_fragment_size) ssid->eap.fragment_size = wpa_s->wps_fragment_size; eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout, @@ -1351,6 +1354,7 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s) wpas_clear_wps(wpa_s); } + wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_CANCEL); wpa_s->after_wps = 0; return 0;