{
uint8_t calculated[24];
+ rad_assert(request != NULL);
+
/*
* Do normal authentication.
*/
return -1;
}
- smbdes_mschap(password->vp_strvalue, challenge, calculated);
+ smbdes_mschap(password->vp_octets, challenge, calculated);
if (memcmp(response, calculated, 24) != 0) {
return -1;
}
buffer, sizeof(buffer),
NULL, NULL, 1);
if (result != 0) {
+ char *p;
+ VALUE_PAIR *vp = NULL;
+
RDEBUG2("External script failed.");
+
+ vp = pairmake("Module-Failure-Message", "", T_OP_EQ);
+ if (!vp) {
+ radlog_request(L_ERR, 0, request, "No memory to allocate Module-Failure-Message");
+ return RLM_MODULE_FAIL;
+ }
+
+ p = strchr(buffer, '\n');
+ if (p) *p = '\0';
+ snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue),
+ "%s: External script says %s",
+ inst->xlat_name, buffer);
+ vp->length = strlen(vp->vp_strvalue);
+ pairadd(&request->packet->vps, vp);
return -1;
}