[PATCH] DPP: Accept plain-text SSID in configurator parameter parsing

Jason Huang Jason.Huang2 at infineon.com
Thu May 14 19:54:21 PDT 2026


From: "Shankar Amar (CSTIPL CSS ICW SW WFS 1)" <amar.shankar at infineon.com>

dpp_set_configurator() parses conf parameters through
dpp_configuration_parse_helper(). The ssid= value in this path is
currently treated as hex-only by dividing the length by two and calling
hexstr2bin().

This breaks flows where ssid is provided as plain text, for example via
DPP configurator commands in integration environments that pass string
SSID directly. In that case parsing fails and the command aborts with:

DPP: Failed to set configurator parameters

As a result, DPP_CONFIGURATOR_SIGN and DPP_AUTH_INIT can fail before
the authentication/provisioning exchange starts.

Fix this by parsing ssid= as plain bytes in this helper path:
- remove hex-only conversion for ssid
- keep the existing length bound check
- copy ssid bytes directly into conf->ssid

Signed-off-by: Shankar Amar <amar.shankar at infineon.com>
Signed-off-by: Jason Huang <jason.huang2 at infineon.com>
---
 src/common/dpp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/common/dpp.c b/src/common/dpp.c
index 7601b0d72..fd96ad74c 100644
--- a/src/common/dpp.c
+++ b/src/common/dpp.c
@@ -1214,10 +1214,11 @@ static int dpp_configuration_parse_helper(struct dpp_authentication *auth,
 		pos += 6;
 		end = os_strchr(pos, ' ');
 		conf->ssid_len = end ? (size_t) (end - pos) : os_strlen(pos);
-		conf->ssid_len /= 2;
-		if (conf->ssid_len > sizeof(conf->ssid) ||
-		    hexstr2bin(pos, conf->ssid, conf->ssid_len) < 0)
+		/* Remove check for ssid in hex as we are supplying
+		 * string format in dpp_auth_init */
+		if (conf->ssid_len > sizeof(conf->ssid))
 			goto fail;
+		os_memcpy(conf->ssid, pos, conf->ssid_len);
 	} else {
 #ifdef CONFIG_TESTING_OPTIONS
 		/* use a default SSID for legacy testing reasons */
-- 
2.25.1




More information about the Hostap mailing list