summaryrefslogtreecommitdiff
path: root/src/libcharon/sa/ikev1/tasks/xauth.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2015-11-18 15:19:06 +0100
committerYves-Alexis Perez <corsac@debian.org>2015-11-18 15:19:06 +0100
commitfb6324eb165d1577bc4541bc2fc6758c56da2a95 (patch)
treeafbc98168e056e7839ac0dc434db8f88ffb34833 /src/libcharon/sa/ikev1/tasks/xauth.c
parentea6a577e967da0ee954b06b7bdc6796e97eb9b2b (diff)
parent1e980d6be0ef0e243c6fe82b5e855454b97e24a4 (diff)
downloadvyos-strongswan-fb6324eb165d1577bc4541bc2fc6758c56da2a95.tar.gz
vyos-strongswan-fb6324eb165d1577bc4541bc2fc6758c56da2a95.zip
Merge tag 'upstream/5.3.4'
Upstream version 5.3.4
Diffstat (limited to 'src/libcharon/sa/ikev1/tasks/xauth.c')
-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: