RADIUS server: Place Message-Authenticator attribute as the first one
Move the Message-Authenticator attribute to be the first attribute in the RADIUS messages. This mitigates certain MD5 attacks against RADIUS/UDP. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
adac846bd0
commit
54abb0d3cf
1 changed files with 15 additions and 0 deletions
|
@ -920,6 +920,11 @@ radius_server_encapsulate_eap(struct radius_server_data *data,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!radius_msg_add_msg_auth(msg)) {
|
||||
radius_msg_free(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sess_id = htonl(sess->sess_id);
|
||||
if (code == RADIUS_CODE_ACCESS_CHALLENGE &&
|
||||
!radius_msg_add_attr(msg, RADIUS_ATTR_STATE,
|
||||
|
@ -1204,6 +1209,11 @@ radius_server_macacl(struct radius_server_data *data,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!radius_msg_add_msg_auth(msg)) {
|
||||
radius_msg_free(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (radius_msg_copy_attr(msg, request, RADIUS_ATTR_PROXY_STATE) < 0) {
|
||||
RADIUS_DEBUG("Failed to copy Proxy-State attribute(s)");
|
||||
radius_msg_free(msg);
|
||||
|
@ -1253,6 +1263,11 @@ static int radius_server_reject(struct radius_server_data *data,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!radius_msg_add_msg_auth(msg)) {
|
||||
radius_msg_free(msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
os_memset(&eapfail, 0, sizeof(eapfail));
|
||||
eapfail.code = EAP_CODE_FAILURE;
|
||||
eapfail.identifier = 0;
|
||||
|
|
Loading…
Reference in a new issue