From patchwork Thu Sep 17 21:23:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Clouter X-Patchwork-Id: 1366448 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=2001:8b0:10b:1231::1; helo=merlin.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=digriz.org.uk Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=heYSYOlB; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=digriz.org.uk header.i=@digriz.org.uk header.a=rsa-sha256 header.s=fm1 header.b=ueJGngfT; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=G88+8u00; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BsqkR1CKQz9sT5 for ; Fri, 18 Sep 2020 07:25:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=YEEMV6XcxIvlOi9O9wXhfgpUg8ZIMPjK96/9E60gWV0=; b=heYSYOlBZ4S6yYfo3/NA6dYxz/ eKV/7rdN44kMTBSNGKCNLe+WQAQ36iilq3+on7Vbg/eTeOIKqCi7eiqezT4oDh9HChzqxWv4r8cpG o+vemHuD1kvJWEGnjtluEnHgOQuzmx9xHiZUUNdiR+9XTg63MnrUBTq/67n8D8E6SCr2NxvG31GPK gSmTqnwQj/vRB9+lt8q2WxMgeiYFJCvLpFUxEUpnCgc5FFiA5zs++8lTpJ2OfzwiVUsU0xiOB9AWA I7yJLwgZf1zUf51miUaBnHO5vU6Tu6hheitCThRrzdoGM29ER0p+Cx+BW3HuPItHiiRMXJsgVRROv SC0erjYw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ1Nz-000873-Cc; Thu, 17 Sep 2020 21:24:11 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ1Nw-00086e-DG for hostap@lists.infradead.org; Thu, 17 Sep 2020 21:24:09 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2A1FD5C01FC; Thu, 17 Sep 2020 17:24:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 17 Sep 2020 17:24:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digriz.org.uk; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=KDghB5JxRe9ll2WflMLctCDe0e nB/o+dhamVJszHAZs=; b=ueJGngfTaEFOh16+8lAQaKTdMWj31wWTWdV8LPFIi1 FZLP6dD+s3NoWqhXdTHCr8p3itvKqRum4xCP9x3CYZlMcBFOzTnuOyGD3xuZ5dgG 2CBzxcEM/Ae9zeWK6bC3ZwRVL7PC6hKHLNbci/w2Ou1SScIaAmYRqsE13I0RNQj9 oiVqVnjx2TnYYuuXFeGVH50+AyJKeGJb3VHizqYkBXmqQlA6bGdJosMSzOKvw1ds SyUltfuRRyWuq37CH3XdCkatB+Q1u+6rxf7vZHAmHtpGUCP6x4RzZUpiacbg2bMd bPk45du4m/8YKoMYOLqmioRRRr9zMUTRuYgW4H2tJWJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=KDghB5JxRe9ll2Wfl MLctCDe0enB/o+dhamVJszHAZs=; b=G88+8u00eaYASlvFNnvGjyeT6qx40L0le TLAByNxxD+3ZZM9aPcpJtHqeml981Rimom6nWGFYa3J1kP4yRhUxrH8ic+rz7fcp o/5OW6D/JxtndP/kAxQikTn4jfyXlOMbMd0ZwY0kNylGYQWzw85RaZpaC+ES7n1j wpl2nbs+eMuxZPcnqZHsQPg+qXZqm9fLBAwc0hNk96Z0hDi/eWGPPrq1dzkcID7C fZTVlItF3yOXmCkSDVXd4getJWdQKuuJc+9GEDH7Zpf1YdMwIjCHG3JbYa8o/k+0 rxqI4BLVQ1jRCThuvhBmw8ZZGtgjW3v/ZctigkNF9n0VAFeTP4x/Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehlvgigrghnuggvrhcuvehlohhuthgvrhcuoegrlhgvgiesughi ghhrihiirdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepjefhieekgfejveefudettd eljeejleejvefghedvgedvgfektdeileehvdeggefhnecukfhppedvuddvrdeiledrheef rdegkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grlhgvgiesughighhrihiirdhorhhgrdhukh X-ME-Proxy: Received: from quatermain.digriz.wormnet.eu (cust48-dsl53.idnet.net [212.69.53.48]) by mail.messagingengine.com (Postfix) with ESMTPA id C150A3064687; Thu, 17 Sep 2020 17:24:00 -0400 (EDT) From: Alexander Clouter To: hostap@lists.infradead.org Subject: [PATCH] PEAP peer: allow autheap for EAP-TLS phase2 support Date: Thu, 17 Sep 2020 22:23:29 +0100 Message-Id: <20200917212328.1564-1-alex@digriz.org.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_172408_633005_D6CB31CE X-CRM114-Status: GOOD ( 10.09 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.26 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.111.4.26 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Alexander Clouter Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org --- src/eap_peer/eap_peap.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/eap_peer/eap_peap.c b/src/eap_peer/eap_peap.c index 7c3704369..7bcba4de2 100644 --- a/src/eap_peer/eap_peap.c +++ b/src/eap_peer/eap_peap.c @@ -146,13 +146,29 @@ static void * eap_peap_init(struct eap_sm *sm) if (config && config->phase1) eap_peap_parse_phase1(data, config->phase1); - if (eap_peer_select_phase2_methods(config, "auth=", - &data->phase2_types, - &data->num_phase2_types, 0) < 0) { + if (os_strstr(config->phase2, "auth=") && os_strstr(config->phase2, "autheap=")) { + wpa_printf(MSG_ERROR, + "EAP-PEAP: Both auth= and autheap= params cannot be specified"); eap_peap_deinit(sm, data); return NULL; } + if (os_strstr(config->phase2, "auth=")) { + if (eap_peer_select_phase2_methods(config, "auth=", + &data->phase2_types, + &data->num_phase2_types, 0) < 0) { + eap_peap_deinit(sm, data); + return NULL; + } + } else { + if (eap_peer_select_phase2_methods(config, "autheap=", + &data->phase2_types, + &data->num_phase2_types, 0) < 0) { + eap_peap_deinit(sm, data); + return NULL; + } + } + data->phase2_type.vendor = EAP_VENDOR_IETF; data->phase2_type.method = EAP_TYPE_NONE;