From 5d8c5f344e1c3be8a49d782b6d59e0b3a6742d97 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 25 Jun 2020 01:18:30 +0300 Subject: [PATCH] SAE-PK: Fix password validation check for Sec The 0..3 value decoded from the password was not incremented to the actual 2..5 range for Sec. This resulted in not properly detecting the minimum password length. Signed-off-by: Jouni Malinen --- src/common/sae_pk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/sae_pk.c b/src/common/sae_pk.c index b294312ef..b1c35d100 100644 --- a/src/common/sae_pk.c +++ b/src/common/sae_pk.c @@ -38,7 +38,7 @@ bool sae_pk_valid_password(const char *pw) idx = os_strchr(sae_pk_base32_table, pw[0]); if (!idx) return false; - sec = ((u8) ((idx - sae_pk_base32_table) & 0x1f)) >> 3; + sec = (((u8) ((idx - sae_pk_base32_table) & 0x1f)) >> 3) + 2; if ((sec == 2 && pw_len < 14) || (sec == 3 && pw_len < 13) || (sec == 4 && pw_len < 11) ||