From 3abd0c4719ac6575b190a72f5b768bedb8989ced Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 10 Nov 2022 20:43:22 +0200 Subject: [PATCH] SAE: Print rejection of peer element clearly in debug log Depending on the crypto library, crypto_ec_point_from_bin() can fail if the element is not on curve, i.e., that error may show up before getting to the explicit crypto_ec_point_is_on_curve() check. Add a debug print for that earlier call so that the debug log is clearly identifying reason for rejecting the SAE commit message. Signed-off-by: Jouni Malinen --- src/common/sae.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/sae.c b/src/common/sae.c index 1e9ea8efa..e597bfc1a 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -1967,8 +1967,10 @@ static u16 sae_parse_commit_element_ecc(struct sae_data *sae, const u8 **pos, crypto_ec_point_deinit(sae->tmp->peer_commit_element_ecc, 0); sae->tmp->peer_commit_element_ecc = crypto_ec_point_from_bin(sae->tmp->ec, *pos); - if (sae->tmp->peer_commit_element_ecc == NULL) + if (!sae->tmp->peer_commit_element_ecc) { + wpa_printf(MSG_DEBUG, "SAE: Peer element is not a valid point"); return WLAN_STATUS_UNSPECIFIED_FAILURE; + } if (!crypto_ec_point_is_on_curve(sae->tmp->ec, sae->tmp->peer_commit_element_ecc)) { -- 2.47.2