mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
Avoid undefined behavior with memcpy PMK/PSK update
When SAE is used, the local pointer pmk may point to sm->PMK. Skip the memcpy operation in such a case since it is not really needed and use of overlapping memory buffers is undefined behavior for memcpy(). Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
c643c39287
commit
a9fed5f5b5
@ -3145,7 +3145,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
|||||||
sm->pending_1_of_4_timeout = 0;
|
sm->pending_1_of_4_timeout = 0;
|
||||||
eloop_cancel_timeout(wpa_send_eapol_timeout, sm->wpa_auth, sm);
|
eloop_cancel_timeout(wpa_send_eapol_timeout, sm->wpa_auth, sm);
|
||||||
|
|
||||||
if (wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt)) {
|
if (wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) && sm->PMK != pmk) {
|
||||||
/* PSK may have changed from the previous choice, so update
|
/* PSK may have changed from the previous choice, so update
|
||||||
* state machine data based on whatever PSK was selected here.
|
* state machine data based on whatever PSK was selected here.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user