From 80b44cd71a32917fc127013f6f394aa561143413 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 18 Nov 2009 10:37:46 +0100 Subject: Message stringification supports more detailed EAP payload information --- src/charon/encoding/message.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/charon/encoding/message.c') diff --git a/src/charon/encoding/message.c b/src/charon/encoding/message.c index b39c076e6..397a3c609 100644 --- a/src/charon/encoding/message.c +++ b/src/charon/encoding/message.c @@ -946,6 +946,35 @@ static char* get_string(private_message_t *this, char *buf, int len) pos += written; len -= written; } + if (payload->get_type(payload) == EXTENSIBLE_AUTHENTICATION) + { + eap_payload_t *eap = (eap_payload_t*)payload; + u_int32_t vendor; + eap_type_t type; + char method[64] = ""; + + type = eap->get_type(eap, &vendor); + if (type) + { + if (vendor) + { + snprintf(method, sizeof(method), "/%d-%d", type, vendor); + } + else + { + snprintf(method, sizeof(method), "/%N", + eap_type_short_names, type); + } + } + written = snprintf(pos, len, "/%N%s", eap_code_short_names, + eap->get_code(eap), method); + if (written >= len || written < 0) + { + return buf; + } + pos += written; + len -= written; + } } enumerator->destroy(enumerator); -- cgit v1.2.3