openwrt/package/network/services/hostapd/patches/150-add-NULL-checks-encountered-during-tests-hwsim.patch
Ivan Pavlov da11a1e20c hostapd: update to version 2024-09-15
Remove upstreamed from 2.11 release:
  060-nl80211-fix-crash-when-adding-an-interface-fails.patch

Rebase all other patches

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16338
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-16 10:32:43 +02:00

46 lines
1.4 KiB
Diff

From 33afce36c54b0cad38643629ded10ff5d727f077 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Fri, 12 Aug 2022 05:34:47 -0400
Subject: [PATCH 5/7] add NULL checks (encountered during tests/hwsim)
sae_derive_commit_element_ecc NULL pwe_ecc check
dpp_gen_keypair() NULL curve check
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
src/common/dpp_crypto.c | 6 ++++++
src/common/sae.c | 7 +++++++
2 files changed, 13 insertions(+)
--- a/src/common/dpp_crypto.c
+++ b/src/common/dpp_crypto.c
@@ -269,6 +269,12 @@ int dpp_get_pubkey_hash(struct crypto_ec
struct crypto_ec_key * dpp_gen_keypair(const struct dpp_curve_params *curve)
{
+ if (curve == NULL) {
+ wpa_printf(MSG_DEBUG,
+ "DPP: %s curve must be initialized", __func__);
+ return NULL;
+ }
+
struct crypto_ec_key *key;
wpa_printf(MSG_DEBUG, "DPP: Generating a keypair");
--- a/src/common/sae.c
+++ b/src/common/sae.c
@@ -1279,6 +1279,13 @@ void sae_deinit_pt(struct sae_pt *pt)
static int sae_derive_commit_element_ecc(struct sae_data *sae,
struct crypto_bignum *mask)
{
+ if (sae->tmp->pwe_ecc == NULL) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: %s sae->tmp->pwe_ecc must be initialized",
+ __func__);
+ return -1;
+ }
+
/* COMMIT-ELEMENT = inverse(scalar-op(mask, PWE)) */
if (!sae->tmp->own_commit_element_ecc) {
sae->tmp->own_commit_element_ecc =