aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/network
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-07-30 08:27:08 +0000
committerMartin Willi <martin@strongswan.org>2008-07-30 08:27:08 +0000
commit21632b76e0f727bebdfb15cde61ea1d3cfb229d9 (patch)
tree05991e3c09f133beba325c2f4862134eb78b48c1 /src/charon/network
parentf5a0d968fcb003cf8b6f747d6a27fdc5e170565f (diff)
downloadstrongswan-21632b76e0f727bebdfb15cde61ea1d3cfb229d9.tar.bz2
strongswan-21632b76e0f727bebdfb15cde61ea1d3cfb229d9.tar.xz
added strongswan.conf option "charon.dos_protection" to disable cookies/aggressiveness check
Diffstat (limited to 'src/charon/network')
-rw-r--r--src/charon/network/receiver.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/charon/network/receiver.c b/src/charon/network/receiver.c
index 1654f0ec9..6a887ec6a 100644
--- a/src/charon/network/receiver.c
+++ b/src/charon/network/receiver.c
@@ -96,6 +96,11 @@ struct private_receiver_t {
* hasher to use for cookie calculation
*/
hasher_t *hasher;
+
+ /**
+ * use denial of service protection mechanisms (cookies)
+ */
+ bool dos_protection;
};
/**
@@ -282,7 +287,8 @@ static job_requeue_t receive_packets(private_receiver_t *this)
}
if (message->get_request(message) &&
- message->get_exchange_type(message) == IKE_SA_INIT)
+ message->get_exchange_type(message) == IKE_SA_INIT &&
+ this->dos_protection)
{
/* check for cookies */
if (cookie_required(this, message))
@@ -367,6 +373,8 @@ receiver_t *receiver_create()
this->secret_used = 0;
this->rng->get_bytes(this->rng, SECRET_LENGTH, this->secret);
memcpy(this->secret_old, this->secret, SECRET_LENGTH);
+ this->dos_protection = lib->settings->get_bool(lib->settings,
+ "charon.dos_protection", TRUE);
this->job = callback_job_create((callback_job_cb_t)receive_packets,
this, NULL, NULL);