aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon-cmd/cmd/cmd_connection.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-07-29 09:00:56 +0200
committerMartin Willi <martin@revosec.ch>2013-07-29 09:00:56 +0200
commit14dfdf7dacfff99aa4ba468e8618afaec1c0657b (patch)
tree17a1c5df0603cd8a093432e4003638e6a256a4b4 /src/charon-cmd/cmd/cmd_connection.c
parent7612a6e42fa4779adbeab74ec044bd554d00c3b3 (diff)
parent9d75f04eee7fd4e0f9b14fac3f9a67993d8c2267 (diff)
downloadstrongswan-14dfdf7dacfff99aa4ba468e8618afaec1c0657b.tar.bz2
strongswan-14dfdf7dacfff99aa4ba468e8618afaec1c0657b.tar.xz
Merge branch 'xauth-radius'
Implements verification of XAuth credentials using simple RADIUS User-Name and (encrypted) User-Password attributes. The XAuth backend is implemented in the eap-radius plugin, reusing all existing infrastructure and features found in that plugin, including RADIUS accounting.
Diffstat (limited to 'src/charon-cmd/cmd/cmd_connection.c')
-rw-r--r--src/charon-cmd/cmd/cmd_connection.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/charon-cmd/cmd/cmd_connection.c b/src/charon-cmd/cmd/cmd_connection.c
index 2d995f0cd..5c459f99f 100644
--- a/src/charon-cmd/cmd/cmd_connection.c
+++ b/src/charon-cmd/cmd/cmd_connection.c
@@ -102,6 +102,11 @@ struct private_cmd_connection_t {
char *identity;
/**
+ * XAuth/EAP identity
+ */
+ char *xautheap;
+
+ /**
* Is a private key configured
*/
bool key_seen;
@@ -187,6 +192,22 @@ static void add_auth_cfg(private_cmd_connection_t *this, peer_cfg_t *peer_cfg,
if (local)
{
id = identification_create_from_string(this->identity);
+ if (this->xautheap)
+ {
+ switch (class)
+ {
+ case AUTH_CLASS_EAP:
+ auth->add(auth, AUTH_RULE_EAP_IDENTITY,
+ identification_create_from_string(this->xautheap));
+ break;
+ case AUTH_CLASS_XAUTH:
+ auth->add(auth, AUTH_RULE_XAUTH_IDENTITY,
+ identification_create_from_string(this->xautheap));
+ break;
+ default:
+ break;
+ }
+ }
}
else
{
@@ -411,6 +432,10 @@ METHOD(cmd_connection_t, handle, bool,
case CMD_OPT_IDENTITY:
this->identity = arg;
break;
+ case CMD_OPT_EAP_IDENTITY:
+ case CMD_OPT_XAUTH_USER:
+ this->xautheap = arg;
+ break;
case CMD_OPT_RSA:
case CMD_OPT_AGENT:
case CMD_OPT_PKCS12: