From 2177b22caa6cba79fc044f898c23a53765a44572 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 20 Jun 2018 11:05:16 -0700 Subject: [PATCH] handshake: Add utility to generate a new anonce AP EAPoL state machine will need to generate the anonce, so as with snonce, an API was added to do that. --- src/handshake.c | 7 +++++++ src/handshake.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/handshake.c b/src/handshake.c index 479a05dc..b475bb8c 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -238,6 +238,13 @@ void handshake_state_new_snonce(struct handshake_state *s) s->have_snonce = true; } +void handshake_state_new_anonce(struct handshake_state *s) +{ + get_nonce(s->anonce); + + s->have_anonce = true; +} + void handshake_state_set_anonce(struct handshake_state *s, const uint8_t *anonce) { diff --git a/src/handshake.h b/src/handshake.h index 0d255fef..bd10a7a6 100644 --- a/src/handshake.h +++ b/src/handshake.h @@ -86,6 +86,7 @@ struct handshake_state { bool wpa_ie : 1; bool have_pmk : 1; bool mfp : 1; + bool have_anonce : 1; uint8_t ssid[32]; size_t ssid_len; uint8_t r0khid[48]; @@ -126,6 +127,7 @@ void handshake_state_set_kh_ids(struct handshake_state *s, const uint8_t *r1khid); void handshake_state_new_snonce(struct handshake_state *s); +void handshake_state_new_anonce(struct handshake_state *s); void handshake_state_set_anonce(struct handshake_state *s, const uint8_t *anonce);