From 26d596b7284d525f6aae60a1716679d3e9662c2e Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Thu, 31 Dec 2020 02:22:59 -0800 Subject: [PATCH] Log messages indicating AUTH TLS success or failure and set client prot Set the client protocol to "FTPS" upon successful TLS startup in the control connection (response to the AUTH TLS command from the client). Log some messages indicating FTPS was attempted or successful. --- src/sbbs3/ftpsrvr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index ec003933be..bf546b3985 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -1243,6 +1243,7 @@ static void receive_thread(void* arg) thread_down(); } +// Returns TRUE upon error?!? static BOOL start_tls(SOCKET *sock, CRYPT_SESSION *sess, BOOL resp) { BOOL nodelay; @@ -2707,13 +2708,18 @@ static void ctrl_thread(void* arg) sockprintf(sock,sess,"534 Already in TLS mode"); continue; } - if (start_tls(&sock, &sess, TRUE)) + if (start_tls(&sock, &sess, TRUE)) { + lprintf(LOG_WARNING, "%04d <%s> failed to initialize TLS successfully", sock, host_ip); break; + } user.number=0; sysop=FALSE; filepos=0; got_pbsz = FALSE; protection = FALSE; + lprintf(LOG_INFO, "%04d <%s> initialized TLS successfully", sock, host_ip); + client.protocol = "FTPS"; + client_on(sock, &client, /* update: */TRUE); continue; } sockprintf(sock,sess,"504 TLS is the only AUTH supported"); -- GitLab