aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-11-01 19:35:44 +0200
committerMichael Bestas <mikeioannina@gmail.com>2015-11-11 19:40:00 +0200
commit77ebbf58dee1b16f4429321dc2ddef557dc21803 (patch)
treef53df401a094bd193b26270fb04bf65936d5bb68
parent4060a8f592372e56f988c12819cffb1c46cee12c (diff)
downloadandroid_external_wpa_supplicant_8-77ebbf58dee1b16f4429321dc2ddef557dc21803.tar.gz
android_external_wpa_supplicant_8-77ebbf58dee1b16f4429321dc2ddef557dc21803.tar.bz2
android_external_wpa_supplicant_8-77ebbf58dee1b16f4429321dc2ddef557dc21803.zip
EAP-pwd peer: Fix error path for unexpected Confirm message
If the Confirm message is received from the server before the Identity exchange has been completed, the group has not yet been determined and data->grp is NULL. The error path in eap_pwd_perform_confirm_exchange() did not take this corner case into account and could end up dereferencing a NULL pointer and terminating the process if invalid message sequence is received. (CVE-2015-5316) Change-Id: Ifaa7c76bd0b27fc61f1e3e5b33eb14d281289dcb Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--src/eap_peer/eap_pwd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
index 56f1eba2..d67703bb 100644
--- a/src/eap_peer/eap_pwd.c
+++ b/src/eap_peer/eap_pwd.c
@@ -679,7 +679,8 @@ eap_pwd_perform_confirm_exchange(struct eap_sm *sm, struct eap_pwd_data *data,
wpabuf_put_data(data->outbuf, conf, SHA256_MAC_LEN);
fin:
- os_free(cruft);
+ if (data->grp)
+ os_free(cruft);
BN_free(x);
BN_free(y);
ret->methodState = METHOD_DONE;