From: Martin Willi Date: Wed, 14 Dec 2011 08:44:59 +0000 (+0100) Subject: Look for an XAuth authentication config both in the first and the second round X-Git-Tag: 5.0.0~338^2~9^2~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1b986eb4825ea93a9bade30c2c42b76a38e6a0d;p=thirdparty%2Fstrongswan.git Look for an XAuth authentication config both in the first and the second round --- diff --git a/src/libcharon/sa/tasks/xauth.c b/src/libcharon/sa/tasks/xauth.c index 4fd896e3cc..58e127aa94 100644 --- a/src/libcharon/sa/tasks/xauth.c +++ b/src/libcharon/sa/tasks/xauth.c @@ -93,11 +93,15 @@ static xauth_method_t *load_method(ike_sa_t *ike_sa, bool initiator) peer_cfg = ike_sa->get_peer_cfg(ike_sa); enumerator = peer_cfg->create_auth_cfg_enumerator(peer_cfg, !initiator); if (!enumerator->enumerate(enumerator, &auth) || - !enumerator->enumerate(enumerator, &auth)) + (uintptr_t)auth->get(auth, AUTH_RULE_AUTH_CLASS) != AUTH_CLASS_XAUTH) { - DBG1(DBG_CFG, "no second authentication round found for XAuth"); - enumerator->destroy(enumerator); - return NULL; + if (!enumerator->enumerate(enumerator, &auth) || + (uintptr_t)auth->get(auth, AUTH_RULE_AUTH_CLASS) != AUTH_CLASS_XAUTH) + { + DBG1(DBG_CFG, "no XAuth authentication round found"); + enumerator->destroy(enumerator); + return NULL; + } } name = auth->get(auth, AUTH_RULE_XAUTH_BACKEND); enumerator->destroy(enumerator);