diff options
Diffstat (limited to 'src/pluto/plugins')
-rw-r--r-- | src/pluto/plugins/xauth/Makefile.am | 15 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_default_provider.c | 66 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_default_provider.h | 33 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_default_verifier.c | 81 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_default_verifier.h | 33 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_plugin.c | 54 | ||||
-rw-r--r-- | src/pluto/plugins/xauth/xauth_plugin.h | 42 |
7 files changed, 0 insertions, 324 deletions
diff --git a/src/pluto/plugins/xauth/Makefile.am b/src/pluto/plugins/xauth/Makefile.am deleted file mode 100644 index 354325b35..000000000 --- a/src/pluto/plugins/xauth/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libhydra \ - -I$(top_srcdir)/src/libfreeswan -I$(top_srcdir)/src/whack \ - -I$(top_srcdir)/src/pluto - -AM_CFLAGS = -rdynamic - -plugin_LTLIBRARIES = libstrongswan-xauth.la - -libstrongswan_xauth_la_SOURCES = \ - xauth_plugin.h xauth_plugin.c \ - xauth_default_provider.c xauth_default_provider.h \ - xauth_default_verifier.c xauth_default_verifier.h - -libstrongswan_xauth_la_LDFLAGS = -module -avoid-version diff --git a/src/pluto/plugins/xauth/xauth_default_provider.c b/src/pluto/plugins/xauth/xauth_default_provider.c deleted file mode 100644 index 77c5facc4..000000000 --- a/src/pluto/plugins/xauth/xauth_default_provider.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 <keys.h> - -#include "xauth_default_provider.h" - -typedef struct private_xauth_default_provider_t private_xauth_default_provider_t; - -/** - * private data of xauth_default_provider - */ -struct private_xauth_default_provider_t { - - /** - * public functions - */ - xauth_provider_t public; -}; - -METHOD(xauth_provider_t, get_secret, bool, - private_xauth_default_provider_t *this, connection_t *c, chunk_t *secret) -{ - identification_t *user, *server; - - server = c->spd.that.id; - user = (c->xauth_identity) ? c->xauth_identity : c->spd.this.id; - - return get_xauth_secret(user, server, secret); -} - -METHOD(xauth_provider_t, destroy, void, - private_xauth_default_provider_t *this) -{ - free(this); -} - -/* - * Described in header. - */ -xauth_provider_t *xauth_default_provider_create() -{ - private_xauth_default_provider_t *this; - - INIT(this, - .public = { - .get_secret = _get_secret, - .destroy = _destroy, - } - ); - - return &this->public; -} - diff --git a/src/pluto/plugins/xauth/xauth_default_provider.h b/src/pluto/plugins/xauth/xauth_default_provider.h deleted file mode 100644 index ff1a91d16..000000000 --- a/src/pluto/plugins/xauth/xauth_default_provider.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 xauth_default_provider xauth_default_provider - * @{ @ingroup xauth - */ - -#ifndef XAUTH_DEFAULT_PROVIDER_H_ -#define XAUTH_DEFAULT_PROVIDER_H_ - -#include <xauth/xauth_provider.h> - - -/** - * Create an xauth_default_provider instance. - */ -xauth_provider_t *xauth_default_provider_create(); - -#endif /** XAUTH_DEFAULT_PROVIDER_H_ @}*/ - diff --git a/src/pluto/plugins/xauth/xauth_default_verifier.c b/src/pluto/plugins/xauth/xauth_default_verifier.c deleted file mode 100644 index ca2e36aa0..000000000 --- a/src/pluto/plugins/xauth/xauth_default_verifier.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 <keys.h> - -#include "xauth_default_verifier.h" - -typedef struct private_xauth_default_verifier_t private_xauth_default_verifier_t; - -/** - * private data of xauth_default_verifier - */ -struct private_xauth_default_verifier_t { - - /** - * public functions - */ - xauth_verifier_t public; -}; - -METHOD(xauth_verifier_t, verify_secret, bool, - private_xauth_default_verifier_t *this, connection_t *c, chunk_t secret) -{ - identification_t *user, *server; - chunk_t xauth_secret; - bool success = FALSE; - - server = c->spd.this.id; - user = (c->xauth_identity) ? c->xauth_identity : c->spd.that.id; - - if (get_xauth_secret(user, server, &xauth_secret)) - { - success = chunk_equals(secret, xauth_secret); - - if (!success && secret.len && secret.ptr[secret.len - 1] == 0) - { /* fix for null-terminated passwords (e.g. from Android 4) */ - secret.len--; - success = chunk_equals(secret, xauth_secret); - } - - chunk_clear(&xauth_secret); - } - return success; -} - -METHOD(xauth_verifier_t, destroy, void, - private_xauth_default_verifier_t *this) -{ - free(this); -} - - -/* - * Described in header. - */ -xauth_verifier_t *xauth_default_verifier_create() -{ - private_xauth_default_verifier_t *this; - - INIT(this, - .public = { - .verify_secret = _verify_secret, - .destroy = _destroy, - } - ); - - return &this->public; -} - diff --git a/src/pluto/plugins/xauth/xauth_default_verifier.h b/src/pluto/plugins/xauth/xauth_default_verifier.h deleted file mode 100644 index e5814d7b4..000000000 --- a/src/pluto/plugins/xauth/xauth_default_verifier.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 xauth_default_verifier xauth_default_verifier - * @{ @ingroup xauth - */ - -#ifndef XAUTH_DEFAULT_VERIFIER_H_ -#define XAUTH_DEFAULT_VERIFIER_H_ - -#include <xauth/xauth_verifier.h> - - -/** - * Create an xauth_default_verifier instance. - */ -xauth_verifier_t *xauth_default_verifier_create(); - -#endif /** XAUTH_DEFAULT_VERIFIER_H_ @}*/ - diff --git a/src/pluto/plugins/xauth/xauth_plugin.c b/src/pluto/plugins/xauth/xauth_plugin.c deleted file mode 100644 index bfc4820ed..000000000 --- a/src/pluto/plugins/xauth/xauth_plugin.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 <pluto.h> - -#include "xauth_plugin.h" -#include "xauth_default_provider.h" -#include "xauth_default_verifier.h" - -METHOD(plugin_t, get_name, char*, - xauth_plugin_t *this) -{ - return "xauth"; -} - -METHOD(plugin_t, destroy, void, - xauth_plugin_t *this) -{ - free(this); -} - -/* - * see header file - */ -plugin_t *xauth_plugin_create() -{ - xauth_plugin_t *this; - - INIT(this, - .plugin = { - .get_name = _get_name, - .reload = (void*)return_false, - .destroy = _destroy, - }, - ); - - pluto->xauth->add_provider(pluto->xauth, xauth_default_provider_create()); - pluto->xauth->add_verifier(pluto->xauth, xauth_default_verifier_create()); - - return &this->plugin; -} - diff --git a/src/pluto/plugins/xauth/xauth_plugin.h b/src/pluto/plugins/xauth/xauth_plugin.h deleted file mode 100644 index 4f14828d2..000000000 --- a/src/pluto/plugins/xauth/xauth_plugin.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010 Andreas Steffen - * Hochschule fuer Technik Rapperswil - * - * 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 xauth xauth - * @ingroup pplugins - * - * @defgroup xauth_plugin xauth_plugin - * @{ @ingroup xauth - */ - -#ifndef XAUTH_PLUGIN_H_ -#define XAUTH_PLUGIN_H_ - -#include <plugins/plugin.h> - -typedef struct xauth_plugin_t xauth_plugin_t; - -/** - * XAUTH plugin - */ -struct xauth_plugin_t { - - /** - * implements plugin interface - */ - plugin_t plugin; -}; - -#endif /** XAUTH_PLUGIN_H_ @}*/ |