]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use PMK_LEN macro instead of hardcoded value 64 (= 2 * 32)
authorJouni Malinen <j@w1.fi>
Sat, 15 Feb 2020 15:11:18 +0000 (17:11 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Feb 2020 15:11:18 +0000 (17:11 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ap_config.c

index d35423ecafd7162cdbdce5e71575e41dc530dcc5..cd83f4ba820421cb4b610fd33fa4b8709ab8e36a 100644 (file)
@@ -377,7 +377,8 @@ static int hostapd_config_read_wpa_psk(const char *fname,
 
                ok = 0;
                len = os_strlen(pos);
-               if (len == 64 && hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
+               if (len == 2 * PMK_LEN &&
+                   hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
                        ok = 1;
                else if (len >= 8 && len < 64 &&
                         pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len,