eapol: Check handshake_state_get_pmkid return value

Don't proceed with the handshake if handshake_state_get_pmkid fails
(shouldn't happen, but it's an error situation)
This commit is contained in:
Andrew Zaborowski 2018-12-19 02:00:42 +01:00 committed by Denis Kenzior
parent 9d9f8331fa
commit 6bf365d9a4
1 changed files with 4 additions and 2 deletions

View File

@ -980,8 +980,10 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
} else if (pmkid) {
uint8_t own_pmkid[16];
if (handshake_state_get_pmkid(sm->handshake, own_pmkid) &&
memcmp(pmkid, own_pmkid, 16)) {
if (!handshake_state_get_pmkid(sm->handshake, own_pmkid))
goto error_unspecified;
if (memcmp(pmkid, own_pmkid, 16)) {
l_debug("Authenticator sent a PMKID that didn't match");
/*