mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-18 01:59:31 +01:00
eapol,handshake: Memzero copies of secrets
This commit is contained in:
parent
c682847249
commit
f76e10799f
@ -1247,9 +1247,10 @@ static void eapol_send_ptk_3_of_4(struct eapol_sm *sm)
|
||||
}
|
||||
|
||||
kek = handshake_state_get_kek(sm->handshake);
|
||||
|
||||
key_data_len = eapol_encrypt_key_data(kek, key_data_buf,
|
||||
key_data_len, ek, sm->mic_len);
|
||||
key_data_len, ek, sm->mic_len);
|
||||
explicit_bzero(key_data_buf, sizeof(key_data_buf));
|
||||
|
||||
if (key_data_len < 0)
|
||||
return;
|
||||
|
||||
@ -1900,6 +1901,9 @@ static void eapol_key_handle(struct eapol_sm *sm,
|
||||
}
|
||||
|
||||
done:
|
||||
if (decrypted_key_data)
|
||||
explicit_bzero(decrypted_key_data, key_data_len);
|
||||
|
||||
l_free(decrypted_key_data);
|
||||
}
|
||||
|
||||
|
@ -79,9 +79,13 @@ void handshake_state_free(struct handshake_state *s)
|
||||
l_free(s->supplicant_ie);
|
||||
l_free(s->mde);
|
||||
l_free(s->fte);
|
||||
l_free(s->passphrase);
|
||||
|
||||
memset(s, 0, sizeof(*s));
|
||||
if (s->passphrase) {
|
||||
explicit_bzero(s->passphrase, strlen(s->passphrase));
|
||||
l_free(s->passphrase);
|
||||
}
|
||||
|
||||
explicit_bzero(s, sizeof(*s));
|
||||
|
||||
if (destroy)
|
||||
destroy(s);
|
||||
|
Loading…
Reference in New Issue
Block a user