From: Tobias Brunner Date: Fri, 7 Feb 2014 09:04:22 +0000 (+0100) Subject: ikev1: Fix config switching due to failed authentication during Aggressive mode X-Git-Tag: 5.1.2rc1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e1ce63915c1c66bc181406b4ef94fc55a9bcdf8;p=thirdparty%2Fstrongswan.git ikev1: Fix config switching due to failed authentication during Aggressive mode The encoded ID payload gets destroyed by the authenticator, which caused a segmentation fault after the switch. Fixes #501. --- diff --git a/src/libcharon/sa/ikev1/tasks/aggressive_mode.c b/src/libcharon/sa/ikev1/tasks/aggressive_mode.c index 46cbb879ba..d5d7f2c989 100644 --- a/src/libcharon/sa/ikev1/tasks/aggressive_mode.c +++ b/src/libcharon/sa/ikev1/tasks/aggressive_mode.c @@ -478,7 +478,7 @@ METHOD(task_t, process_r, status_t, while (TRUE) { if (this->ph1->verify_auth(this->ph1, this->method, message, - this->id_data)) + chunk_clone(this->id_data))) { break; } @@ -487,12 +487,10 @@ METHOD(task_t, process_r, status_t, this->method, TRUE, NULL); if (!this->peer_cfg) { - this->id_data = chunk_empty; return send_delete(this); } this->ike_sa->set_peer_cfg(this->ike_sa, this->peer_cfg); } - this->id_data = chunk_empty; if (!charon->bus->authorize(charon->bus, FALSE)) {