3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-20 19:12:33 +01:00

handshake: Split the install_igtk igtk parameter in 2 buffers

Split the igtk parameter to handshake_state_install_igtk into one
parameter for the actual IGTK buffer and one for the IPN buffer instead
of requiring the caller to have them both in one continuous buffer.
With FT protocol, one is received encrypted and the other in plain text.
This commit is contained in:
Andrew Zaborowski 2017-01-31 03:42:51 +01:00 committed by Denis Kenzior
parent 0932157e4f
commit 8d8b1c1baf
3 changed files with 8 additions and 7 deletions

View File

@ -1162,7 +1162,7 @@ static void eapol_handle_ptk_3_of_4(struct eapol_sm *sm,
if (igtk)
handshake_state_install_igtk(sm->handshake, igtk_key_index,
igtk, igtk_len);
igtk + 6, igtk_len - 6, igtk);
if (rekey_offload)
rekey_offload(sm->handshake->ifindex, ptk->kek, ptk->kck,
@ -1255,7 +1255,7 @@ static void eapol_handle_gtk_1_of_2(struct eapol_sm *sm,
if (igtk) {
handshake_state_install_igtk(sm->handshake, igtk_key_index,
igtk, igtk_len);
igtk + 6, igtk_len - 6, igtk);
}
done:

View File

@ -341,16 +341,16 @@ void handshake_state_install_gtk(struct handshake_state *s,
void handshake_state_install_igtk(struct handshake_state *s,
uint8_t igtk_key_index,
const uint8_t *igtk, size_t igtk_len)
const uint8_t *igtk, size_t igtk_len,
const uint8_t *ipn)
{
if (install_igtk) {
uint32_t cipher =
ie_rsn_cipher_suite_to_cipher(
s->group_management_cipher);
install_igtk(s->ifindex, igtk_key_index, igtk + 6,
igtk_len - 6, igtk, 6, cipher,
s->user_data);
install_igtk(s->ifindex, igtk_key_index, igtk, igtk_len,
ipn, 6, cipher, s->user_data);
}
}

View File

@ -124,7 +124,8 @@ void handshake_state_install_gtk(struct handshake_state *s,
void handshake_state_install_igtk(struct handshake_state *s,
uint8_t igtk_key_index,
const uint8_t *igtk, size_t igtk_len);
const uint8_t *igtk, size_t igtk_len,
const uint8_t *ipn);
void handshake_state_override_pairwise_cipher(struct handshake_state *s,
enum ie_rsn_cipher_suite pairwise);