From 503e22025ba77afe00ad4e17a34f1f95160d2075 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 22 Aug 2024 11:20:20 +0300 Subject: [PATCH] DPP: Do not restrict SAE password length on Configurator The restriction of the passphrase length to 8..63 characters is only applicable for WPA2-Personal (PSK). Remove this constraint when provisioning a configuration object that includes SAE without PSK. Signed-off-by: Jouni Malinen --- src/common/dpp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/dpp.c b/src/common/dpp.c index 3b9f35e8d..d2a027378 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -1139,6 +1139,12 @@ int dpp_configuration_valid(const struct dpp_configuration *conf) return 0; if (dpp_akm_psk(conf->akm) && !conf->passphrase && !conf->psk_set) return 0; + if (dpp_akm_psk(conf->akm) && conf->passphrase) { + size_t len = os_strlen(conf->passphrase); + + if (len > 63 || len < 8) + return 0; + } if (dpp_akm_sae(conf->akm) && !conf->passphrase) return 0; return 1; @@ -1228,8 +1234,6 @@ static int dpp_configuration_parse_helper(struct dpp_authentication *auth, end = os_strchr(pos, ' '); pass_len = end ? (size_t) (end - pos) : os_strlen(pos); pass_len /= 2; - if (pass_len > 63 || pass_len < 8) - goto fail; conf->passphrase = os_zalloc(pass_len + 1); if (!conf->passphrase || hexstr2bin(pos, (u8 *) conf->passphrase, pass_len) < 0)