3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-18 01:59:31 +01:00

eap-tls-common: Add phase 2 failure flag

This flag is used by the extensions to signal the failure
during phase 2 execution.
This commit is contained in:
Tim Kourt 2018-11-29 14:41:38 -08:00 committed by Denis Kenzior
parent c1f791afc4
commit 9df7785fee
2 changed files with 18 additions and 1 deletions

View File

@ -95,6 +95,7 @@ struct eap_tls_state {
struct l_tls *tunnel;
bool method_completed:1;
bool phase2_failed:1;
struct databuf *plain_buf;
struct databuf *tx_pdu_buf;
@ -117,6 +118,7 @@ static void __eap_tls_common_state_reset(struct eap_tls_state *eap_tls)
{
eap_tls->version_negotiated = EAP_TLS_VERSION_NOT_NEGOTIATED;
eap_tls->method_completed = false;
eap_tls->phase2_failed = false;
eap_tls->expecting_frag_ack = false;
if (eap_tls->tunnel) {
@ -587,12 +589,19 @@ proceed:
eap_tls->rx_pdu_buf = NULL;
}
if (!eap_tls->tx_pdu_buf)
if (!eap_tls->tx_pdu_buf) {
if (eap_tls->phase2_failed)
goto error;
return;
}
eap_tls_send_response(eap, eap_tls->tx_pdu_buf->data,
eap_tls->tx_pdu_buf->len);
if (eap_tls->phase2_failed)
goto error;
return;
error:
@ -751,3 +760,10 @@ void eap_tls_common_set_completed(struct eap_state *eap)
eap_tls->method_completed = true;
}
void eap_tls_common_set_phase2_faild(struct eap_state *eap)
{
struct eap_tls_state *eap_tls = eap_get_data(eap);
eap_tls->phase2_failed = true;
}

View File

@ -52,6 +52,7 @@ struct eap_tls_variant_ops {
void eap_tls_common_state_free(struct eap_state *eap);
void eap_tls_common_set_completed(struct eap_state *eap);
void eap_tls_common_set_phase2_faild(struct eap_state *eap);
void eap_tls_common_handle_request(struct eap_state *eap,
const uint8_t *pkt, size_t len);