diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2010-06-13 20:32:04 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2010-06-13 20:32:04 +0000 |
commit | 60c44471bf25f9e84d8701afe1bbcbcc88e18c89 (patch) | |
tree | 538db23d436787038f980271529ae2be44235c1b /src/eap_server/eap_ttls.c | |
parent | ced3a3de988600636bda6479d27de8823307f171 (diff) | |
download | FreeBSD-src-60c44471bf25f9e84d8701afe1bbcbcc88e18c89.zip FreeBSD-src-60c44471bf25f9e84d8701afe1bbcbcc88e18c89.tar.gz |
Import wpa_supplicant & hostapd 0.6.9.
Diffstat (limited to 'src/eap_server/eap_ttls.c')
-rw-r--r-- | src/eap_server/eap_ttls.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/eap_server/eap_ttls.c b/src/eap_server/eap_ttls.c index b097ab2..21e4b21 100644 --- a/src/eap_server/eap_ttls.c +++ b/src/eap_server/eap_ttls.c @@ -954,7 +954,7 @@ static int eap_ttls_phase2_eap_init(struct eap_sm *sm, sm->init_phase2 = 1; data->phase2_priv = data->phase2_method->init(sm); sm->init_phase2 = 0; - return 0; + return data->phase2_priv == NULL ? -1 : 0; } @@ -1045,6 +1045,11 @@ static void eap_ttls_process_phase2_eap_response(struct eap_sm *sm, next_type = sm->user->methods[0].method; sm->user_eap_method_index = 1; wpa_printf(MSG_DEBUG, "EAP-TTLS: try EAP type %d", next_type); + if (eap_ttls_phase2_eap_init(sm, data, next_type)) { + wpa_printf(MSG_DEBUG, "EAP-TTLS: Failed to initialize " + "EAP type %d", next_type); + eap_ttls_state(data, FAILURE); + } break; case PHASE2_METHOD: if (data->ttls_version > 0) { @@ -1066,12 +1071,6 @@ static void eap_ttls_process_phase2_eap_response(struct eap_sm *sm, __func__, data->state); break; } - - if (eap_ttls_phase2_eap_init(sm, data, next_type)) { - wpa_printf(MSG_DEBUG, "EAP-TTLS: Failed to initialize EAP " - "type %d", next_type); - eap_ttls_state(data, FAILURE); - } } |