Use PMK_LEN macro instead of hardcoded value 64 (= 2 * 32)

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-02-15 17:11:18 +02:00
parent f5da5810c9
commit 838180877f

View file

@ -377,7 +377,8 @@ static int hostapd_config_read_wpa_psk(const char *fname,
ok = 0; ok = 0;
len = os_strlen(pos); 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; ok = 1;
else if (len >= 8 && len < 64 && else if (len >= 8 && len < 64 &&
pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len, pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len,