aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-10-01 18:15:00 +0200
committerTobias Brunner <tobias@strongswan.org>2015-11-09 14:44:53 +0100
commitbd5084ae252867705e26e2cfbc4b74fadbc7126c (patch)
tree6b7e0496e58932759f97397dc978539870f75ebe /src
parent50e4aeb22f499d1a2f955bd7d88a78606eb4e48f (diff)
downloadstrongswan-bd5084ae252867705e26e2cfbc4b74fadbc7126c.tar.bz2
strongswan-bd5084ae252867705e26e2cfbc4b74fadbc7126c.tar.xz
xauth: Call authorize() hook also when xauth-noauth is used
Fixes #1138.
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/sa/ikev1/tasks/xauth.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libcharon/sa/ikev1/tasks/xauth.c b/src/libcharon/sa/ikev1/tasks/xauth.c
index a770e90ff..c0c91574c 100644
--- a/src/libcharon/sa/ikev1/tasks/xauth.c
+++ b/src/libcharon/sa/ikev1/tasks/xauth.c
@@ -271,7 +271,10 @@ static bool add_auth_cfg(private_xauth_t *this, identification_t *id, bool local
auth = auth_cfg_create();
auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_XAUTH);
- auth->add(auth, AUTH_RULE_XAUTH_IDENTITY, id->clone(id));
+ if (id)
+ {
+ auth->add(auth, AUTH_RULE_XAUTH_IDENTITY, id->clone(id));
+ }
auth->merge(auth, this->ike_sa->get_auth_cfg(this->ike_sa, local), FALSE);
this->ike_sa->add_auth_cfg(this->ike_sa, local, auth);
@@ -342,7 +345,10 @@ METHOD(task_t, build_i, status_t,
break;
case SUCCESS:
DESTROY_IF(cp);
- this->status = XAUTH_OK;
+ if (add_auth_cfg(this, NULL, FALSE) && allowed(this))
+ {
+ this->status = XAUTH_OK;
+ }
this->public.task.process = _process_i_status;
return build_i_status(this, message);
default: