summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/eap_tnc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/plugins/eap_tnc')
-rw-r--r--src/libcharon/plugins/eap_tnc/Makefile.in33
-rw-r--r--src/libcharon/plugins/eap_tnc/eap_tnc.c83
-rw-r--r--src/libcharon/plugins/eap_tnc/eap_tnc.h6
3 files changed, 99 insertions, 23 deletions
diff --git a/src/libcharon/plugins/eap_tnc/Makefile.in b/src/libcharon/plugins/eap_tnc/Makefile.in
index 60a6d6de6..30a858102 100644
--- a/src/libcharon/plugins/eap_tnc/Makefile.in
+++ b/src/libcharon/plugins/eap_tnc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -108,6 +125,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libstrongswan_eap_tnc_la_SOURCES)
DIST_SOURCES = $(libstrongswan_eap_tnc_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -124,6 +146,8 @@ BTLIB = @BTLIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -140,6 +164,7 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GPERF = @GPERF@
+GPRBUILD = @GPRBUILD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -208,8 +233,6 @@ am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
attest_plugins = @attest_plugins@
-axis2c_CFLAGS = @axis2c_CFLAGS@
-axis2c_LIBS = @axis2c_LIBS@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -265,7 +288,6 @@ nm_ca_dir = @nm_ca_dir@
nm_plugins = @nm_plugins@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
-p_plugins = @p_plugins@
pcsclite_CFLAGS = @pcsclite_CFLAGS@
pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
@@ -363,7 +385,6 @@ clean-noinstLTLIBRARIES:
done
install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
@@ -371,6 +392,8 @@ install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
else :; fi; \
done; \
test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
}
diff --git a/src/libcharon/plugins/eap_tnc/eap_tnc.c b/src/libcharon/plugins/eap_tnc/eap_tnc.c
index ffa1bae39..7363ade1d 100644
--- a/src/libcharon/plugins/eap_tnc/eap_tnc.c
+++ b/src/libcharon/plugins/eap_tnc/eap_tnc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 Andreas Steffen
+ * Copyright (C) 2010-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -21,6 +21,8 @@
#include <utils/debug.h>
#include <daemon.h>
+#include <tncifimv.h>
+
/**
* Maximum size of an EAP-TNC message
*/
@@ -44,15 +46,50 @@ struct private_eap_tnc_t {
eap_tnc_t public;
/**
+ * Outer EAP authentication type
+ */
+ eap_type_t auth_type;
+
+ /**
* TLS stack, wrapped by EAP helper
*/
tls_eap_t *tls_eap;
+
+ /**
+ * TNCCS instance running over EAP-TNC
+ */
+ tnccs_t *tnccs;
+
};
METHOD(eap_method_t, initiate, status_t,
private_eap_tnc_t *this, eap_payload_t **out)
{
chunk_t data;
+ u_int32_t auth_type;
+
+ /* Determine TNC Client Authentication Type */
+ switch (this->auth_type)
+ {
+ case EAP_TLS:
+ case EAP_TTLS:
+ case EAP_PEAP:
+ auth_type = TNC_AUTH_CERT;
+ break;
+ case EAP_MD5:
+ case EAP_MSCHAPV2:
+ case EAP_GTC:
+ case EAP_OTP:
+ auth_type = TNC_AUTH_PASSWORD;
+ break;
+ case EAP_SIM:
+ case EAP_AKA:
+ auth_type = TNC_AUTH_SIM;
+ break;
+ default:
+ auth_type = TNC_AUTH_UNKNOWN;
+ }
+ this->tnccs->set_auth_type(this->tnccs, auth_type);
if (this->tls_eap->initiate(this->tls_eap, &data) == NEED_MORE)
{
@@ -122,6 +159,18 @@ METHOD(eap_method_t, destroy, void,
free(this);
}
+METHOD(eap_inner_method_t, get_auth_type, eap_type_t,
+ private_eap_tnc_t *this)
+{
+ return this->auth_type;
+}
+
+METHOD(eap_inner_method_t, set_auth_type, void,
+ private_eap_tnc_t *this, eap_type_t type)
+{
+ this->auth_type = type;
+}
+
/**
* Generic private constructor
*/
@@ -132,19 +181,22 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
int max_msg_count;
char* protocol;
tnccs_type_t type;
- tnccs_t *tnccs;
INIT(this,
.public = {
- .eap_method = {
- .initiate = _initiate,
- .process = _process,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .get_identifier = _get_identifier,
- .set_identifier = _set_identifier,
- .destroy = _destroy,
+ .eap_inner_method = {
+ .eap_method = {
+ .initiate = _initiate,
+ .process = _process,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .get_identifier = _get_identifier,
+ .set_identifier = _set_identifier,
+ .destroy = _destroy,
+ },
+ .get_auth_type = _get_auth_type,
+ .set_auth_type = _set_auth_type,
},
},
);
@@ -172,10 +224,11 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
free(this);
return NULL;
}
- tnccs = tnc->tnccs->create_instance(tnc->tnccs, type, is_server);
- this->tls_eap = tls_eap_create(EAP_TNC, (tls_t*)tnccs,
- EAP_TNC_MAX_MESSAGE_LEN,
- max_msg_count, FALSE);
+ this->tnccs = tnc->tnccs->create_instance(tnc->tnccs, type, is_server,
+ server, peer, TNC_IFT_EAP_1_1);
+ this->tls_eap = tls_eap_create(EAP_TNC, &this->tnccs->tls,
+ EAP_TNC_MAX_MESSAGE_LEN,
+ max_msg_count, FALSE);
if (!this->tls_eap)
{
free(this);
diff --git a/src/libcharon/plugins/eap_tnc/eap_tnc.h b/src/libcharon/plugins/eap_tnc/eap_tnc.h
index 09abe60fc..8c881f6cf 100644
--- a/src/libcharon/plugins/eap_tnc/eap_tnc.h
+++ b/src/libcharon/plugins/eap_tnc/eap_tnc.h
@@ -23,7 +23,7 @@
typedef struct eap_tnc_t eap_tnc_t;
-#include <sa/eap/eap_method.h>
+#include <sa/eap/eap_inner_method.h>
/**
* Implementation of the eap_method_t interface using EAP-TNC.
@@ -31,9 +31,9 @@ typedef struct eap_tnc_t eap_tnc_t;
struct eap_tnc_t {
/**
- * Implemented eap_method_t interface.
+ * Implemented eap_inner_method_t interface.
*/
- eap_method_t eap_method;
+ eap_inner_method_t eap_inner_method;
};
/**