From f87a983a8312da4995133ad69b020579c621a99b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 21 Feb 2025 18:36:43 -0500 Subject: auth: Remove session thread Signed-off-by: Ian Moffett --- lib/libostp/auth.c | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/lib/libostp/auth.c b/lib/libostp/auth.c index c1489d4..aee8409 100644 --- a/lib/libostp/auth.c +++ b/lib/libostp/auth.c @@ -84,7 +84,7 @@ pwcheck(char *username, char *pw) } static int -passwd_auth(struct ostp_client *c, const unsigned char *session_key) +passwd_auth(struct ostp_client *c, struct ostp_listener *lp, const unsigned char *session_key) { int error; struct session_auth auth; @@ -133,33 +133,6 @@ send_motd(struct ostp_client *c, const unsigned char *session_key) } } -static void * -session_td(void *args) -{ - struct session_td_args *tmp = args; - int error; - - /* Try user auth, not needed if REQUIRE_USER_AUTH is 0 */ - if (passwd_auth(tmp->c, tmp->session_key) != 0) { - free_session_key(tmp->session_key); - return NULL; - } - - /* Handle any requested session parameters */ - if ((error = negotiate_spw(tmp->c, tmp->session_key)) < 0) { - free_session_key(tmp->session_key); - return NULL; - } - - send_motd(tmp->c, tmp->session_key); - tmp->c->authed = 1; - free(args); - return NULL; -#endif - - return NULL; -} - int handle_srq(struct ostp_client *c, struct ostp_listener *lp, struct session_request *srq) { @@ -204,12 +177,6 @@ handle_srq(struct ostp_client *c, struct ostp_listener *lp, struct session_reque return errno; } - sargs->c = c; - sargs->lp = lp; - sargs->session_key = session->session_key; - error = pthread_create(&c->td, NULL, session_td, sargs); - if (error != 0) { - return error; } g_have_link = true; -- cgit v1.2.3