mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-17 00:00:59 -04:00
allow multi-pass authentication schemes as e.g. MSCHAPv2
This commit is contained in:
parent
c98ed04de0
commit
30c42831a0
@ -125,6 +125,18 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* yet another phase2 authentication? */
|
||||||
|
if (this->ph2_method)
|
||||||
|
{
|
||||||
|
type = this->ph2_method->get_type(this->ph2_method, &vendor);
|
||||||
|
|
||||||
|
if (type != received_type || vendor != received_vendor)
|
||||||
|
{
|
||||||
|
this->ph2_method->destroy(this->ph2_method);
|
||||||
|
this->ph2_method = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this->ph2_method == NULL)
|
if (this->ph2_method == NULL)
|
||||||
{
|
{
|
||||||
if (received_vendor)
|
if (received_vendor)
|
||||||
@ -148,16 +160,8 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
in->destroy(in);
|
in->destroy(in);
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
this->start_phase2 = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
type = this->ph2_method->get_type(this->ph2_method, &vendor);
|
type = this->ph2_method->get_type(this->ph2_method, &vendor);
|
||||||
|
this->start_phase2 = FALSE;
|
||||||
if (type != received_type || vendor != received_vendor)
|
|
||||||
{
|
|
||||||
DBG1(DBG_IKE, "received invalid EAP request");
|
|
||||||
in->destroy(in);
|
|
||||||
return FAILED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = this->ph2_method->process(this->ph2_method, in, &this->out);
|
status = this->ph2_method->process(this->ph2_method, in, &this->out);
|
||||||
@ -168,13 +172,8 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
this->ph2_method->destroy(this->ph2_method);
|
this->ph2_method->destroy(this->ph2_method);
|
||||||
this->ph2_method = NULL;
|
this->ph2_method = NULL;
|
||||||
return NEED_MORE;
|
/* fall through to NEED_MORE */
|
||||||
case NEED_MORE:
|
case NEED_MORE:
|
||||||
if (type != EAP_TNC)
|
|
||||||
{
|
|
||||||
this->ph2_method->destroy(this->ph2_method);
|
|
||||||
this->ph2_method = NULL;
|
|
||||||
}
|
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
default:
|
default:
|
||||||
|
@ -163,6 +163,18 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* yet another phase2 authentication? */
|
||||||
|
if (this->method)
|
||||||
|
{
|
||||||
|
type = this->method->get_type(this->method, &vendor);
|
||||||
|
|
||||||
|
if (type != received_type || vendor != received_vendor)
|
||||||
|
{
|
||||||
|
this->method->destroy(this->method);
|
||||||
|
this->method = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this->method == NULL)
|
if (this->method == NULL)
|
||||||
{
|
{
|
||||||
if (received_vendor)
|
if (received_vendor)
|
||||||
@ -186,16 +198,8 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
in->destroy(in);
|
in->destroy(in);
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
this->start_phase2 = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
type = this->method->get_type(this->method, &vendor);
|
type = this->method->get_type(this->method, &vendor);
|
||||||
|
this->start_phase2 = FALSE;
|
||||||
if (type != received_type || vendor != received_vendor)
|
|
||||||
{
|
|
||||||
DBG1(DBG_IKE, "received invalid EAP request");
|
|
||||||
in->destroy(in);
|
|
||||||
return FAILED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = this->method->process(this->method, in, &this->out);
|
status = this->method->process(this->method, in, &this->out);
|
||||||
@ -206,13 +210,8 @@ METHOD(tls_application_t, process, status_t,
|
|||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
this->method->destroy(this->method);
|
this->method->destroy(this->method);
|
||||||
this->method = NULL;
|
this->method = NULL;
|
||||||
return NEED_MORE;
|
/* fall through to NEED_MORE */
|
||||||
case NEED_MORE:
|
case NEED_MORE:
|
||||||
if (type != EAP_TNC)
|
|
||||||
{
|
|
||||||
this->method->destroy(this->method);
|
|
||||||
this->method = NULL;
|
|
||||||
}
|
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user