commit c957d25dadc55f14025c4290452791202f9315a9
parent f67e5ea6d8d900389e4e320ab8e0dfcb33f35406
Author: Denis Kenzior <denkenz@gmail.com>
Date: Tue, 13 Jul 2021 14:42:05 -0500
sae: Add sae_is_h2e
Allows clients to know whether H2E was used by the SAE state machine
Diffstat:
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/sae.c b/src/sae.c
@@ -32,8 +32,8 @@
#include "src/handshake.h"
#include "src/crypto.h"
#include "src/mpdu.h"
-#include "src/sae.h"
#include "src/auth-proto.h"
+#include "src/sae.h"
/* SHA-512 is the highest supported hashing function as of 802.11-2020 */
#define SAE_MAX_HASH_LEN 64
@@ -1291,6 +1291,13 @@ static bool sae_start(struct auth_proto *ap)
return sae_send_commit(sm, false);
}
+bool sae_sm_is_h2e(struct auth_proto *ap)
+{
+ struct sae_sm *sm = l_container_of(ap, struct sae_sm, ap);
+
+ return sm->sae_type != CRYPTO_SAE_LOOPING;
+}
+
static void sae_free(struct auth_proto *ap)
{
struct sae_sm *sm = l_container_of(ap, struct sae_sm, ap);
diff --git a/src/sae.h b/src/sae.h
@@ -20,6 +20,7 @@
*
*/
+struct auth_proto;
struct sae_sm;
struct handshake_state;
@@ -27,6 +28,8 @@ typedef void (*sae_tx_authenticate_func_t)(const uint8_t *data, size_t len,
void *user_data);
typedef void (*sae_tx_associate_func_t)(void *user_data);
+bool sae_sm_is_h2e(struct auth_proto *ap);
+
struct auth_proto *sae_sm_new(struct handshake_state *hs,
sae_tx_authenticate_func_t tx_auth,
sae_tx_associate_func_t tx_assoc,