aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-04-25 16:45:27 (GMT)
committerJouni Malinen <j@w1.fi>2019-04-25 20:49:49 (GMT)
commit2b84ca4dd96459b661b0ebaf40ec43074fc9f42c (patch)
tree35a6a9dc161f8780f6523e1ff1b39d94caca89cd /src/eap_common
parentff229da3095917fe1d152ca256c83366b0f3ee1d (diff)
downloadhostap-2b84ca4dd96459b661b0ebaf40ec43074fc9f42c.zip
hostap-2b84ca4dd96459b661b0ebaf40ec43074fc9f42c.tar.gz
hostap-2b84ca4dd96459b661b0ebaf40ec43074fc9f42c.tar.bz2
Share common SAE and EAP-pwd functionality: suitable groups
Start sharing common SAE and EAP-pwd functionality by adding a new source code file that can be included into both. This first step is bringing in a shared function to check whether a group is suitable. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_pwd_common.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/eap_common/eap_pwd_common.c b/src/eap_common/eap_pwd_common.c
index 2efcfc7..abee3da 100644
--- a/src/eap_common/eap_pwd_common.c
+++ b/src/eap_common/eap_pwd_common.c
@@ -9,6 +9,7 @@
#include "includes.h"
#include "common.h"
#include "utils/const_time.h"
+#include "common/dragonfly.h"
#include "crypto/sha256.h"
#include "crypto/crypto.h"
#include "eap_defs.h"
@@ -85,20 +86,11 @@ 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)) {
+ if (!dragonfly_suitable_group(num, 1)) {
wpa_printf(MSG_INFO, "EAP-pwd: unsuitable group %u", num);
return NULL;
}