]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-pwd: Disallow ECC groups with a prime under 256 bits
authorJouni Malinen <j@w1.fi>
Sat, 13 Apr 2019 14:20:57 +0000 (17:20 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 13 Apr 2019 15:28:05 +0000 (18:28 +0300)
Based on the SAE implementation guidance update to not allow ECC groups
with a prime that is under 256 bits, reject groups 25, 26, and 27 in
EAP-pwd.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_common/eap_pwd_common.c

index 4288b52998a96abdcc76eba37f8fd35e02aec60e..00f85a390181a23d13d88a52df15da64cf9e033a 100644 (file)
@@ -85,10 +85,23 @@ static int eap_pwd_kdf(const u8 *key, size_t keylen, const u8 *label,
 }
 
 
+static int eap_pwd_suitable_group(u16 num)
+{
+       /* Do not allow ECC groups with prime under 256 bits based on guidance
+        * for the similar design in SAE. */
+       return num == 19 || num == 20 || num == 21 ||
+               num == 28 || num == 29 || num == 30;
+}
+
+
 EAP_PWD_group * get_eap_pwd_group(u16 num)
 {
        EAP_PWD_group *grp;
 
+       if (!eap_pwd_suitable_group(num)) {
+               wpa_printf(MSG_INFO, "EAP-pwd: unsuitable group %u", num);
+               return NULL;
+       }
        grp = os_zalloc(sizeof(EAP_PWD_group));
        if (!grp)
                return NULL;