ARG_ENABL_SET([eap-ttls], [enable EAP TTLS authentication module.])
ARG_ENABL_SET([eap-peap], [enable EAP PEAP authentication module.])
ARG_ENABL_SET([eap-tnc], [enable EAP TNC trusted network connect module.])
+ARG_ENABL_SET([eap-ms-soh], [enable Microsoft Statement of Health EAP module.])
ARG_ENABL_SET([eap-dynamic], [enable dynamic EAP proxy module.])
ARG_ENABL_SET([eap-radius], [enable RADIUS proxy authentication module.])
ARG_DISBL_SET([xauth-generic], [disable generic XAuth backend.])
ADD_PLUGIN([eap-ttls], [c charon nm])
ADD_PLUGIN([eap-peap], [c charon nm])
ADD_PLUGIN([eap-tnc], [c charon])
+ADD_PLUGIN([eap-ms-soh], [c charon])
ADD_PLUGIN([xauth-generic], [c charon])
ADD_PLUGIN([xauth-eap], [c charon])
ADD_PLUGIN([xauth-pam], [c charon])
AM_CONDITIONAL(USE_EAP_TTLS, test x$eap_ttls = xtrue)
AM_CONDITIONAL(USE_EAP_PEAP, test x$eap_peap = xtrue)
AM_CONDITIONAL(USE_EAP_TNC, test x$eap_tnc = xtrue)
+AM_CONDITIONAL(USE_EAP_MS_SOH, test x$eap_ms_soh = xtrue)
AM_CONDITIONAL(USE_EAP_DYNAMIC, test x$eap_dynamic = xtrue)
AM_CONDITIONAL(USE_EAP_RADIUS, test x$eap_radius = xtrue)
AM_CONDITIONAL(USE_XAUTH_GENERIC, test x$xauth_generic = xtrue)
src/libcharon/plugins/eap_ttls/Makefile
src/libcharon/plugins/eap_peap/Makefile
src/libcharon/plugins/eap_tnc/Makefile
+ src/libcharon/plugins/eap_ms_soh/Makefile
src/libcharon/plugins/eap_radius/Makefile
src/libcharon/plugins/xauth_generic/Makefile
src/libcharon/plugins/xauth_eap/Makefile
endif
endif
+if USE_EAP_MS_SOH
+ SUBDIRS += plugins/eap_ms_soh
+if MONOLITHIC
+ libcharon_la_LIBADD += plugins/eap_ms_soh/libstrongswan-eap-ms-soh.la
+endif
+endif
+
if USE_TLS
if MONOLITHIC
# otherwise this library is linked to eap_tls
--- /dev/null
+
+INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libhydra \
+ -I$(top_srcdir)/src/libcharon
+
+AM_CFLAGS = -rdynamic
+
+if MONOLITHIC
+noinst_LTLIBRARIES = libstrongswan-eap-ms-soh.la
+else
+plugin_LTLIBRARIES = libstrongswan-eap-ms-soh.la
+endif
+
+libstrongswan_eap_ms_soh_la_SOURCES = \
+ eap_ms_soh_plugin.h eap_ms_soh_plugin.c eap_ms_soh.h eap_ms_soh.c
+
+libstrongswan_eap_ms_soh_la_LDFLAGS = -module -avoid-version
--- /dev/null
+/*
+ * Copyright (C) 2010 Martin Willi
+ * Copyright (C) 2010 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "eap_ms_soh.h"
+
+#include <daemon.h>
+#include <library.h>
+
+typedef struct private_eap_ms_soh_t private_eap_ms_soh_t;
+
+/**
+ * Private data of an eap_ms_soh_t object.
+ */
+struct private_eap_ms_soh_t {
+
+ /**
+ * Public interface.
+ */
+ eap_ms_soh_t public;
+
+ /**
+ * Current EAP packet identifier
+ */
+ u_int8_t identifier;
+};
+
+METHOD(eap_method_t, initiate, status_t,
+ private_eap_ms_soh_t *this, eap_payload_t **out)
+{
+ return FAILED;
+}
+
+METHOD(eap_method_t, process, status_t,
+ private_eap_ms_soh_t *this, eap_payload_t *in, eap_payload_t **out)
+{
+ return FAILED;
+}
+
+METHOD(eap_method_t, get_type, eap_type_t,
+ private_eap_ms_soh_t *this, u_int32_t *vendor)
+{
+ *vendor = PEN_MICROSOFT;
+ return EAP_MS_SOH;
+}
+
+METHOD(eap_method_t, get_msk, status_t,
+ private_eap_ms_soh_t *this, chunk_t *msk)
+{
+ return FAILED;
+}
+
+METHOD(eap_method_t, get_identifier, u_int8_t,
+ private_eap_ms_soh_t *this)
+{
+ return this->identifier;
+}
+
+METHOD(eap_method_t, set_identifier, void,
+ private_eap_ms_soh_t *this, u_int8_t identifier)
+{
+ this->identifier = identifier;
+}
+
+METHOD(eap_method_t, is_mutual, bool,
+ private_eap_ms_soh_t *this)
+{
+ return TRUE;
+}
+
+METHOD(eap_method_t, destroy, void,
+ private_eap_ms_soh_t *this)
+{
+ free(this);
+}
+
+/**
+ * Generic private constructor
+ */
+static private_eap_ms_soh_t *create_empty()
+{
+ private_eap_ms_soh_t *this;
+
+ 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,
+ },
+ },
+ );
+
+ return this;
+}
+
+eap_ms_soh_t *eap_ms_soh_create_server(identification_t *server,
+ identification_t *peer)
+{
+ private_eap_ms_soh_t *this;
+
+ this = create_empty();
+
+ /* generate a non-zero identifier */
+ do {
+ this->identifier = random();
+ } while (!this->identifier);
+
+ return &this->public;
+}
+
+eap_ms_soh_t *eap_ms_soh_create_peer(identification_t *server,
+ identification_t *peer)
+{
+ return &create_empty()->public;
+}
--- /dev/null
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup eap_ms_soh_i eap_ms_soh
+ * @{ @ingroup eap_ms_soh
+ */
+
+#ifndef EAP_MS_SOH_H_
+#define EAP_MS_SOH_H_
+
+typedef struct eap_ms_soh_t eap_ms_soh_t;
+
+#include <sa/eap/eap_method.h>
+
+/**
+ * Implementation of Microsoft vendor specific eap_method_t EAP-MS-SOH.
+ */
+struct eap_ms_soh_t {
+
+ /**
+ * Implements eap_method_t interface.
+ */
+ eap_method_t eap_method;
+};
+
+/**
+ * Creates the EAP method EAP-soh acting as server.
+ *
+ * @param server ID of the EAP server
+ * @param peer ID of the EAP client
+ * @return eap_ms_soh_t object
+ */
+eap_ms_soh_t *eap_ms_soh_create_server(identification_t *server,
+ identification_t *peer);
+
+/**
+ * Creates the EAP method EAP-soh acting as peer.
+ *
+ * @param server ID of the EAP server
+ * @param peer ID of the EAP client
+ * @return eap_ms_soh_t object
+ */
+eap_ms_soh_t *eap_ms_soh_create_peer(identification_t *server,
+ identification_t *peer);
+
+#endif /** EAP_MS_SOH_H_ @}*/
--- /dev/null
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "eap_ms_soh_plugin.h"
+
+#include "eap_ms_soh.h"
+
+#include <daemon.h>
+
+METHOD(plugin_t, get_name, char*,
+ eap_ms_soh_plugin_t *this)
+{
+ return "eap-ms-soh";
+}
+
+/**
+ * Callback function registering EAP-SOH
+ */
+static bool register_eap_ms_soh(plugin_t *plugin, plugin_feature_t *feature,
+ bool reg, void *data)
+{
+ if (reg)
+ {
+ charon->eap->add_method(charon->eap, EAP_MS_SOH, PEN_MICROSOFT,
+ data == eap_ms_soh_create_server ? EAP_SERVER : EAP_PEER,
+ (eap_constructor_t)data);
+ }
+ else
+ {
+ charon->eap->remove_method(charon->eap, (eap_constructor_t)data);
+ }
+ return TRUE;
+}
+
+METHOD(plugin_t, get_features, int,
+ eap_ms_soh_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_CALLBACK(register_eap_ms_soh, eap_ms_soh_create_server),
+ PLUGIN_PROVIDE(CUSTOM, "EAP-MS-SOH server"),
+ PLUGIN_CALLBACK(register_eap_ms_soh, eap_ms_soh_create_peer),
+ PLUGIN_PROVIDE(CUSTOM, "EAP-MS-SOH client"),
+ };
+ *features = f;
+ return countof(f);
+}
+
+METHOD(plugin_t, destroy, void,
+ eap_ms_soh_plugin_t *this)
+{
+ free(this);
+}
+
+/*
+ * see header file
+ */
+plugin_t *eap_ms_soh_plugin_create()
+{
+ eap_ms_soh_plugin_t *this;
+
+ INIT(this,
+ .plugin = {
+ .get_name = _get_name,
+ .get_features = _get_features,
+ .destroy = _destroy,
+ },
+ );
+
+ return &this->plugin;
+}
--- /dev/null
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup eap_ms_soh eap_ms_soh
+ * @ingroup cplugins
+ *
+ * @defgroup eap_ms_soh_plugin eap_ms_soh_plugin
+ * @{ @ingroup eap_ms_soh
+ */
+
+#ifndef EAP_MS_SOH_PLUGIN_H_
+#define EAP_MS_SOH_PLUGIN_H_
+
+#include <plugins/plugin.h>
+
+typedef struct eap_ms_soh_plugin_t eap_ms_soh_plugin_t;
+
+/**
+ * Plugin providing Microsoft specific EAP_MS_SOH (Statement of Health).
+ */
+struct eap_ms_soh_plugin_t {
+
+ /**
+ * Implements plugin interface
+ */
+ plugin_t plugin;
+};
+
+/**
+ * Create a eap_ms_soh_plugin instance.
+ */
+plugin_t *eap_ms_soh_plugin_create();
+
+#endif /** EAP_MS_SOH_PLUGIN_H_ @}*/