From: Jouni Malinen Date: Sat, 15 Feb 2020 15:11:18 +0000 (+0200) Subject: Use PMK_LEN macro instead of hardcoded value 64 (= 2 * 32) X-Git-Tag: hostap_2_10~1836 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fhostap.git;a=commitdiff_plain;h=838180877f365e598539ffe251dc27a8e5f36097 Use PMK_LEN macro instead of hardcoded value 64 (= 2 * 32) Signed-off-by: Jouni Malinen --- diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index d35423eca..cd83f4ba8 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -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,