*/
first = pairfind(vps, PW_EAP_MESSAGE, 0, TAG_ANY);
if (!first) {
- DEBUG("rlm_eap: EAP-Message not found");
+ fr_strerror_printf("EAP-Message not found");
return NULL;
}
* Sanity check the length before doing anything.
*/
if (first->length < 4) {
- DEBUG("rlm_eap: EAP packet is too short");
+ fr_strerror_printf("EAP packet is too short");
return NULL;
}
* Take out even more weird things.
*/
if (len < 4) {
- DEBUG("rlm_eap: EAP packet has invalid length");
+ fr_strerror_printf("EAP packet has invalid length (less than 4 bytes)");
return NULL;
}
total_len += i->length;
if (total_len > len) {
- DEBUG("rlm_eap: Malformed EAP packet. Length in packet header does not match actual length");
+ fr_strerror_printf("Malformed EAP packet. Length in packet header %i, "
+ "does not match actual length %i", len, total_len);
return NULL;
}
}
* If the length is SMALLER, die, too.
*/
if (total_len < len) {
- DEBUG("rlm_eap: Malformed EAP packet. Length in packet header does not match actual length");
+ fr_strerror_printf("Malformed EAP packet. Length in packet header does not "
+ "match actual length");
return NULL;
}
* to have a valid length, which we depend upon.
*/
e = eap_vp2packet(ctx, rvps);
- if (!e) {
- return 0;
- }
+ if (!e) return 0;
/* make copy big enough for everything */
elen = (e->length[0] * 256) + e->length[1];
/* find eap message */
e = eap_vp2packet(NULL, rep->vps);
-
- /* nothing to do! */
- if(!e) return;
-
+ if (!e) {
+ ERROR("%s", fr_strerror());
+ return;
+ }
/* create EAP-ID and EAP-CODE attributes to start */
eap1 = paircreate(rep, PW_EAP_ID, 0);
eap1->vp_integer = e->id;
*/
eap_packet = eap_vp2packet(request, request->packet->vps);
if (!eap_packet) {
- RERROR("Malformed EAP Message");
+ RERROR("Malformed EAP Message: %s", fr_strerror());
return RLM_MODULE_FAIL;
}
eap_packet = eap_vp2packet(request, request->packet->vps);
if (!eap_packet) {
- RERROR("Malformed EAP Message");
+ RERROR("Malformed EAP Message: %s", fr_strerror());
return RLM_MODULE_FAIL;
}