3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

eapol: Verify key_descriptor_version

This commit is contained in:
Denis Kenzior 2014-12-24 15:04:22 -06:00
parent c1b3858a07
commit da8e10cc5f

View File

@ -55,6 +55,15 @@ bool eapol_verify(const uint8_t *data, size_t len)
return false;
}
switch (ek->key_descriptor_version) {
case EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_MD5_ARC4:
case EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_SHA1_AES:
case EAPOL_KEY_DESCRIPTOR_VERSION_AES_128_CMAC_AES:
break;
default:
return false;
}
key_data_len = L_BE16_TO_CPU(ek->key_data_len);
if (len < sizeof(struct eapol_key) + key_data_len)
return false;