Revision 80b44cd7
| b/src/charon/encoding/message.c | ||
|---|---|---|
| 946 | 946 |
pos += written; |
| 947 | 947 |
len -= written; |
| 948 | 948 |
} |
| 949 |
if (payload->get_type(payload) == EXTENSIBLE_AUTHENTICATION) |
|
| 950 |
{
|
|
| 951 |
eap_payload_t *eap = (eap_payload_t*)payload; |
|
| 952 |
u_int32_t vendor; |
|
| 953 |
eap_type_t type; |
|
| 954 |
char method[64] = ""; |
|
| 955 |
|
|
| 956 |
type = eap->get_type(eap, &vendor); |
|
| 957 |
if (type) |
|
| 958 |
{
|
|
| 959 |
if (vendor) |
|
| 960 |
{
|
|
| 961 |
snprintf(method, sizeof(method), "/%d-%d", type, vendor); |
|
| 962 |
} |
|
| 963 |
else |
|
| 964 |
{
|
|
| 965 |
snprintf(method, sizeof(method), "/%N", |
|
| 966 |
eap_type_short_names, type); |
|
| 967 |
} |
|
| 968 |
} |
|
| 969 |
written = snprintf(pos, len, "/%N%s", eap_code_short_names, |
|
| 970 |
eap->get_code(eap), method); |
|
| 971 |
if (written >= len || written < 0) |
|
| 972 |
{
|
|
| 973 |
return buf; |
|
| 974 |
} |
|
| 975 |
pos += written; |
|
| 976 |
len -= written; |
|
| 977 |
} |
|
| 949 | 978 |
} |
| 950 | 979 |
enumerator->destroy(enumerator); |
| 951 | 980 |
|
| b/src/charon/sa/authenticators/eap/eap_method.c | ||
|---|---|---|
| 34 | 34 |
"EAP_EXPERIMENTAL"); |
| 35 | 35 |
ENUM_END(eap_type_names, EAP_EXPERIMENTAL); |
| 36 | 36 |
|
| 37 |
ENUM_BEGIN(eap_type_short_names, EAP_IDENTITY, EAP_GTC, |
|
| 38 |
"ID", |
|
| 39 |
"NTF", |
|
| 40 |
"NAK", |
|
| 41 |
"MD5", |
|
| 42 |
"OTP", |
|
| 43 |
"GTC"); |
|
| 44 |
ENUM_NEXT(eap_type_short_names, EAP_SIM, EAP_SIM, EAP_GTC, |
|
| 45 |
"SIM"); |
|
| 46 |
ENUM_NEXT(eap_type_short_names, EAP_AKA, EAP_AKA, EAP_SIM, |
|
| 47 |
"AKA"); |
|
| 48 |
ENUM_NEXT(eap_type_short_names, EAP_MSCHAPV2, EAP_MSCHAPV2, EAP_AKA, |
|
| 49 |
"MSCHAPV2"); |
|
| 50 |
ENUM_NEXT(eap_type_short_names, EAP_RADIUS, EAP_EXPERIMENTAL, EAP_MSCHAPV2, |
|
| 51 |
"RAD", |
|
| 52 |
"EXP", |
|
| 53 |
"XP"); |
|
| 54 |
ENUM_END(eap_type_short_names, EAP_EXPERIMENTAL); |
|
| 55 |
|
|
| 37 | 56 |
/* |
| 38 | 57 |
* See header |
| 39 | 58 |
*/ |
| ... | ... | |
| 71 | 90 |
"EAP_FAILURE", |
| 72 | 91 |
); |
| 73 | 92 |
|
| 93 |
ENUM(eap_code_short_names, EAP_REQUEST, EAP_FAILURE, |
|
| 94 |
"REQ", |
|
| 95 |
"RES", |
|
| 96 |
"SUCC", |
|
| 97 |
"FAIL", |
|
| 98 |
); |
|
| 99 |
|
|
| 74 | 100 |
ENUM(eap_role_names, EAP_SERVER, EAP_PEER, |
| 75 | 101 |
"EAP_SERVER", |
| 76 | 102 |
"EAP_PEER", |
| b/src/charon/sa/authenticators/eap/eap_method.h | ||
|---|---|---|
| 67 | 67 |
extern enum_name_t *eap_type_names; |
| 68 | 68 |
|
| 69 | 69 |
/** |
| 70 |
* short string enum names for eap_type_t. |
|
| 71 |
*/ |
|
| 72 |
extern enum_name_t *eap_type_short_names; |
|
| 73 |
|
|
| 74 |
/** |
|
| 70 | 75 |
* Lookup the EAP method type from a string. |
| 71 | 76 |
* |
| 72 | 77 |
* @param name EAP method name (such as "md5", "aka") |
| ... | ... | |
| 90 | 95 |
extern enum_name_t *eap_code_names; |
| 91 | 96 |
|
| 92 | 97 |
/** |
| 98 |
* short string enum names for eap_code_t. |
|
| 99 |
*/ |
|
| 100 |
extern enum_name_t *eap_code_short_names; |
|
| 101 |
|
|
| 102 |
/** |
|
| 93 | 103 |
* Interface of an EAP method for server and client side. |
| 94 | 104 |
* |
| 95 | 105 |
* An EAP method initiates an EAP exchange and processes requests and |
Also available in: Unified diff