From 2036d36313ad645edd81362dc5cfeec15fe250fb Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 15 Aug 2018 10:36:18 -0700 Subject: [PATCH] handshake: introduce authenticator bit Both SAE and adhoc can benefit from knowing whether the handshake state is an authenticator or a supplicant. It will allow both to easily obtain the remote address rather than sorting out if aa/spa match the devices own address. --- src/handshake.c | 5 +++++ src/handshake.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/handshake.c b/src/handshake.c index 753eacd0..0a124dd5 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -98,6 +98,11 @@ void handshake_state_set_authenticator_address(struct handshake_state *s, memcpy(s->aa, aa, sizeof(s->aa)); } +void handshake_state_set_authenticator(struct handshake_state *s, bool auth) +{ + s->authenticator = auth; +} + void handshake_state_set_pmk(struct handshake_state *s, const uint8_t *pmk, size_t pmk_len) { diff --git a/src/handshake.h b/src/handshake.h index 853bdf76..a93c8497 100644 --- a/src/handshake.h +++ b/src/handshake.h @@ -102,6 +102,7 @@ struct handshake_state { bool mfp : 1; bool have_anonce : 1; bool have_pmkid : 1; + bool authenticator : 1; uint8_t ssid[32]; size_t ssid_len; char *passphrase; @@ -121,6 +122,7 @@ void handshake_state_set_supplicant_address(struct handshake_state *s, const uint8_t *spa); void handshake_state_set_authenticator_address(struct handshake_state *s, const uint8_t *aa); +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_8021x_config(struct handshake_state *s,