Skip to contentSkip to conversation

hostapd/wpa_s: fixes after version update

PATCH In review Sergey Matyukevich 3 participants 7 messages Feb 13, 2022 – Feb 14, 2022

lore
Share & tools
lore
#0 lore raw

cover hostapd/wpa_s: fixes after version update

Hi all,

This patch series provides two fixes for hostapd/wpa_s build issues.

The first patch fixes hostapd build regression caused by its version update. New hostapd version requires updated handling of CONFIG_DPP option. I guess I failed to catch this problem because all my random hostapd test configs enabled openssl. So I overlooked basic minimal configuration that did not require openssl.

The second patch fixes specific configuration of wpa_supplicant reported by Yegor Yefremov. For now a patch is added. Yegor already posted patch to hostapd mailing list. So some time in the future this problem will be fixed upstream.

Regards,
Sergey

Sergey Matyukevich (2):
package/hostapd: update DPP option handling package/wpa_supplicant: fix build for mesh configuration

 package/hostapd/hostapd.mk                    |  3 +-
 .../0001-mesh-enable-HMAC_SHA384_KDF.patch    | 30 +++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch
Signature · 6 lines
2.35.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/2 package/hostapd: update DPP option handling

Makefile hostapd.mk defines different macros for different defconfig options. Options that are not listed in defconfig, can be set using HOSTAPD_CONFIG_SET. Options that are listed in defconfig, can be enabled/disabled using HOSTAPD_CONFIG_ENABLE/HOSTAPD_CONFIG_DISABLE.

Starting from hostapd v2.10, option CONFIG_DPP is explicitly listed in defconfig. So it is time to switch to enable/disable macros for this option.

Fixes:
- http://autobuild.buildroot.net/results/3f8058ee6f3913fda795578f206db895731ba1e6/

---
 package/hostapd/hostapd.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/hostapd/hostapd.mk +2 -1
index 075cb2a8d0..2ea6e0312f 100644
@@ -84,12 +84,13 @@ endif
 
 ifeq ($(BR2_PACKAGE_HOSTAPD_WPA3),y)
 HOSTAPD_CONFIG_SET += \
-	CONFIG_DPP \
 	CONFIG_SAE
 HOSTAPD_CONFIG_ENABLE += \
+	CONFIG_DPP \
 	CONFIG_OWE
 else
 HOSTAPD_CONFIG_DISABLE += \
+	CONFIG_DPP \
 	CONFIG_OWE
 endif
 
Signature · 6 lines
2.35.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 1/2] package/hostapd: update DPP option handling

Quoted 8 lines · On Sun, 13 Feb 2022 18:52:07 +0300 Sergey Matyukevich <[email protected]>…

Makefile hostapd.mk defines different macros for different defconfig options. Options that are not listed in defconfig, can be set using HOSTAPD_CONFIG_SET. Options that are listed in defconfig, can be enabled/disabled using HOSTAPD_CONFIG_ENABLE/HOSTAPD_CONFIG_DISABLE.

Starting from hostapd v2.10, option CONFIG_DPP is explicitly listed in defconfig. So it is time to switch to enable/disable macros for this option.

This seems fragile. Why don't we have a single way of enabling an option, which doesn't depend on whether the option is listed in the hostapd defconfig or not?

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH 1/2] package/hostapd: update DPP option handling

Hello Thomas,

Quoted 5 lines
Quoted 5 lines

Makefile hostapd.mk defines different macros for different defconfig options. Options that are not listed in defconfig, can be set using HOSTAPD_CONFIG_SET. Options that are listed in defconfig, can be enabled/disabled using HOSTAPD_CONFIG_ENABLE/HOSTAPD_CONFIG_DISABLE.

Quoted 7 lines
Quoted 3 lines

Starting from hostapd v2.10, option CONFIG_DPP is explicitly listed in defconfig. So it is time to switch to enable/disable macros for this option.

This seems fragile. Why don't we have a single way of enabling an option, which doesn't depend on whether the option is listed in the hostapd defconfig or not?

What do you think about removal of HOSTAPD_CONFIG_SET and having something along the following lines for configuration step:

@@ -124,9 +124,11 @@ define HOSTAPD_CONFIGURE_CMDS

        cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
        sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \
                $(patsubst %,-e 's/^\(%\)/#\1/',$(HOSTAPD_CONFIG_DISABLE)) \
