From 0fc58c07890780355dc92076cfcc260a21d7040a Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakob.olsson@iopsys.eu>
Date: Mon, 20 Mar 2023 16:32:59 +0100
Subject: [PATCH] dpp: config - sae imply dpp if easymesh > 2

---
 src/config.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/config.c b/src/config.c
index 59a8f36e..2ba37029 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1039,8 +1039,14 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		if (!strncmp(sec, "sae-mixed", 9)) {
 			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK);
 			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK_T);
-		} else if (!strncmp(sec, "sae", 3)) {
-			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK);
+		} else if (!strncmp(sec, "sae", 3)
+#if (EASYMESH_VERSION > 2)
+			   || !strncmp(sec, "dpp", 3) ||
+			   !strncmp(sec, "dpp+sae", 3) ||
+			   !strncmp(sec, "sae+dpp", 3)
+#endif
+			   ) {
+			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK); /* TODO: how do we properly transfer DPP encryption */
 		} else if (!strncmp(sec, "psk-mixed", 9)) {
 			cred->sec |= BIT(WIFI_SECURITY_WPAPSK);
 			cred->sec |= BIT(WIFI_SECURITY_WPA2PSK);
-- 
GitLab