diff options
Diffstat (limited to 'lib/libostp/session.c')
-rw-r--r-- | lib/libostp/session.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libostp/session.c b/lib/libostp/session.c index 151cad9..7087cc7 100644 --- a/lib/libostp/session.c +++ b/lib/libostp/session.c @@ -63,7 +63,7 @@ static const char *auth_codestr[] = { }; static int -send_auth(int sockfd, const unsigned char *session_key) +send_auth(int sockfd, const unsigned char *session_key, struct ostp_session *s) { struct session_auth auth; struct termios oldt, newt; @@ -129,6 +129,7 @@ send_auth(int sockfd, const unsigned char *session_key) return -1; } + memcpy(s->username, auth.username, sizeof(auth.username)); return 0; } @@ -260,7 +261,7 @@ session_new(const char *host, struct ostp_session *res) gen_session_key(keypair.privkey, serv_pubkey, &session_key); /* User authentication occurs before sending SPWs */ - if ((error = send_auth(sockfd, session_key)) < 0) { + if ((error = send_auth(sockfd, session_key, res)) < 0) { return error; } |