3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02: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) if (igtk)
handshake_state_install_igtk(sm->handshake, igtk_key_index, handshake_state_install_igtk(sm->handshake, igtk_key_index,
igtk, igtk_len); igtk + 6, igtk_len - 6, igtk);
if (rekey_offload) if (rekey_offload)
rekey_offload(sm->handshake->ifindex, ptk->kek, ptk->kck, 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) { if (igtk) {
handshake_state_install_igtk(sm->handshake, igtk_key_index, handshake_state_install_igtk(sm->handshake, igtk_key_index,
igtk, igtk_len); igtk + 6, igtk_len - 6, igtk);
} }
done: 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, void handshake_state_install_igtk(struct handshake_state *s,
uint8_t igtk_key_index, 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) { if (install_igtk) {
uint32_t cipher = uint32_t cipher =
ie_rsn_cipher_suite_to_cipher( ie_rsn_cipher_suite_to_cipher(
s->group_management_cipher); s->group_management_cipher);
install_igtk(s->ifindex, igtk_key_index, igtk + 6, install_igtk(s->ifindex, igtk_key_index, igtk, igtk_len,
igtk_len - 6, igtk, 6, cipher, ipn, 6, cipher, s->user_data);
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, void handshake_state_install_igtk(struct handshake_state *s,
uint8_t igtk_key_index, 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, void handshake_state_override_pairwise_cipher(struct handshake_state *s,
enum ie_rsn_cipher_suite pairwise); enum ie_rsn_cipher_suite pairwise);