From patchwork Sun Dec 15 09:34:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 1209876 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.b="QFIeTTi1"; 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 47bK8g6260z9sPJ for ; Sun, 15 Dec 2019 20:38:27 +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=NzqGnpTW4EBJkpeoxyfCVXSX6O2Cvup8fusjLeNBhRs=; b=QFIeTTi1nk+pDtuonNl6CNwT5i HXBL7AZr2qpf3zL2hfKYP8En1CnZ1jVo590475TnALH5oxqQ4bLU1jDDm1j249n0r9Fsp1YmFng0K VRjN+N9Jip8gm+A5JUJJiKQelc+YYTSgVHhMDQkAuWT9l8EprJv5Ut+5ohVjBc+7FPs21MCxd1rar QdlMSsXexSL7101WVW4CgZU7IVzWEa2yFKiTAWGGpRq/cZWzPxxHwok+bMJatzR20rZILRpU8mZ2Q puF8/UUv2RTWVBxjUcqi9mMv2zRaf2FuAUvAbwajFexRq/RUZFMnUvthKW1/ZAvyHPBeUWeQZQS/J txBVEJCQ==; 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 1igQM2-0000go-Cn; Sun, 15 Dec 2019 09:38:22 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1igQJ0-0004ms-FK for hostap@lists.infradead.org; Sun, 15 Dec 2019 09:35:16 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Dec 2019 01:35:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,317,1571727600"; d="scan'208";a="216889353" Received: from jed01681.jer.intel.com ([10.12.190.127]) by orsmga006.jf.intel.com with ESMTP; 15 Dec 2019 01:35:09 -0800 From: Ilan Peer To: hostap@lists.infradead.org Subject: [PATCH 17/40] WPA: Add a function to get PMKSA cache entry Date: Sun, 15 Dec 2019 11:34:15 +0200 Message-Id: <20191215093438.10120-18-ilan.peer@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191215093438.10120-1-ilan.peer@intel.com> References: <20191215093438.10120-1-ilan.peer@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191215_013514_569130_658BE80A X-CRM114-Status: UNSURE ( 8.80 ) 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 [192.55.52.120 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO 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: 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 9d8fcda0a4..f63c9f4787 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -3473,6 +3473,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 9c9e3825a1..162cdefbf0 100644 --- a/src/rsn_supp/wpa.h +++ b/src/rsn_supp/wpa.h @@ -172,6 +172,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); void wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr); @@ -337,6 +342,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;