} else if (reply->da == attr_ms_chap_error) {
REDEBUG("MS-CHAPv2 Failure");
length = 4 + reply->vp_length - 1;
- eap_round->request->type.data = talloc_array(eap_round->request, uint8_t, length);
+ MEM(eap_round->request->type.data = talloc_array(eap_round->request, uint8_t, length));
/*
* Allocate room for the EAP-MS-CHAPv2 data.
fr_pair_t *ms;
- if (eap_round->response->type.length < 544) {
- RDEBUG2("Password change has invalid length %zu < 544",
+ if (eap_round->response->type.length < 586) {
+ RDEBUG2("Password change has invalid length %zu < 586",
eap_round->response->type.length);
RETURN_UNLANG_INVALID;
}
RETURN_UNLANG_INVALID;
}
+ if (eap_round->response->type.length < length) {
+ REDEBUG("Response type data (%zu bytes) is shorter than claimed MS-Length (%zu)",
+ eap_round->response->type.length, length);
+ RETURN_UNLANG_INVALID;
+ }
+
/*
* We now know that the user has sent us a response
* to the challenge. Let's try to authenticate it.