diff options
| author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-31 00:59:01 +0100 |
|---|---|---|
| committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-31 00:59:17 +0100 |
| commit | f652995b2123f870cb652e4dfdc9f6a59ac561f0 (patch) | |
| tree | 82246be57092b5853d1c06d8acd5779fbfb38e34 /src/libcharon/plugins/eap_tnc | |
| parent | 5c89a00f05d7417deb09a9693e24687b77c7a2ce (diff) | |
| download | strongswan-f652995b2123f870cb652e4dfdc9f6a59ac561f0.tar.bz2 strongswan-f652995b2123f870cb652e4dfdc9f6a59ac561f0.tar.xz | |
implemented dynamic detection of TNCCS protocol
Diffstat (limited to 'src/libcharon/plugins/eap_tnc')
| -rw-r--r-- | src/libcharon/plugins/eap_tnc/eap_tnc.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/libcharon/plugins/eap_tnc/eap_tnc.c b/src/libcharon/plugins/eap_tnc/eap_tnc.c index 034060acb..dd4ed5322 100644 --- a/src/libcharon/plugins/eap_tnc/eap_tnc.c +++ b/src/libcharon/plugins/eap_tnc/eap_tnc.c @@ -18,7 +18,7 @@ #include <tls_eap.h> #include <daemon.h> -#include <library.h> +#include <debug.h> typedef struct private_eap_tnc_t private_eap_tnc_t; @@ -137,7 +137,24 @@ static eap_tnc_t *eap_tnc_create(identification_t *server, "charon.plugins.eap-tnc.max_message_count", MAX_MESSAGE_COUNT); protocol = lib->settings->get_str(lib->settings, "charon.plugins.eap-tnc.protocol", "tnccs-1.1"); - type = strcaseeq(protocol, "tnccs-2.0") ? TNCCS_2_0 : TNCCS_1_1; + if (strcaseeq(protocol, "tnccs-2.0")) + { + type = TNCCS_2_0; + } + else if (strcaseeq(protocol, "tnccs-1.1")) + { + type = TNCCS_1_1; + } + else if (strcaseeq(protocol, "tnccs-dynamic") && is_server) + { + type = TNCCS_DYNAMIC; + } + else + { + DBG1(DBG_TNC, "TNCCS protocol '%s' not supported", protocol); + free(this); + return NULL; + } tnccs = charon->tnccs->create_instance(charon->tnccs, type, is_server); this->tls_eap = tls_eap_create(EAP_TNC, (tls_t*)tnccs, frag_size, max_msg_count); if (!this->tls_eap) |
