From patchwork Mon Feb 24 09:15:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 1242950 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=fail (p=none dis=none) header.from=intel.com 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=nTJgOIqD; 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 48QxwS0yDhz9sRR for ; Mon, 24 Feb 2020 20:44:08 +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=Dm5dUStYtSvS09B+fin5Qw5TXyqICI+V7z/0ucCXzv8=; b=nTJgOIqDb8MYaatj12J43SNIxu MkzOyOrK8YH0tTooIxpVqNTaUIugyuoXdmkPz6D++xA44S1ywzQpl6NB/Ht1MI+7HwbMQwxpNpsZj W50d9KltO5XYKbPbygja1k0WLSVZWgp/+NCVNpOKh7J5rTqIaHJ3QXxGvhJJX7Po/cxK7A/i/HMvu fgMM84X/71W60dyy15T/j3bVcljRLqttWsq7hr++J+5GuSXuzIqMbegMlGK37LSZfR1qs52fgdUYc p4L3yYLlCrckUMTvD98eftnb3x1LKzGQl6+SODyPeO2QUGmQ6KGH4a9mrhlpU+g1fswc5y9w37ECJ tJWjh7gw==; 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 1j6AHS-00059k-Si; Mon, 24 Feb 2020 09:44:02 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j69qH-0007ne-5i for hostap@lists.infradead.org; Mon, 24 Feb 2020 09:15:59 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 01:15:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,479,1574150400"; d="scan'208";a="225914478" Received: from jed01681.jer.intel.com ([10.12.190.127]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2020 01:15:41 -0800 From: Ilan Peer To: hostap@lists.infradead.org Subject: [PATCH 06/14] WPA: Add a function to get PMKSA cache entry Date: Mon, 24 Feb 2020 11:15:21 +0200 Message-Id: <20200224091529.15259-7-ilan.peer@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200224091529.15259-1-ilan.peer@intel.com> References: <20200224091529.15259-1-ilan.peer@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200224_011557_312622_ADE36AB1 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.3 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 [192.55.52.151 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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: Ilan Peer MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Ilan Peer --- src/rsn_supp/wpa.c | 10 ++++++++++ src/rsn_supp/wpa.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 4a64fbb455..c9ed784765 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -3580,6 +3580,16 @@ int wpa_sm_pmksa_exists(struct wpa_sm *sm, const u8 *bssid, } +struct rsn_pmksa_cache_entry *wpa_sm_pmksa_cache_get(struct wpa_sm *sm, + const u8 *aa, + const u8 *pmkid, + const void *network_ctx, + int akmp) +{ + return pmksa_cache_get(sm->pmksa, aa, pmkid, network_ctx, akmp); +} + + void wpa_sm_drop_sa(struct wpa_sm *sm) { wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Clear old PMK and PTK"); diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h index b9c3cb53f7..07e4072dec 100644 --- a/src/rsn_supp/wpa.h +++ b/src/rsn_supp/wpa.h @@ -177,6 +177,11 @@ void wpa_sm_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, int wpa_sm_pmksa_exists(struct wpa_sm *sm, const u8 *bssid, const void *network_ctx); void wpa_sm_drop_sa(struct wpa_sm *sm); +struct rsn_pmksa_cache_entry *wpa_sm_pmksa_cache_get(struct wpa_sm *sm, + const u8 *aa, + const u8 *pmkid, + const void *network_ctx, + int akmp); int wpa_sm_has_ptk(struct wpa_sm *sm); int wpa_sm_has_ptk_installed(struct wpa_sm *sm); @@ -343,6 +348,15 @@ static inline void wpa_sm_drop_sa(struct wpa_sm *sm) { } +struct rsn_pmksa_cache_entry *wpa_sm_pmksa_cache_get(struct wpa_sm *sm, + const u8 *aa, + const u8 *pmkid, + const void *network_ctx, + int akmp) +{ + return NULL; +} + static inline int wpa_sm_has_ptk(struct wpa_sm *sm) { return 0;