From patchwork Tue Aug 20 08:56:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bilal Hatipoglu X-Patchwork-Id: 1149935 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=airties.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DJ9FnvSJ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=airties.onmicrosoft.com header.i=@airties.onmicrosoft.com header.b="puexdVkA"; 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 46CPmJ5YhCz9s3Z for ; Tue, 20 Aug 2019 18:56:32 +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: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:In-Reply-To:References: List-Owner; bh=7SsuqteoCCdpAP3UC6eJ11vtey2KxrkTXtZefNKoD/A=; b=DJ9FnvSJE3xnoi dzBBjwaAQHWQNQCAKJ7f3LoeK7ur3ks7E7/sDh9T/tQqTM2OiKoNyzRxQ8krGkn6scM2n1aeDPnzr 0VuNw4CmkGS0LbmCoxaOaGrxVsToe9qKg8oyixc3UP2Kq5Y6XAS1jMWtAacGtRC+qOrHuAB4tC0wv XpX8gL3A6dmHGbYtXbGKVtztFadvNz8dKLOGFr1Oblmb1xs90hgMgEMA/ML5jrII07wRz1RMS2gPV D4T1D4lZo9HEUkhyJB0hN+1jOpVG+AZ2LQtVM9ZefFdTqsA+W2doYib1iCl+93WAfplxGZyHDm0C3 ws0Kmf8Frb0wUys5fxAw==; 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 1hzzwK-000672-8o; Tue, 20 Aug 2019 08:56:28 +0000 Received: from cluster-e.mailcontrol.com ([85.115.58.190]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hzzwG-00066g-5W for hostap@lists.infradead.org; Tue, 20 Aug 2019 08:56:26 +0000 Received: from airtiesesg.westeurope.cloudapp.azure.com (esg.airties.com [13.94.148.158]) by rly08e.srv.mailcontrol.com (MailControl) with ESMTPS id x7K8uKOZ046801 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Aug 2019 09:56:21 +0100 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (unknown [104.47.8.53]) by Forcepoint Email with ESMTPS id 2F31B3FBAEBFA for ; Tue, 20 Aug 2019 11:25:31 +0300 (AST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hCFONjC55ucZZ+77feVd7pXfzBKj3hqei57ITykh8dox07BfQns+I9zXaZTYkMd6tEVWchmyHdiuD69eRnNlSa66N21OoOUZfhA5Ov8yV+CYaU1PDNpY9/m48tbM2hNWtbWfhCgiPDfGRVp04DQ4EZ1RD9O41+1ZmCe/WEC9e3bRF/5gjOlyllvfEEsji92yhK7IEHQfvNkj1I7EKDox2EDB/5grgG2SAeDyBU+czN3cnndSlfKoTvJ3K+s/VmHrWEgu5c/jBPNWlazTEx+Y4ao0R4EVGMmPSGb67ebaNIugIki6FGG+qk3x+OU2YhQYmqgZz67c0FR1waIX0p+Cvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jyN9kxw5f4o8+1gSu9V7GpCbCm4HOjfMFzgRuKlKTVI=; b=HgszS7M9kgHKxtq90hvVBZ09fFWtecXgMFK8FtC+nCafZoXr5gXfZNCQsaKXKPSeSwuLzsX9uAAdbAZmVxKoBtxcWvY882qzbLUFWZoYyV+R7J52xIpn4rMgCZdKxamFM/b3j6ktXUuOvCfHHO/ssJtmADAPSx8YS5hZmaeWmkIIk2D9iVY3dO7q8aH0WsIWP4JG0I7UcqSvFqqNCSEcDDQIWer3Lqnn8HtLkoIXenUdGtUVCsUk4O2ZeUNMZiA/mcs6J6GtcWMrPIF90xJnwyBOJ+C45Oel3nQMfxykV8O/4WyP1VG82EhaFo9dZXQ7YYP8D/9AGKLF1eYX8Axhxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=airties.com; dmarc=pass action=none header.from=airties.com; dkim=pass header.d=airties.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=airties.onmicrosoft.com; s=selector2-airties-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jyN9kxw5f4o8+1gSu9V7GpCbCm4HOjfMFzgRuKlKTVI=; b=puexdVkA0Bsp/27T9BxuuqAliI2fkeaBKonl5/EGDUBrNEm1xGRe8bylyZ7c6OakNr7WKBaY3reVmOlhQMvAKIzvbrKb8xZPAUyWW0EOWSgKH1DeT5uJR3dZQiZNkvIboXI/6URP+NNxvDMDlR/ek61r7YnVzvup6rqak/eNLxQ= Received: from VI1PR10MB2317.EURPRD10.PROD.OUTLOOK.COM (20.177.62.81) by VI1PR10MB2046.EURPRD10.PROD.OUTLOOK.COM (52.134.28.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Tue, 20 Aug 2019 08:56:19 +0000 Received: from VI1PR10MB2317.EURPRD10.PROD.OUTLOOK.COM ([fe80::f4bd:415c:9bdd:caa7]) by VI1PR10MB2317.EURPRD10.PROD.OUTLOOK.COM ([fe80::f4bd:415c:9bdd:caa7%5]) with mapi id 15.20.2178.018; Tue, 20 Aug 2019 08:56:19 +0000 From: Bilal Hatipoglu To: "hostap@lists.infradead.org" Subject: [PATCH] Implement wps-pin-active and wps-cancel events Thread-Topic: [PATCH] Implement wps-pin-active and wps-cancel events Thread-Index: AQHVVzUiTy2Lg/urH0aaJFizs3Kv5w== Date: Tue, 20 Aug 2019 08:56:19 +0000 Message-ID: <1566291374-28895-1-git-send-email-bilal.hatipoglu@airties.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: LO2P265CA0266.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::14) To VI1PR10MB2317.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:89::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=bilal.hatipoglu@airties.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [91.220.65.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 55819c2d-d5e7-4e23-c8f1-08d7254c449f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:VI1PR10MB2046; x-ms-traffictypediagnostic: VI1PR10MB2046: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 013568035E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(396003)(376002)(39850400004)(366004)(199004)(189003)(50226002)(476003)(386003)(26005)(6506007)(6512007)(6916009)(6486002)(316002)(2906002)(66066001)(14454004)(102836004)(36756003)(53936002)(2616005)(508600001)(186003)(8676002)(305945005)(14444005)(256004)(5660300002)(1730700003)(81156014)(81166006)(25786009)(6116002)(71200400001)(486006)(71190400001)(2351001)(66946007)(44832011)(8936002)(7736002)(66446008)(64756008)(66556008)(66476007)(3846002)(52116002)(2501003)(6436002)(5640700003)(99286004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR10MB2046; H:VI1PR10MB2317.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: airties.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ag1QVt3pOkYH4IrC+VzzuH68Wg3lnELE+NBc7ouHpcjgSOn/f8I+nScczpDYHvQvz6Bq1TcoW95FlPPoSWCpwQyJSZfAFSQiOOBwD+YH1ZFQlILSsdYZgh1PyoIw+TUGdG+IZCCu2s3CO2Yck5ZWrQbZNr2nbTDeknu3oL4JxLdOhnKEyGcv9lS3iekUBrtz8PTC6Z+GWA05sscgkGoH1GEZ3822JaZs/2AYbwit/utdLuF+FYjwDZsieoTwUDw51MbYfBb+jp8+NnSoUayl1nxV/BTIWyjOxA9Lt6MNqQHPOhlLosJWD0qdAwmk4WrOlJYR0apvFfOk2Z+HQoBKg8su94/1R5PbiwPQpzurM0hhya3Vj/WZhJ4MdMmGShQTAZLmt3D+Kk73qLrCpEyi5E3j78Nm6cgQ/tEGCh4oChY= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: airties.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55819c2d-d5e7-4e23-c8f1-08d7254c449f X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2019 08:56:19.7537 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 316fd558-a5a6-42fd-9da7-d0f38e0864f6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6UBQG+f4F3hBoHrOjahxlFULtKsf0hLP6FGd145tZG8fn3AEtHf71IVDyfLJtkC7RWja+tuefGOxKQMKzPGNGCr3lZwOG2OhrODyHFCQuI8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2046 X-MailControl-OutInfo: MTU2NjI5MTM4MTpGUEtleTEucHJpdjogAfjIIcFEcn01BWIET6jScQAhkzlPew7XDE9H8cqIZJdCiJV4lxkdim+4bSQafwU5wPN3k1QVtiU8jQBLJlGMiaU6/sXTGuPe7EfuOE6QVvvDkiu2Fjz23fBYRVBylDE1pYy1Kr050+8IlfXOqEQMxiDHZZ1EyRiPFGy7mJgLNvJEQFsneWOYBz8Yqqh4NW/pejIl8HmMzDIhOuYEmeWh9E2YSdK9KS91Vbi2MppNOgFSAgP/TV/4ZP/dtmx4x3EO6LCYx7ckdaGY2AeD4gzbq7D5vFsMFow4MaogQEUFc+MPnuBekWZNUt964b2rDqBdzCGQ1nwskllP0/+layiF X-Scanned-By: MailControl 44278.2072 (www.mailcontrol.com) on 10.69.0.118 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_015624_501821_A28E4394 X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: -0.5 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [85.115.58.190 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid 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_WPS_CANCEL and WPS_EVENT_AP_CANCEL is added to indicate cancellation of WPS operation for any reason. WPS-PIN-ACTIVE is added to indicate when a PIN operation is triggered in supplicant. Additionally, existing WPS_EVENT_AP_PIN_ENABLED is triggered in the correct place. Signed-off-by: Veli Demirel Signed-off-by: Veli Demirel --- src/ap/wps_hostapd.c | 5 ++++- src/common/wpa_ctrl.h | 3 +++ wpa_supplicant/wps_supplicant.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 6161cdb..4b9ccfa 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -1347,8 +1347,10 @@ static int wps_add_pin(struct hostapd_data *hapd, void *ctx) ret = wps_registrar_add_pin(hapd->wps->registrar, data->addr, data->uuid, data->pin, data->pin_len, data->timeout); - if (ret == 0) + if (ret == 0) { data->added++; + wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_AP_PIN_ENABLED); + } return ret; } @@ -1423,6 +1425,7 @@ static int wps_cancel(struct hostapd_data *hapd, void *ctx) if (hapd->wps) { data->count++; + wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_AP_CANCEL); wps_registrar_wps_cancel(hapd->wps->registrar); ap_for_each_sta(hapd, ap_sta_wps_cancel, NULL); } diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index b24ae63..d180fac 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -143,6 +143,8 @@ extern "C" { #define WPS_EVENT_TIMEOUT "WPS-TIMEOUT " /* PBC mode was activated */ #define WPS_EVENT_ACTIVE "WPS-PBC-ACTIVE " +#define WPS_EVENT_PIN_ACTIVE "WPS-PIN-ACTIVE " +#define WPS_EVENT_WPS_CANCEL "WPS-CANCEL " /* PBC mode was disabled */ #define WPS_EVENT_DISABLE "WPS-PBC-DISABLE " @@ -299,6 +301,7 @@ 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_AP_CANCEL "WPS-AP-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..f61ebfe 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -1286,6 +1286,7 @@ 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 +1352,8 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s) wpas_clear_wps(wpa_s); } + wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_WPS_CANCEL); + wpa_s->after_wps = 0; return 0;