mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-23 07:29:28 +01:00
eapol: Silence uninitialized var warnings
This commit is contained in:
parent
e17d5abc70
commit
2c565019c7
21
src/eapol.c
21
src/eapol.c
@ -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,8 +1337,12 @@ retransmit:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
handshake_state_install_ptk(sm->handshake);
|
handshake_state_install_ptk(sm->handshake);
|
||||||
eapol_install_gtk(sm, gtk_key_index, gtk, gtk_len, ek->key_rsc);
|
|
||||||
eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len);
|
if (gtk)
|
||||||
|
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);
|
||||||
|
|
||||||
if (rekey_offload)
|
if (rekey_offload)
|
||||||
rekey_offload(sm->handshake->ifindex, ptk->kek, ptk->kck,
|
rekey_offload(sm->handshake->ifindex, ptk->kek, ptk->kck,
|
||||||
@ -1445,7 +1444,9 @@ 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);
|
||||||
eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len);
|
|
||||||
|
if (igtk)
|
||||||
|
eapol_install_igtk(sm, igtk_key_index, igtk, igtk_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct eapol_sm *eapol_find_sm(uint32_t ifindex, const uint8_t *aa)
|
static struct eapol_sm *eapol_find_sm(uint32_t ifindex, const uint8_t *aa)
|
||||||
|
Loading…
Reference in New Issue
Block a user