SAE: Debug print group support in the crypto library
This makes it easier to understand why "SAE: Failed to select group" debug entry shows up in cases the selected crypto library does not support a specific group. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
f5e0a3324b
commit
087474512f
1 changed files with 6 additions and 0 deletions
|
@ -29,6 +29,8 @@ int sae_set_group(struct sae_data *sae, int group)
|
||||||
/* First, check if this is an ECC group */
|
/* First, check if this is an ECC group */
|
||||||
tmp->ec = crypto_ec_init(group);
|
tmp->ec = crypto_ec_init(group);
|
||||||
if (tmp->ec) {
|
if (tmp->ec) {
|
||||||
|
wpa_printf(MSG_DEBUG, "SAE: Selecting supported ECC group %d",
|
||||||
|
group);
|
||||||
sae->group = group;
|
sae->group = group;
|
||||||
tmp->prime_len = crypto_ec_prime_len(tmp->ec);
|
tmp->prime_len = crypto_ec_prime_len(tmp->ec);
|
||||||
tmp->prime = crypto_ec_get_prime(tmp->ec);
|
tmp->prime = crypto_ec_get_prime(tmp->ec);
|
||||||
|
@ -39,6 +41,8 @@ int sae_set_group(struct sae_data *sae, int group)
|
||||||
/* Not an ECC group, check FFC */
|
/* Not an ECC group, check FFC */
|
||||||
tmp->dh = dh_groups_get(group);
|
tmp->dh = dh_groups_get(group);
|
||||||
if (tmp->dh) {
|
if (tmp->dh) {
|
||||||
|
wpa_printf(MSG_DEBUG, "SAE: Selecting supported FFC group %d",
|
||||||
|
group);
|
||||||
sae->group = group;
|
sae->group = group;
|
||||||
tmp->prime_len = tmp->dh->prime_len;
|
tmp->prime_len = tmp->dh->prime_len;
|
||||||
if (tmp->prime_len > SAE_MAX_PRIME_LEN) {
|
if (tmp->prime_len > SAE_MAX_PRIME_LEN) {
|
||||||
|
@ -66,6 +70,8 @@ int sae_set_group(struct sae_data *sae, int group)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unsupported group */
|
/* Unsupported group */
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"SAE: Group %d not supported by the crypto library", group);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue