]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Do not restrict SAE password length on Configurator
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 22 Aug 2024 08:20:20 +0000 (11:20 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 22 Aug 2024 08:20:20 +0000 (11:20 +0300)
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 <quic_jouni@quicinc.com>
src/common/dpp.c

index 3b9f35e8dfeb3b0e46b7cf735257090ff1e17583..d2a027378da93a4113befe68ff4e646313f7e6fe 100644 (file)
@@ -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)