commit c1d40e226305b7aa3d0c79e5d8f89a277ac9b67c
parent 62dad5e7920f6d5e77b9bc57ef949c8ac427403a
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 5 Dec 2023 07:46:40 -0800
handshake: add password identifier/setter
Diffstat:
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/handshake.c b/src/handshake.c
@@ -137,6 +137,12 @@ void handshake_state_free(struct handshake_state *s)
l_free(s->passphrase);
}
+ if (s->password_identifier) {
+ explicit_bzero(s->password_identifier,
+ strlen(s->password_identifier));
+ l_free(s->password_identifier);
+ }
+
if (s->ecc_sae_pts) {
unsigned int i;
@@ -364,6 +370,12 @@ void handshake_state_set_passphrase(struct handshake_state *s,
s->passphrase = l_strdup(passphrase);
}
+void handshake_state_set_password_identifier(struct handshake_state *s,
+ const char *id)
+{
+ s->password_identifier = l_strdup(id);
+}
+
void handshake_state_set_no_rekey(struct handshake_state *s, bool no_rekey)
{
s->no_rekey = no_rekey;
diff --git a/src/handshake.h b/src/handshake.h
@@ -143,6 +143,7 @@ struct handshake_state {
uint8_t ssid[32];
size_t ssid_len;
char *passphrase;
+ char *password_identifier;
uint8_t r0khid[48];
size_t r0khid_len;
uint8_t r1khid[6];
@@ -228,6 +229,8 @@ void handshake_state_set_event_func(struct handshake_state *s,
void *user_data);
void handshake_state_set_passphrase(struct handshake_state *s,
const char *passphrase);
+void handshake_state_set_password_identifier(struct handshake_state *s,
+ const char *id);
bool handshake_state_add_ecc_sae_pt(struct handshake_state *s,
const struct l_ecc_point *pt);
void handshake_state_set_no_rekey(struct handshake_state *s, bool no_rekey);