-               $(patsubst %,-e '1i%=y',$(HOSTAPD_CONFIG_SET)) \
                $(patsubst %,-e %,$(HOSTAPD_CONFIG_EDITS)) \
                $(HOSTAPD_CONFIG)

+ for opt in $(HOSTAPD_CONFIG_ENABLE) ; do \
+ sed -i -ze "/$${opt}=y/!s/$$/$${opt}=y\n/" $(HOSTAPD_CONFIG) ; \
+ done
endef

This way only HOSTAPD_CONFIG_ENABLED/HOSTAPD_CONFIG_DISABLED macros will remain. Options that are required, but not listed in defconfig, still will be appended. There is a chance that next hostapd releases will introduce some new options for existing functionality, that will require attention. But there will be no need for shuffling existing options between CONFIG_SET and CONFIG_ENABLED.

Regards,
Sergey
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

PATCH 2/2 package/wpa_supplicant: fix mesh configuration build

In reply to Sergey Matyukevich

Consider the following wpa_supplicant configuration:

BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y

This configuration fails to build with the following error:

/path/to/output/build/wpa_supplicant-2.10/build/wpa_supplicant/src/common/sae.o: in function `hkdf_expand':
sae.c:(.text+0x3c8): undefined reference to `hmac_sha384_kdf'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1894: wpa_supplicant] Error 1

Looking into wpa_supplicant Makefile:
- CONFIG_MESH for some reason needs SAE, so it enables CONFIG_SAE
- CONFIG_SAE enables only HMAC_SHA256_KDF

This is apparently not enough. At least HMAC_SHA384_KDF is required for successful build. This commit adds a minimal patch for wpa_supplicant that fixes specified build configuration.

---
 .../0001-mesh-enable-HMAC_SHA384_KDF.patch    | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch
package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +30 -0
new file mode 100644
index 0000000000..d765c1dbbc
@@ -0,0 +1,30 @@
+From 08986b7da7e580f5deb570aaa654df38fb23397a Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <[email protected]>
+Date: Sun, 13 Feb 2022 18:26:23 +0300
+Subject: [PATCH] mesh: enable HMAC_SHA384_KDF
+
+Mesh support CONFIG_MESH needs SAE, so it enables CONFIG_SAE.
+In its turn, CONFIG_SAE enables only HMAC_SHA256_KDF option.
+This is apparently not enough for successful build. At least
+HMAC_SHA384_KDF is required for successful build.
+
+Signed-off-by: Sergey Matyukevich <[email protected]>
+---
+ wpa_supplicant/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
+index cb66defac..c8e53a3c9 100644
+--- a/wpa_supplicant/Makefile
++++ b/wpa_supplicant/Makefile
+@@ -246,6 +246,7 @@ endif
+ ifdef CONFIG_MESH
+ NEED_80211_COMMON=y
+ NEED_AES_SIV=y
++NEED_HMAC_SHA384_KDF=y
+ CONFIG_SAE=y
+ CONFIG_AP=y
+ CFLAGS += -DCONFIG_MESH
+-- 
+2.35.0
+
Signature · 6 lines
2.35.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH 2/2] package/wpa_supplicant: fix mesh configuration build

Quoted 36 lines · Sergey Matyukevich

Consider the following wpa_supplicant configuration:

BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y

This configuration fails to build with the following error:

/path/to/output/build/wpa_supplicant-2.10/build/wpa_supplicant/src/common/sae.o: in function `hkdf_expand':
sae.c:(.text+0x3c8): undefined reference to `hmac_sha384_kdf'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1894: wpa_supplicant] Error 1

Looking into wpa_supplicant Makefile:
- CONFIG_MESH for some reason needs SAE, so it enables CONFIG_SAE
- CONFIG_SAE enables only HMAC_SHA256_KDF

This is apparently not enough. At least HMAC_SHA384_KDF is required for successful build. This commit adds a minimal patch for wpa_supplicant that fixes specified build configuration.

---
  .../0001-mesh-enable-HMAC_SHA384_KDF.patch    | 30 +++++++++++++++++++
  1 file changed, 30 insertions(+)

create mode 100644 package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch

package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +0 -0
new file mode 100644
index 0000000000..d765c1dbbc

