aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/eap_tls/eap_tls.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-09-08 12:58:40 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-09-08 12:58:45 +0200
commitde29e3a683f91d5b392e7a6176c6a0730ebb7847 (patch)
tree5653031fe0ac82841d43c29caa8d61cf4dfe901a /src/libcharon/plugins/eap_tls/eap_tls.c
parent99b0f633c2252a6291cad8702110c0156e8c3840 (diff)
downloadstrongswan-de29e3a683f91d5b392e7a6176c6a0730ebb7847.tar.bz2
strongswan-de29e3a683f91d5b392e7a6176c6a0730ebb7847.tar.xz
max max_message_count configurable and move it into tls_eap_t
Diffstat (limited to 'src/libcharon/plugins/eap_tls/eap_tls.c')
-rw-r--r--src/libcharon/plugins/eap_tls/eap_tls.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/libcharon/plugins/eap_tls/eap_tls.c b/src/libcharon/plugins/eap_tls/eap_tls.c
index 53b61c847..efe72c437 100644
--- a/src/libcharon/plugins/eap_tls/eap_tls.c
+++ b/src/libcharon/plugins/eap_tls/eap_tls.c
@@ -33,11 +33,6 @@ struct private_eap_tls_t {
eap_tls_t public;
/**
- * Number of EAP-TLS messages processed so far
- */
- int processed;
-
- /**
* TLS stack, wrapped by EAP helper
*/
tls_eap_t *tls_eap;
@@ -68,12 +63,6 @@ METHOD(eap_method_t, process, status_t,
status_t status;
chunk_t data;
- if (++this->processed > MAX_MESSAGE_COUNT)
- {
- DBG1(DBG_IKE, "EAP-TLS packet count exceeded (%d > %d)",
- this->processed, MAX_MESSAGE_COUNT);
- return FAILED;
- }
data = in->get_data(in);
status = this->tls_eap->process(this->tls_eap, data, &data);
if (status == NEED_MORE)
@@ -123,6 +112,7 @@ static eap_tls_t *eap_tls_create(identification_t *server,
{
private_eap_tls_t *this;
size_t frag_size;
+ int max_msg_count;
tls_t *tls;
INIT(this,
@@ -140,8 +130,10 @@ static eap_tls_t *eap_tls_create(identification_t *server,
frag_size = lib->settings->get_int(lib->settings,
"charon.plugins.eap-tls.fragment_size", MAX_FRAGMENT_LEN);
+ max_msg_count = lib->settings->get_int(lib->settings,
+ "charon.plugins.eap-tls.max_message_count", MAX_MESSAGE_COUNT);
tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_TLS, NULL);
- this->tls_eap = tls_eap_create(EAP_TLS, tls, frag_size);
+ this->tls_eap = tls_eap_create(EAP_TLS, tls, frag_size, max_msg_count);
if (!this->tls_eap)
{
free(this);