3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 18:59:22 +01:00

eapol: Silence uninitialized var warnings

This commit is contained in:
Denis Kenzior 2017-10-20 07:41:56 -05:00
parent e17d5abc70
commit 2c565019c7

View File

@ -885,8 +885,6 @@ static void eapol_install_gtk(struct eapol_sm *sm, uint8_t gtk_key_index,
const uint8_t *gtk, size_t gtk_len, const uint8_t *gtk, size_t gtk_len,
const uint8_t *rsc) const uint8_t *rsc)
{ {
if (!gtk)
return;
/* /*
* Don't install the same GTK. On older kernels this resets the * Don't install the same GTK. On older kernels this resets the
* replay counters, etc and can lead to various attacks * replay counters, etc and can lead to various attacks
@ -904,9 +902,6 @@ static void eapol_install_gtk(struct eapol_sm *sm, uint8_t gtk_key_index,
static void eapol_install_igtk(struct eapol_sm *sm, uint8_t igtk_key_index, static void eapol_install_igtk(struct eapol_sm *sm, uint8_t igtk_key_index,
const uint8_t *igtk, size_t igtk_len) const uint8_t *igtk, size_t igtk_len)
{ {
if (!igtk)
return;
/* /*
* Don't install the same IGTK. On older kernels this resets the * Don't install the same IGTK. On older kernels this resets the
* replay counters, etc and can lead to various attacks * replay counters, etc and can lead to various attacks
@ -1129,9 +1124,9 @@ static void eapol_handle_ptk_3_of_4(struct eapol_sm *sm,
const struct crypto_ptk *ptk; const struct crypto_ptk *ptk;
struct eapol_key *step4; struct eapol_key *step4;
uint8_t mic[16]; uint8_t mic[16];
const uint8_t *gtk; const uint8_t *gtk = NULL;
size_t gtk_len; size_t gtk_len;
const uint8_t *igtk; const uint8_t *igtk = NULL;
size_t igtk_len; size_t igtk_len;
const uint8_t *rsne; const uint8_t *rsne;
const uint8_t *optional_rsne = NULL; const uint8_t *optional_rsne = NULL;
@ -1342,7 +1337,11 @@ retransmit:
return; return;
handshake_state_install_ptk(sm->handshake); handshake_state_install_ptk(sm->handshake);
if (gtk)
eapol_install_gtk(sm, gtk_key_index, gtk, gtk_len, ek->key_rsc); eapol_install_gtk(sm, gtk_key_index, gtk, gtk_len, ek->key_rsc);
if (igtk)
eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len); eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len);
if (rekey_offload) if (rekey_offload)
@ -1445,6 +1444,8 @@ static void eapol_handle_gtk_1_of_2(struct eapol_sm *sm,
l_free(step2); l_free(step2);
eapol_install_gtk(sm, gtk_key_index, gtk, gtk_len, ek->key_rsc); eapol_install_gtk(sm, gtk_key_index, gtk, gtk_len, ek->key_rsc);
if (igtk)
eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len); eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len);
} }