package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch line 10

Quoted 10 lines
package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +10 -0
@@ -0,0 +1,30 @@
+From 08986b7da7e580f5deb570aaa654df38fb23397a Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <[email protected]>
+Date: Sun, 13 Feb 2022 18:26:23 +0300
+Subject: [PATCH] mesh: enable HMAC_SHA384_KDF
+
+Mesh support CONFIG_MESH needs SAE, so it enables CONFIG_SAE.
+In its turn, CONFIG_SAE enables only HMAC_SHA256_KDF option.
+This is apparently not enough for successful build. At least
+HMAC_SHA384_KDF is required for successful build.
+

You said that this patch was sent to hostapd. If that is true, please add a
patchwork link for it, like:

Upstream: https://patchwork.ozlabs.org/project/hostap/patch/[email protected]/

However, that patch looks a bit different, so you'll need to explain why.
Also, you dropped Yegor as an author, that's not very nice...

Regards,
Arnout

Quoted 10 lines
package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +10 -0
+Signed-off-by: Sergey Matyukevich <[email protected]>
+---
+ wpa_supplicant/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
+index cb66defac..c8e53a3c9 100644
+--- a/wpa_supplicant/Makefile
++++ b/wpa_supplicant/Makefile
+@@ -246,6 +246,7 @@ endif

package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch line 30

Quoted 10 lines
package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +10 -0
+ ifdef CONFIG_MESH
+ NEED_80211_COMMON=y
+ NEED_AES_SIV=y
++NEED_HMAC_SHA384_KDF=y
+ CONFIG_SAE=y
+ CONFIG_AP=y
+ CFLAGS += -DCONFIG_MESH
+--
+2.35.0
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Re: [Buildroot] [PATCH 2/2] package/wpa_supplicant: fix mesh configuration build

Hi Arnout,

Quoted 50 lines
Quoted 36 lines

Consider the following wpa_supplicant configuration:

BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y

This configuration fails to build with the following error:

/path/to/output/build/wpa_supplicant-2.10/build/wpa_supplicant/src/common/sae.o: in function `hkdf_expand':
sae.c:(.text+0x3c8): undefined reference to `hmac_sha384_kdf'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1894: wpa_supplicant] Error 1

Looking into wpa_supplicant Makefile:
- CONFIG_MESH for some reason needs SAE, so it enables CONFIG_SAE
- CONFIG_SAE enables only HMAC_SHA256_KDF

This is apparently not enough. At least HMAC_SHA384_KDF is required for successful build. This commit adds a minimal patch for wpa_supplicant that fixes specified build configuration.

---
  .../0001-mesh-enable-HMAC_SHA384_KDF.patch    | 30 +++++++++++++++++++
  1 file changed, 30 insertions(+)

create mode 100644 package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch

package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +0 -0
new file mode 100644
index 0000000000..d765c1dbbc

package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch line 10

Quoted 10 lines
package/wpa_supplicant/0001-mesh-enable-HMAC_SHA384_KDF.patch new file +10 -0
@@ -0,0 +1,30 @@
+From 08986b7da7e580f5deb570aaa654df38fb23397a Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <[email protected]>
+Date: Sun, 13 Feb 2022 18:26:23 +0300
+Subject: [PATCH] mesh: enable HMAC_SHA384_KDF
+
+Mesh support CONFIG_MESH needs SAE, so it enables CONFIG_SAE.
+In its turn, CONFIG_SAE enables only HMAC_SHA256_KDF option.
+This is apparently not enough for successful build. At least
+HMAC_SHA384_KDF is required for successful build.
+

You said that this patch was sent to hostapd. If that is true, please add a
patchwork link for it, like:

Quoted 4 lines

Upstream: https://patchwork.ozlabs.org/project/hostap/patch/[email protected]/

However, that patch looks a bit different, so you'll need to explain why.

Suggested solution seems the be slightly simpler.

Quoted 1 line

Also, you dropped Yegor as an author, that's not very nice...

I didn't. I sent my version of the fix. Communication on hostapd mailing list usually takes a while. As soon as upstream patch is accepted, we will replace this one with the upstream one keeping appropriate authorship. If you still have some concerns, feel free to drop my second patch. We will ask Yegor to send his version.

Original discussion:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Regards,
Sergey
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot