diff options
author | Martin Willi <martin@revosec.ch> | 2013-09-03 16:32:27 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-09-03 16:36:25 +0200 |
commit | 478f9e772b967ab1811d02f7483dcfb559e973bb (patch) | |
tree | da100b5212cdac16220e17c5f985b984b6c2dde0 /src/libcharon/encoding/message.c | |
parent | 7a425fb24ca9c80ff1c5a9e842f1cb72c637d2b0 (diff) | |
parent | e8b36eb92f311a800079bda11bba6fdb1dfc003f (diff) | |
download | strongswan-478f9e772b967ab1811d02f7483dcfb559e973bb.tar.bz2 strongswan-478f9e772b967ab1811d02f7483dcfb559e973bb.tar.xz |
Merge branch 'xauth-radius-multi'
Introduces multiple rounds in the eap-radius XAuth backend, concatenating
answers to a single password to verify using a RADIUS User-Password attribute.
This is known to work fine with iOS and OS X clients, allowing two-factor
authentication with proper dialogs.
Different XAuth "profiles" for each backend can be selected using a generic
colon sperated suffix for the XAuth string.
Diffstat (limited to 'src/libcharon/encoding/message.c')
-rw-r--r-- | src/libcharon/encoding/message.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/libcharon/encoding/message.c b/src/libcharon/encoding/message.c index 9bb8e5145..3896d7199 100644 --- a/src/libcharon/encoding/message.c +++ b/src/libcharon/encoding/message.c @@ -1268,17 +1268,38 @@ static char* get_string(private_message_t *this, char *buf, int len) pos += written; len -= written; } - if (payload->get_type(payload) == CONFIGURATION) + if (payload->get_type(payload) == CONFIGURATION || + payload->get_type(payload) == CONFIGURATION_V1) { cp_payload_t *cp = (cp_payload_t*)payload; enumerator_t *attributes; configuration_attribute_t *attribute; bool first = TRUE; + char *pfx; + + switch (cp->get_type(cp)) + { + case CFG_REQUEST: + pfx = "RQ("; + break; + case CFG_REPLY: + pfx = "RP("; + break; + case CFG_SET: + pfx = "S("; + break; + case CFG_ACK: + pfx = "A("; + break; + default: + pfx = "("; + break; + } attributes = cp->create_attribute_enumerator(cp); while (attributes->enumerate(attributes, &attribute)) { - written = snprintf(pos, len, "%s%N", first ? "(" : " ", + written = snprintf(pos, len, "%s%N", first ? pfx : " ", configuration_attribute_type_short_names, attribute->get_type(attribute)); if (written >= len || written < 0) |