From: Clavister OpenSource Date: Tue, 29 Nov 2011 09:52:31 +0000 (+0100) Subject: IKEv1 XAuth: Change the main_mode task to use the new initiate_xauth job instead... X-Git-Tag: 5.0.0~338^2~9^2~348 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=ef2eac7fb06001e715ced5b744b2b40fd992d134;ds=sidebyside IKEv1 XAuth: Change the main_mode task to use the new initiate_xauth job instead of the old MIGRATE method. --- diff --git a/src/libcharon/sa/tasks/main_mode.c b/src/libcharon/sa/tasks/main_mode.c index 694c3f4..3a051a6 100644 --- a/src/libcharon/sa/tasks/main_mode.c +++ b/src/libcharon/sa/tasks/main_mode.c @@ -28,6 +28,7 @@ #include #include #include +#include typedef struct private_main_mode_t private_main_mode_t; @@ -662,10 +663,18 @@ METHOD(task_t, build_r, status_t, this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED); charon->bus->ike_updown(charon->bus, this->ike_sa, TRUE); - /* TODO-IKEv1: Check the proposal for XAuthInit* auth modes */ - /* TODO-IKEv1: check for XAUTH rounds, queue them */ - if(0) /* TODO-IKEv1: Change to 1 if XAUTH is desired. */ - return MIGRATE; + switch (this->auth_method) + { + case AUTH_XAUTH_INIT_PSK: + case AUTH_XAUTH_INIT_RSA: /* There should be more INIT cases here once added */ + { + job_t *job = (job_t *) initiate_xauth_job_create(this->ike_sa->get_id(this->ike_sa)); + lib->processor->queue_job(lib->processor, job); + break; + } + default: + break; + } return SUCCESS; } default: @@ -767,6 +776,20 @@ METHOD(task_t, process_i, status_t, this->ike_sa->get_other_id(this->ike_sa)); this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED); charon->bus->ike_updown(charon->bus, this->ike_sa, TRUE); + + switch (this->auth_method) + { + case AUTH_XAUTH_RESP_PSK: + case AUTH_XAUTH_RESP_RSA: /* There should be more RESP cases here once added */ + { + job_t *job = (job_t *) initiate_xauth_job_create(this->ike_sa->get_id(this->ike_sa)); + lib->processor->queue_job(lib->processor, job); + break; + } + default: + break; + } + return SUCCESS; } default: