handshake: add setter for PTK

With FILS support coming there needs to be a way to set the PTK directly.
Other AKMs derive the PTK via the 4-way handshake, but FILS computes the
PTK on its own.
This commit is contained in:
James Prestwood 2019-04-17 16:46:17 -07:00 committed by Denis Kenzior
parent b768e26f1d
commit 17e3a5ee3c
2 changed files with 9 additions and 0 deletions

View File

@ -117,6 +117,13 @@ void handshake_state_set_pmk(struct handshake_state *s, const uint8_t *pmk,
s->have_pmk = true;
}
void handshake_state_set_ptk(struct handshake_state *s, const uint8_t *ptk,
size_t ptk_len)
{
memcpy(s->ptk, ptk, ptk_len);
s->ptk_complete = true;
}
void handshake_state_set_8021x_config(struct handshake_state *s,
struct l_settings *settings)
{

View File

@ -134,6 +134,8 @@ void handshake_state_set_authenticator_address(struct handshake_state *s,
void handshake_state_set_authenticator(struct handshake_state *s, bool auth);
void handshake_state_set_pmk(struct handshake_state *s, const uint8_t *pmk,
size_t pmk_len);
void handshake_state_set_ptk(struct handshake_state *s, const uint8_t *ptk,
size_t ptk_len);
void handshake_state_set_8021x_config(struct handshake_state *s,
struct l_settings *settings);
bool handshake_state_set_supplicant_rsn(struct handshake_state *s,