From fe5120087d24cdd07ef65d85f60eb11f4ae12cf2 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 3 Oct 2024 21:18:12 -0500 Subject: lib: auth: Keep track of username Signed-off-by: Ian Moffett --- lib/libostp/auth.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libostp') diff --git a/lib/libostp/auth.c b/lib/libostp/auth.c index 5d69009..559e3b3 100644 --- a/lib/libostp/auth.c +++ b/lib/libostp/auth.c @@ -37,6 +37,7 @@ #include #include #include +#include struct session_td_args { struct ostp_client *c; @@ -79,6 +80,7 @@ passwd_auth(struct ostp_client *c, const unsigned char *session_key) { int error; struct session_auth auth; + struct ostp_session *session; const size_t LEN = sizeof(auth); if (!REQUIRE_USER_AUTH) { @@ -106,6 +108,9 @@ passwd_auth(struct ostp_client *c, const unsigned char *session_key) printf("Failed to ACK user authentication with frame\n"); return error; } + + session = &c->session; + memcpy(session->username, auth.username, sizeof(auth.username)); return 0; } -- cgit v1.2.3