From patchwork Fri Jul 16 05:21:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arowa Suliman X-Patchwork-Id: 1506002 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; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=yfh5Js8E; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=J3WxAYsE; 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 4GR04V1PMbz9sXM for ; Fri, 16 Jul 2021 15:22:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9PusD4k719VGp9WSQtJAgmJffO/5eq0MwPkfosQfEgo=; b=yfh5Js8E7NRRFo O58N6fhJfXaVXhRI8EsRIFtvMJ5eG1LEE58HYFy+HAmwRfOizJMQRH29QoDEv0F4ZmL/fvPmuvq5Y SimBvaQRNN3rhiXpyhJB4WshoENtD2Q8xQmUZGoLmwDoSS+4YBiFqI+FL70cHeiDp7l3+Ww1andwM nGwUd1y656v2l+wrFi/oJxLYDLfHSqLk5zlzPidbqUFV6On0UokuTlUfQrw+UR/Pa0Ztx1Gs97JU0 drHe5FmCLy1EMQ3Z2aBb7CBTIVA8O62u9vpDbTYYleCgH+2R2XjH6cwPhsJ/Xkj0L3p0POzOITHCi mmskIRiYbkNt7IYnO3lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4GIT-003ATm-Tc; Fri, 16 Jul 2021 05:22:01 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4GI0-003AMD-AY for hostap@lists.infradead.org; Fri, 16 Jul 2021 05:21:35 +0000 Received: by mail-pg1-x52b.google.com with SMTP id h4so8860702pgp.5 for ; Thu, 15 Jul 2021 22:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k4Z2fOlTkHo4z+jHHbQGwRse1wgKoauNw9uo2p3HvjA=; b=J3WxAYsEGXkLqjvy5DfuM0TXjZYsDKHecQIJZ29VVR2+CZwNN5fqCxJW64WYpFwRKg rNGNoo6QrUOUa1d9e4IeNk4FYt4kzs6ECKNLwDGLV2zRn6OCIjP382P5Bfzkd5kIfGNG zt6orCh3sU1kJUeA2VfXpx/HTPW6J3KYyaAY8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k4Z2fOlTkHo4z+jHHbQGwRse1wgKoauNw9uo2p3HvjA=; b=sf9/Cl4d6u8c0CWFGWst8WUSWxU12+Xe2fmpNaZOq5p9VS+eArp/Lzy5awa27v9eqF 3RMXTxgTHsKe6qCjZNhGQwV6aBJAwEft48V0izEiJ4PsNnbJkwD8EgwYjNPz7ZzzkxFo 66yGnogxnx7B15fFn9wHD7Tt/6uHJ6fFdwi+8ARQdZg0eYgZw+yueut3hq+AhhBBWrRv SfcDtiwqZtgHHdvEbiAiGuVxkf1yPa2ofz5x/pnjP4LdjrhIZ6tCK+MtVTroUjp0MGqc x844iP0XKcIezIQkNarbopiPcU7fajxDWcdwMTXfWVtZLpXyYN8Ui7Wnz83FtlkntCg7 S4fQ== X-Gm-Message-State: AOAM532FSAcYRBivjyC9zQ1VzeC/JKVJI7xXeDUIrKzdERi+Kn2+3eNq MOLLos77w+pjGsi4QLjFguVr3HwPWfACGw== X-Google-Smtp-Source: ABdhPJxS0lb1SE4L3r0MNLISVE3l+t9Fcz//FzPJUXCXlneb0Hzgw7yJN3wTFinq4I5zazCW33ZHFQ== X-Received: by 2002:a63:4607:: with SMTP id t7mr8101454pga.31.1626412891351; Thu, 15 Jul 2021 22:21:31 -0700 (PDT) Received: from arowa.mtv.corp.google.com ([2620:15c:202:201:9ee6:32bb:8e18:c20a]) by smtp.gmail.com with ESMTPSA id u19sm8456934pfi.4.2021.07.15.22.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 22:21:31 -0700 (PDT) From: Arowa Suliman X-Google-Original-From: Arowa Suliman To: hostap@lists.infradead.org Cc: Arowa Suliman , Arowa Suliman Subject: [PATCH v4 5/8] src: wlantest: Replace Dummy with Stub Part 1. Date: Thu, 15 Jul 2021 22:21:07 -0700 Message-Id: <20210716052110.2714866-4-arowa@google.com> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog In-Reply-To: <20210716052110.2714866-1-arowa@google.com> References: <20210716052110.2714866-1-arowa@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210715_222132_448331_CC2DE56F X-CRM114-Status: GOOD ( 25.63 ) X-Spam-Score: -0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Replaced the word dummy with the inclusive word Stub. Signed-off-by: Arowa Suliman --- src/ap/wpa_auth.c | 18 +++++++------- src/ap/wpa_auth_ft.c | 12 ++++----- src/common/sae.c | 12 ++++----- src/crypto/crypto_internal-rsa.c | 2 +- [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52b 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 -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.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.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal information -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 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 Replaced the word dummy with the inclusive word Stub. Signed-off-by: Arowa Suliman --- src/ap/wpa_auth.c | 18 +++++++------- src/ap/wpa_auth_ft.c | 12 ++++----- src/common/sae.c | 12 ++++----- src/crypto/crypto_internal-rsa.c | 2 +- src/crypto/random.c | 42 ++++++++++++++++---------------- src/drivers/driver_ndis.c | 16 ++++++------ src/drivers/driver_nl80211.c | 2 +- src/eap_peer/eap_proxy_dummy.c | 2 +- src/eap_peer/eap_teap.c | 8 +++--- src/eap_peer/eap_tls_common.h | 2 +- src/l2_packet/l2_packet_none.c | 2 +- wlantest/inject.c | 24 +++++++++--------- wlantest/rx_eapol.c | 4 +-- 13 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 83805681e..6d60f2629 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -2742,7 +2742,7 @@ static struct wpabuf * fils_prepare_plainbuf(struct wpa_state_machine *sm, struct wpabuf *plain; u8 *len, *tmp, *tmp2; u8 hdr[2]; - u8 *gtk, dummy_gtk[32]; + u8 *gtk, stub_gtk[32]; size_t gtk_len; struct wpa_group *gsm; size_t plain_len; @@ -2785,11 +2785,11 @@ static struct wpabuf * fils_prepare_plainbuf(struct wpa_state_machine *sm, * Provide unique random GTK to each STA to prevent use * of GTK in the BSS. */ - if (random_get_bytes(dummy_gtk, gtk_len) < 0) { + if (random_get_bytes(stub_gtk, gtk_len) < 0) { wpabuf_clear_free(plain); return NULL; } - gtk = dummy_gtk; + gtk = stub_gtk; } hdr[0] = gsm->GN & 0x03; hdr[1] = 0; @@ -3372,7 +3372,7 @@ static u8 * replace_ie(const char *name, const u8 *old_buf, size_t *len, u8 eid, SM_STATE(WPA_PTK, PTKINITNEGOTIATING) { - u8 rsc[WPA_KEY_RSC_LEN], *_rsc, *gtk, *kde = NULL, *pos, dummy_gtk[32]; + u8 rsc[WPA_KEY_RSC_LEN], *_rsc, *gtk, *kde = NULL, *pos, stub_gtk[32]; size_t gtk_len, kde_len, wpa_ie_len; struct wpa_group *gsm = sm->group; u8 *wpa_ie; @@ -3458,9 +3458,9 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) * Provide unique random GTK to each STA to prevent use * of GTK in the BSS. */ - if (random_get_bytes(dummy_gtk, gtk_len) < 0) + if (random_get_bytes(stub_gtk, gtk_len) < 0) goto done; - gtk = dummy_gtk; + gtk = stub_gtk; } gtkidx = gsm->GN; _rsc = rsc; @@ -3853,7 +3853,7 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING) const u8 *kde; u8 *kde_buf = NULL, *pos, hdr[2]; size_t kde_len; - u8 *gtk, dummy_gtk[32]; + u8 *gtk, stub_gtk[32]; struct wpa_auth_config *conf = &sm->wpa_auth->conf; SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); @@ -3885,9 +3885,9 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING) * Provide unique random GTK to each STA to prevent use * of GTK in the BSS. */ - if (random_get_bytes(dummy_gtk, gsm->GTK_len) < 0) + if (random_get_bytes(stub_gtk, gsm->GTK_len) < 0) return; - gtk = dummy_gtk; + gtk = stub_gtk; } if (sm->wpa == WPA_VERSION_WPA2) { kde_len = 2 + RSN_SELECTOR_LEN + 2 + gsm->GTK_len + diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c index f91a2d2d5..fef1104d2 100644 --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c @@ -2259,7 +2259,7 @@ static u8 * wpa_ft_igtk_subelem(struct wpa_state_machine *sm, size_t *len) const u8 *kek, *igtk; size_t kek_len; size_t igtk_len; - u8 dummy_igtk[WPA_IGTK_MAX_LEN]; + u8 stub_igtk[WPA_IGTK_MAX_LEN]; if (wpa_key_mgmt_fils(sm->wpa_key_mgmt)) { kek = sm->PTK.kek2; @@ -2292,11 +2292,11 @@ static u8 * wpa_ft_igtk_subelem(struct wpa_state_machine *sm, size_t *len) * Provide unique random IGTK to each STA to prevent use of * IGTK in the BSS. */ - if (random_get_bytes(dummy_igtk, igtk_len / 8) < 0) { + if (random_get_bytes(stub_igtk, igtk_len / 8) < 0) { os_free(subelem); return NULL; } - igtk = dummy_igtk; + igtk = stub_igtk; } if (aes_wrap(kek, kek_len, igtk_len / 8, igtk, pos)) { wpa_printf(MSG_DEBUG, @@ -2319,7 +2319,7 @@ static u8 * wpa_ft_bigtk_subelem(struct wpa_state_machine *sm, size_t *len) const u8 *kek, *bigtk; size_t kek_len; size_t bigtk_len; - u8 dummy_bigtk[WPA_IGTK_MAX_LEN]; + u8 stub_bigtk[WPA_IGTK_MAX_LEN]; if (wpa_key_mgmt_fils(sm->wpa_key_mgmt)) { kek = sm->PTK.kek2; @@ -2352,11 +2352,11 @@ static u8 * wpa_ft_bigtk_subelem(struct wpa_state_machine *sm, size_t *len) * Provide unique random BIGTK to each OSEN STA to prevent use * of BIGTK in the BSS. */ - if (random_get_bytes(dummy_bigtk, bigtk_len / 8) < 0) { + if (random_get_bytes(stub_bigtk, bigtk_len / 8) < 0) { os_free(subelem); return NULL; } - bigtk = dummy_bigtk; + bigtk = stub_bigtk; } if (aes_wrap(kek, kek_len, bigtk_len / 8, bigtk, pos)) { wpa_printf(MSG_DEBUG, diff --git a/src/common/sae.c b/src/common/sae.c index 74920a78e..b768c22fa 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -286,7 +286,7 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, u8 addrs[2 * ETH_ALEN]; const u8 *addr[2]; size_t len[2]; - u8 *dummy_password, *tmp_password; + u8 *stub_password, *tmp_password; int pwd_seed_odd = 0; u8 prime[SAE_MAX_ECC_PRIME_LEN]; size_t prime_len; @@ -301,10 +301,10 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, os_memset(x_bin, 0, sizeof(x_bin)); - dummy_password = os_malloc(password_len); + stub_password = os_malloc(password_len); tmp_password = os_malloc(password_len); - if (!dummy_password || !tmp_password || - random_get_bytes(dummy_password, password_len) < 0) + if (!stub_password || !tmp_password || + random_get_bytes(stub_password, password_len) < 0) goto fail; prime_len = sae->tmp->prime_len; @@ -354,7 +354,7 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, } wpa_printf(MSG_DEBUG, "SAE: counter = %03u", counter); - const_time_select_bin(found, dummy_password, password, + const_time_select_bin(found, stub_password, password, password_len, tmp_password); if (hmac_sha256_vector(addrs, sizeof(addrs), 2, addr, len, pwd_seed) < 0) @@ -415,7 +415,7 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, fail: crypto_bignum_deinit(qr, 0); crypto_bignum_deinit(qnr, 0); - os_free(dummy_password); + os_free(stub_password); bin_clear_free(tmp_password, password_len); crypto_bignum_deinit(x, 1); os_memset(x_bin, 0, sizeof(x_bin)); diff --git a/src/crypto/crypto_internal-rsa.c b/src/crypto/crypto_internal-rsa.c index dc7f350af..0c5ceadb8 100644 --- a/src/crypto/crypto_internal-rsa.c +++ b/src/crypto/crypto_internal-rsa.c @@ -14,7 +14,7 @@ #include "tls/pkcs1.h" #include "tls/pkcs8.h" -/* Dummy structures; these are just typecast to struct crypto_rsa_key */ +/* Stub structures; these are just typecast to struct crypto_rsa_key */ struct crypto_public_key; struct crypto_private_key; diff --git a/src/crypto/random.c b/src/crypto/random.c index 1cabf3f4b..548b60dba 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -49,9 +49,9 @@ static u32 pool[POOL_WORDS]; static unsigned int input_rotate = 0; static unsigned int pool_pos = 0; -static u8 dummy_key[20]; +static u8 stub_key[20]; #ifdef __linux__ -static size_t dummy_key_avail = 0; +static size_t stub_key_avail = 0; static int random_fd = -1; #endif /* __linux__ */ static unsigned int own_pool_ready = 0; @@ -109,13 +109,13 @@ static void random_extract(u8 *out) u32 buf[POOL_WORDS / 2]; /* First, add hash back to pool to make backtracking more difficult. */ - hmac_sha1(dummy_key, sizeof(dummy_key), (const u8 *) pool, + hmac_sha1(stub_key, sizeof(stub_key), (const u8 *) pool, sizeof(pool), hash); random_mix_pool(hash, sizeof(hash)); /* Hash half the pool to extra data */ for (i = 0; i < POOL_WORDS / 2; i++) buf[i] = pool[(pool_pos - i) & POOL_WORDS_MASK]; - hmac_sha1(dummy_key, sizeof(dummy_key), (const u8 *) buf, + hmac_sha1(stub_key, sizeof(stub_key), (const u8 *) buf, sizeof(buf), hash); /* * Fold the hash to further reduce any potential output pattern. @@ -227,7 +227,7 @@ int random_pool_ready(void) * some key derivation operations to proceed. */ - if (dummy_key_avail == sizeof(dummy_key)) + if (stub_key_avail == sizeof(stub_key)) return 1; /* Already initialized - good to continue */ /* @@ -238,8 +238,8 @@ int random_pool_ready(void) */ #ifdef CONFIG_GETRANDOM - res = getrandom(dummy_key + dummy_key_avail, - sizeof(dummy_key) - dummy_key_avail, GRND_NONBLOCK); + res = getrandom(stub_key + stub_key_avail, + sizeof(stub_key) - stub_key_avail, GRND_NONBLOCK); if (res < 0) { if (errno == ENOSYS) { wpa_printf(MSG_DEBUG, @@ -263,8 +263,8 @@ int random_pool_ready(void) return -1; } - res = read(fd, dummy_key + dummy_key_avail, - sizeof(dummy_key) - dummy_key_avail); + res = read(fd, stub_key + stub_key_avail, + sizeof(stub_key) - stub_key_avail); if (res < 0) { wpa_printf(MSG_ERROR, "random: Cannot read from /dev/random: %s", @@ -275,10 +275,10 @@ int random_pool_ready(void) } wpa_printf(MSG_DEBUG, "random: Got %u/%u random bytes", (unsigned) res, - (unsigned) (sizeof(dummy_key) - dummy_key_avail)); - dummy_key_avail += res; + (unsigned) (sizeof(stub_key) - stub_key_avail)); + stub_key_avail += res; - if (dummy_key_avail == sizeof(dummy_key)) { + if (stub_key_avail == sizeof(stub_key)) { if (own_pool_ready < MIN_READY_MARK) own_pool_ready = MIN_READY_MARK; random_write_entropy(); @@ -287,7 +287,7 @@ int random_pool_ready(void) wpa_printf(MSG_INFO, "random: Only %u/%u bytes of strong " "random data available", - (unsigned) dummy_key_avail, (unsigned) sizeof(dummy_key)); + (unsigned) stub_key_avail, (unsigned) sizeof(stub_key)); if (own_pool_ready >= MIN_READY_MARK || total_collected + 10 * own_pool_ready > MIN_COLLECT_ENTROPY) { @@ -331,13 +331,13 @@ static void random_read_fd(int sock, void *eloop_ctx, void *sock_ctx) { ssize_t res; - if (dummy_key_avail == sizeof(dummy_key)) { + if (stub_key_avail == sizeof(stub_key)) { random_close_fd(); return; } - res = read(sock, dummy_key + dummy_key_avail, - sizeof(dummy_key) - dummy_key_avail); + res = read(sock, stub_key + stub_key_avail, + sizeof(stub_key) - stub_key_avail); if (res < 0) { wpa_printf(MSG_ERROR, "random: Cannot read from /dev/random: " "%s", strerror(errno)); @@ -346,10 +346,10 @@ static void random_read_fd(int sock, void *eloop_ctx, void *sock_ctx) wpa_printf(MSG_DEBUG, "random: Got %u/%u bytes from /dev/random", (unsigned) res, - (unsigned) (sizeof(dummy_key) - dummy_key_avail)); - dummy_key_avail += res; + (unsigned) (sizeof(stub_key) - stub_key_avail)); + stub_key_avail += res; - if (dummy_key_avail == sizeof(dummy_key)) { + if (stub_key_avail == sizeof(stub_key)) { random_close_fd(); if (own_pool_ready < MIN_READY_MARK) own_pool_ready = MIN_READY_MARK; @@ -440,9 +440,9 @@ void random_init(const char *entropy_file) #ifdef CONFIG_GETRANDOM { - u8 dummy; + u8 stub; - if (getrandom(&dummy, 0, GRND_NONBLOCK) == 0 || + if (getrandom(&stub, 0, GRND_NONBLOCK) == 0 || errno != ENOSYS) { wpa_printf(MSG_DEBUG, "random: getrandom() support available"); diff --git a/src/drivers/driver_ndis.c b/src/drivers/driver_ndis.c index b5fff483e..b32e00967 100644 --- a/src/drivers/driver_ndis.c +++ b/src/drivers/driver_ndis.c @@ -1111,20 +1111,20 @@ wpa_driver_ndis_associate(void *priv, auth_mode = Ndis802_11AuthModeOpen; priv_mode = Ndis802_11PrivFilterAcceptAll; if (params->wps == WPS_MODE_PRIVACY) { - u8 dummy_key[5] = { 0x11, 0x22, 0x33, 0x44, 0x55 }; + u8 stub_key[5] = { 0x11, 0x22, 0x33, 0x44, 0x55 }; /* * Some NDIS drivers refuse to associate in open mode * configuration due to Privacy field mismatch, so use * a workaround to make the configuration look like * matching one for WPS provisioning. */ - wpa_printf(MSG_DEBUG, "NDIS: Set dummy WEP key as a " + wpa_printf(MSG_DEBUG, "NDIS: Set stub WEP key as a " "workaround to allow driver to associate " "for WPS"); wpa_driver_ndis_set_key(drv->ifname, drv, WPA_ALG_WEP, bcast, 0, 1, - NULL, 0, dummy_key, - sizeof(dummy_key)); + NULL, 0, stub_key, + sizeof(stub_key)); } #endif /* CONFIG_WPS */ } else { @@ -2233,10 +2233,10 @@ static int wpa_driver_ndis_get_names(struct wpa_driver_ndis_data *drv) /* * Windows 98 with Packet.dll 3.0 alpha3 does not include adapter - * descriptions. Fill in dummy descriptors to work around this. + * descriptions. Fill in stub descriptors to work around this. */ while (num_desc < num_name) - desc[num_desc++] = "dummy description"; + desc[num_desc++] = "stub description"; if (num_name != num_desc) { wpa_printf(MSG_DEBUG, "NDIS: mismatch in adapter name and " @@ -3164,10 +3164,10 @@ wpa_driver_ndis_get_interfaces(void *global_priv) /* * Windows 98 with Packet.dll 3.0 alpha3 does not include adapter - * descriptions. Fill in dummy descriptors to work around this. + * descriptions. Fill in stub descriptors to work around this. */ while (num_desc < num_name) - desc[num_desc++] = "dummy description"; + desc[num_desc++] = "stub description"; if (num_name != num_desc) { wpa_printf(MSG_DEBUG, "NDIS: mismatch in adapter name and " diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 8eb033c78..14118a7d5 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5144,7 +5144,7 @@ static int wpa_driver_nl80211_sta_add(void *priv, /* * cfg80211 validates that AID is non-zero, so we have * to make this a non-zero value for the TDLS case where - * a dummy STA entry is used for now and for a station + * a stub STA entry is used for now and for a station * that is still not associated. */ wpa_printf(MSG_DEBUG, " * aid=1 (%s workaround)", diff --git a/src/eap_peer/eap_proxy_dummy.c b/src/eap_peer/eap_proxy_dummy.c index 2cc05c92c..181e8cc74 100644 --- a/src/eap_peer/eap_proxy_dummy.c +++ b/src/eap_peer/eap_proxy_dummy.c @@ -1,5 +1,5 @@ /* - * EAP proxy - dummy implementation for build testing + * EAP proxy - stub implementation for build testing * Copyright (c) 2013 Qualcomm Atheros, Inc. * * This software may be distributed under the terms of the BSD license. diff --git a/src/eap_peer/eap_teap.c b/src/eap_peer/eap_teap.c index e8cc7844c..739595b63 100644 --- a/src/eap_peer/eap_teap.c +++ b/src/eap_peer/eap_teap.c @@ -1760,7 +1760,7 @@ static int eap_teap_process_start(struct eap_sm *sm, #ifdef CONFIG_TESTING_OPTIONS -static struct wpabuf * eap_teap_add_dummy_outer_tlvs(struct eap_teap_data *data, +static struct wpabuf * eap_teap_add_stub_outer_tlvs(struct eap_teap_data *data, struct wpabuf *resp) { struct wpabuf *resp2; @@ -1775,11 +1775,11 @@ static struct wpabuf * eap_teap_add_dummy_outer_tlvs(struct eap_teap_data *data, return NULL; } - /* Outer TLVs (dummy Vendor-Specific TLV for testing) */ + /* Outer TLVs (stub Vendor-Specific TLV for testing) */ wpabuf_put_be16(data->peer_outer_tlvs, TEAP_TLV_VENDOR_SPECIFIC); wpabuf_put_be16(data->peer_outer_tlvs, 4); wpabuf_put_be32(data->peer_outer_tlvs, EAP_VENDOR_HOSTAP); - wpa_hexdump_buf(MSG_DEBUG, "EAP-TEAP: TESTING - Add dummy Outer TLVs", + wpa_hexdump_buf(MSG_DEBUG, "EAP-TEAP: TESTING - Add stub Outer TLVs", data->peer_outer_tlvs); wpa_hexdump_buf(MSG_DEBUG, @@ -1986,7 +1986,7 @@ static struct wpabuf * eap_teap_process(struct eap_sm *sm, void *priv, #ifdef CONFIG_TESTING_OPTIONS if (data->test_outer_tlvs && res == 0 && resp && (flags & EAP_TLS_FLAGS_START) && wpabuf_len(resp) >= 6) - resp = eap_teap_add_dummy_outer_tlvs(data, resp); + resp = eap_teap_add_stub_outer_tlvs(data, resp); #endif /* CONFIG_TESTING_OPTIONS */ return resp; diff --git a/src/eap_peer/eap_tls_common.h b/src/eap_peer/eap_tls_common.h index 183b7de00..9ac00121f 100644 --- a/src/eap_peer/eap_tls_common.h +++ b/src/eap_peer/eap_tls_common.h @@ -92,7 +92,7 @@ struct eap_ssl_data { /* could be up to 128 bytes, but only the first 64 bytes are used */ #define EAP_TLS_KEY_LEN 64 -/* dummy type used as a flag for UNAUTH-TLS */ +/* stub type used as a flag for UNAUTH-TLS */ #define EAP_UNAUTH_TLS_TYPE 255 #define EAP_WFA_UNAUTH_TLS_TYPE 254 diff --git a/src/l2_packet/l2_packet_none.c b/src/l2_packet/l2_packet_none.c index bc7a4e82d..6783d7391 100644 --- a/src/l2_packet/l2_packet_none.c +++ b/src/l2_packet/l2_packet_none.c @@ -1,5 +1,5 @@ /* - * WPA Supplicant - Layer2 packet handling example with dummy functions + * WPA Supplicant - Layer2 packet handling example with stub functions * Copyright (c) 2003-2005, Jouni Malinen * * This software may be distributed under the terms of the BSD license. diff --git a/wlantest/inject.c b/wlantest/inject.c index 399f1a3c0..0950a1e9c 100644 --- a/wlantest/inject.c +++ b/wlantest/inject.c @@ -83,17 +83,17 @@ static int wlantest_inject_bip(struct wlantest *wt, struct wlantest_bss *bss, u8 *frame, size_t len, int incorrect_key) { u8 *prot; - u8 dummy[32]; + u8 stub [32]; int ret; size_t plen; if (!bss->igtk_len[bss->igtk_idx]) return -1; - os_memset(dummy, 0x11, sizeof(dummy)); + os_memset(stub, 0x11, sizeof(stub)); inc_byte_array(bss->ipn[bss->igtk_idx], 6); - prot = bip_protect(incorrect_key ? dummy : bss->igtk[bss->igtk_idx], + prot = bip_protect(incorrect_key ? stub : bss->igtk[bss->igtk_idx], bss->igtk_len[bss->igtk_idx], frame, len, bss->ipn[bss->igtk_idx], bss->igtk_idx, &plen); @@ -115,7 +115,7 @@ static int wlantest_inject_prot_bc(struct wlantest *wt, u8 *crypt; size_t crypt_len; int ret; - u8 dummy[64]; + u8 stub[64]; u8 *pn; struct ieee80211_hdr *hdr; u16 fc; @@ -134,14 +134,14 @@ static int wlantest_inject_prot_bc(struct wlantest *wt, pn = bss->rsc[bss->gtk_idx]; inc_byte_array(pn, 6); - os_memset(dummy, 0x11, sizeof(dummy)); + os_memset(stub, 0x11, sizeof(stub)); if (bss->group_cipher == WPA_CIPHER_TKIP) - crypt = tkip_encrypt(incorrect_key ? dummy : + crypt = tkip_encrypt(incorrect_key ? stub : bss->gtk[bss->gtk_idx], frame, len, hdrlen, NULL, pn, bss->gtk_idx, &crypt_len); else - crypt = ccmp_encrypt(incorrect_key ? dummy : + crypt = ccmp_encrypt(incorrect_key ? stub : bss->gtk[bss->gtk_idx], frame, len, hdrlen, NULL, pn, bss->gtk_idx, &crypt_len); @@ -163,7 +163,7 @@ static int wlantest_inject_prot(struct wlantest *wt, struct wlantest_bss *bss, u8 *crypt; size_t crypt_len; int ret; - u8 dummy[64]; + u8 stub[64]; u8 *pn; struct ieee80211_hdr *hdr; u16 fc; @@ -243,17 +243,17 @@ static int wlantest_inject_prot(struct wlantest *wt, struct wlantest_bss *bss, pn = sta->rsc_tods[tid]; inc_byte_array(pn, 6); - os_memset(dummy, 0x11, sizeof(dummy)); + os_memset(stub, 0x11, sizeof(stub)); if (tk) - crypt = ccmp_encrypt(incorrect_key ? dummy : tk, + crypt = ccmp_encrypt(incorrect_key ? stub : tk, frame, len, hdrlen, qos, pn, 0, &crypt_len); else if (sta->pairwise_cipher == WPA_CIPHER_TKIP) - crypt = tkip_encrypt(incorrect_key ? dummy : sta->ptk.tk, + crypt = tkip_encrypt(incorrect_key ? stub : sta->ptk.tk, frame, len, hdrlen, qos, pn, 0, &crypt_len); else - crypt = ccmp_encrypt(incorrect_key ? dummy : sta->ptk.tk, + crypt = ccmp_encrypt(incorrect_key ? stub : sta->ptk.tk, frame, len, hdrlen, qos, pn, 0, &crypt_len); diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c index d5e10debf..e754f5ff9 100644 --- a/wlantest/rx_eapol.c +++ b/wlantest/rx_eapol.c @@ -703,7 +703,7 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst, decrypted, decrypted_len); } if ((wt->write_pcap_dumper || wt->pcapng) && decrypted != key_data) { - /* Fill in a dummy Data frame header */ + /* Fill in a stub Data frame header */ u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64]; struct ieee80211_hdr *h; struct wpa_eapol_key *k; @@ -926,7 +926,7 @@ static void rx_data_eapol_key_1_of_2(struct wlantest *wt, const u8 *dst, wpa_hexdump(MSG_DEBUG, "Decrypted EAPOL-Key Key Data", decrypted, decrypted_len); if (wt->write_pcap_dumper || wt->pcapng) { - /* Fill in a dummy Data frame header */ + /* Fill in a stub Data frame header */ u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64]; struct ieee80211_hdr *h; struct wpa_eapol_key *k;