mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +01:00
eap: check MTU when loading identity
If the MTU was set very low an identity could exceed the maximum.
This commit is contained in:
parent
53ea9adfb5
commit
77cfb615e5
@ -568,11 +568,18 @@ bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
|||||||
* octets. Support for an NAI length of 253 octets is RECOMMENDED.
|
* octets. Support for an NAI length of 253 octets is RECOMMENDED.
|
||||||
* ...
|
* ...
|
||||||
* RADIUS is unable to support NAI lengths beyond 253 octets
|
* RADIUS is unable to support NAI lengths beyond 253 octets
|
||||||
|
*
|
||||||
|
* We also need to fail if the identity is too large for the set MTU
|
||||||
|
* size minus 5 (header).
|
||||||
*/
|
*/
|
||||||
if (eap->identity && strlen(eap->identity) > 253) {
|
if (eap->identity) {
|
||||||
|
size_t id_len = strlen(eap->identity);
|
||||||
|
|
||||||
|
if (id_len > 253 || id_len > eap->mtu - 5) {
|
||||||
l_error("Identity is too long");
|
l_error("Identity is too long");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user