return -1;
}
- dval = dict_valbyname(PW_AUTH_TYPE, inst->auth_type_name);
+ dval = dict_valbyname(PW_AUTH_TYPE, 0, inst->auth_type_name);
if (!dval) {
radlog(L_ERR, "rlm_eap_gtc: Unknown Auth-Type %s",
inst->auth_type_name);
*/
static int gtc_initiate(void *type_data, EAP_HANDLER *handler)
{
+ char challenge_str[1024];
int length;
EAP_DS *eap_ds = handler->eap_ds;
rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data;
- /*
- * FIXME: call radius_xlat on the challenge
- */
- length = strlen(inst->challenge);
+ if (!radius_xlat(challenge_str, sizeof(challenge_str), inst->challenge, handler->request, NULL)) {
+ radlog(L_ERR, "rlm_eap_gtc: xlat failed.", inst->challenge);
+ return 0;
+ }
+
+ length = strlen(challenge_str);
/*
* We're sending a request...
return 0;
}
- memcpy(eap_ds->request->type.data, inst->challenge, length);
+ memcpy(eap_ds->request->type.data, challenge_str, length);
eap_ds->request->type.length = length;
/*
/*
* For now, do clear-text password authentication.
*/
- vp = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD);
+ vp = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD, 0);
if (!vp) {
DEBUG2(" rlm_eap_gtc: ERROR: Cleartext-Password is required for authentication.");
eap_ds->request->code = PW_EAP_FAILURE;
}
if (eap_ds->response->type.length != vp->length) {
- DEBUG2(" rlm_eap_gtc: ERROR: Passwords are of different length. %d %d", eap_ds->response->type.length, vp->length);
+ DEBUG2(" rlm_eap_gtc: ERROR: Passwords are of different length. %d %d", (int) eap_ds->response->type.length, (int) vp->length);
eap_ds->request->code = PW_EAP_FAILURE;
return 0;
}
* If there was a User-Password in the request,
* why the heck are they using EAP-GTC?
*/
- pairdelete(&handler->request->packet->vps, PW_USER_PASSWORD);
+ pairdelete(&handler->request->packet->vps, PW_USER_PASSWORD, 0);
vp = pairmake("User-Password", "", T_OP_EQ);
if (!vp) {