aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/load_tester
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-01-27 10:40:39 +0100
committerMartin Willi <martin@revosec.ch>2015-02-20 14:04:23 +0100
commit45ab5b0fcae2620b88a0cd167f09eb440aebfca7 (patch)
treeceb71815b2f6d17c6812e565fca81405e47b75c4 /src/libcharon/plugins/load_tester
parentee83067e5c7728133c51f02f4451dd2e16d7e833 (diff)
downloadstrongswan-45ab5b0fcae2620b88a0cd167f09eb440aebfca7.tar.bz2
strongswan-45ab5b0fcae2620b88a0cd167f09eb440aebfca7.tar.xz
load-tester: Support initiating XAuth authentication
As with other configuration backends, XAuth is activated with a two round client authentication using pubkey and xauth. In load-tester, this is configured with initiator_auth=pubkey|xauth. Fixes #835.
Diffstat (limited to 'src/libcharon/plugins/load_tester')
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_config.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libcharon/plugins/load_tester/load_tester_config.c b/src/libcharon/plugins/load_tester/load_tester_config.c
index 65575c6ac..8a500635c 100644
--- a/src/libcharon/plugins/load_tester/load_tester_config.c
+++ b/src/libcharon/plugins/load_tester/load_tester_config.c
@@ -394,6 +394,28 @@ static void generate_auth_cfg(private_load_tester_config_t *this, char *str,
}
}
}
+ else if (strpfx(str, "xauth"))
+ { /* XAuth, use a username */
+ class = AUTH_CLASS_XAUTH;
+ if (*(str + strlen("xauth")) == '-')
+ {
+ auth->add(auth, AUTH_RULE_XAUTH_BACKEND, str + strlen("xauth-"));
+ }
+ if (!id)
+ {
+ if (local && num)
+ {
+ snprintf(buf, sizeof(buf), "cli-%.6d-%.2d", num, rnd);
+ id = identification_create_from_string(buf);
+ }
+ else
+ {
+ id = identification_create_from_encoding(ID_ANY, chunk_empty);
+ }
+ }
+ /* additionally set the ID as XAuth identity */
+ auth->add(auth, AUTH_RULE_XAUTH_IDENTITY, id->clone(id));
+ }
else
{
if (!streq(str, "pubkey"))