commit 17e3a5ee3c5a80db229d4acc20e5ce82300ae4a4
parent b768e26f1d40674cfc2d37df8c3a34444ccce530
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Wed, 17 Apr 2019 16:46:17 -0700
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.
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/handshake.c b/src/handshake.c
@@ -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)
{
diff --git a/src/handshake.h b/src/handshake.h
@@ -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,