aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2017-06-08 08:17:59 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-08 13:19:36 (GMT)
commit83e003a9132a33921e8e284f07aeab1d72153131 (patch)
tree5eb8a997a8ca65384a78fd8771e118a0e9ca53de /src
parent422570eec805331de05156244b6301d5d8b6a998 (diff)
downloadhostap-83e003a9132a33921e8e284f07aeab1d72153131.zip
hostap-83e003a9132a33921e8e284f07aeab1d72153131.tar.gz
hostap-83e003a9132a33921e8e284f07aeab1d72153131.tar.bz2
EAP-TTLS: Fix possible memory leak in eap_ttls_phase2_request_mschap()
The msg buffer needs to be freed on these two error paths. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/eap_peer/eap_ttls.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/eap_peer/eap_ttls.c b/src/eap_peer/eap_ttls.c
index 01112b5..c8a05fd 100644
--- a/src/eap_peer/eap_ttls.c
+++ b/src/eap_peer/eap_ttls.c
@@ -625,15 +625,25 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm,
pos += 24;
if (pwhash) {
/* NT-Response */
- if (challenge_response(challenge, password, pos))
+ if (challenge_response(challenge, password, pos)) {
+ wpa_printf(MSG_ERROR,
+ "EAP-TTLS/MSCHAP: Failed derive password hash");
+ wpabuf_free(msg);
return -1;
+ }
+
wpa_hexdump_key(MSG_DEBUG, "EAP-TTLS: MSCHAP password hash",
password, 16);
} else {
/* NT-Response */
if (nt_challenge_response(challenge, password, password_len,
- pos))
+ pos)) {
+ wpa_printf(MSG_ERROR,
+ "EAP-TTLS/MSCHAP: Failed derive password");
+ wpabuf_free(msg);
return -1;
+ }
+
wpa_hexdump_ascii_key(MSG_DEBUG, "EAP-TTLS: MSCHAP password",
password, password_len);
}