aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/authenticators
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-06-28 15:45:07 +0200
committerMartin Willi <martin@revosec.ch>2010-07-05 09:41:04 +0200
commit53913d764ec312895b4e0b96d8605625f0892886 (patch)
tree931bda25bf278d1bb27fc617df1a0e883577ff28 /src/libcharon/sa/authenticators
parentec6caa13673176b7f2ef486dc5437cf05a00bb48 (diff)
downloadstrongswan-53913d764ec312895b4e0b96d8605625f0892886.tar.bz2
strongswan-53913d764ec312895b4e0b96d8605625f0892886.tar.xz
Use the responder side configured EAP-Identity directly, if given
Diffstat (limited to 'src/libcharon/sa/authenticators')
-rw-r--r--src/libcharon/sa/authenticators/eap_authenticator.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/libcharon/sa/authenticators/eap_authenticator.c b/src/libcharon/sa/authenticators/eap_authenticator.c
index 0fbeb63fe..3c0f3c358 100644
--- a/src/libcharon/sa/authenticators/eap_authenticator.c
+++ b/src/libcharon/sa/authenticators/eap_authenticator.c
@@ -140,17 +140,26 @@ static eap_payload_t* server_initiate_eap(private_eap_authenticator_t *this,
id = auth->get(auth, AUTH_RULE_EAP_IDENTITY);
if (id)
{
- this->method = load_method(this, EAP_IDENTITY, 0, EAP_SERVER);
- if (this->method)
+ if (id->get_type(id) == ID_ANY)
{
- if (this->method->initiate(this->method, &out) == NEED_MORE)
+ this->method = load_method(this, EAP_IDENTITY, 0, EAP_SERVER);
+ if (this->method)
{
- DBG1(DBG_IKE, "initiating EAP-Identity request");
- return out;
+ if (this->method->initiate(this->method, &out) == NEED_MORE)
+ {
+ DBG1(DBG_IKE, "initiating EAP-Identity request");
+ return out;
+ }
+ this->method->destroy(this->method);
}
- this->method->destroy(this->method);
+ DBG1(DBG_IKE, "EAP-Identity request configured, "
+ "but not supported");
+ }
+ else
+ {
+ DBG1(DBG_IKE, "using configured EAP-Identity %Y", id);
+ this->eap_identity = id->clone(id);
}
- DBG1(DBG_IKE, "EAP-Identity request configured, but not supported");
}
}
/* invoke real EAP method */