3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

handshake: add password identifier/setter

This commit is contained in:
James Prestwood 2023-12-05 07:46:40 -08:00 committed by Denis Kenzior
parent 62dad5e792
commit c1d40e2263
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -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);