aboutsummaryrefslogtreecommitdiff
path: root/lib/libostp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libostp')
-rw-r--r--lib/libostp/auth.c5
1 files changed, 5 insertions, 0 deletions
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 <unistd.h>
#include <stdlib.h>
#include <errno.h>
+#include <string.h>
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;
}