From: Art Cancro Date: Wed, 22 May 2024 03:24:53 +0000 (+0000) Subject: Remove preprocessor tests for OpenSSL. It's a requirement. X-Git-Url: https://code.citadel.org/cgit.cgi/git.citadel.org/commit/?a=commitdiff_plain;h=HEAD;p=citadel.git Remove preprocessor tests for OpenSSL. It's a requirement. --- diff --git a/citadel/configure b/citadel/configure index ad136e3ac..381a2544c 100755 --- a/citadel/configure +++ b/citadel/configure @@ -74,7 +74,6 @@ int main(int argc, char **argv) { } ! $CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile >/dev/null 2>&1 && { - CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } || { echo Citadel Server requires OpenSSL which is not present. diff --git a/citadel/server/context.c b/citadel/server/context.c index 6415ce12a..81709b5b5 100644 --- a/citadel/server/context.c +++ b/citadel/server/context.c @@ -318,10 +318,7 @@ CitContext *CloneContext(CitContext *CloneMe) { me->MigrateBuf = NULL; me->sMigrateBuf = NULL; me->redirect_buffer = NULL; -#ifdef HAVE_OPENSSL me->ssl = NULL; -#endif - me->download_fp = NULL; me->upload_fp = NULL; me->ma = NULL; diff --git a/citadel/server/context.h b/citadel/server/context.h index d28dff7a7..1b207b645 100644 --- a/citadel/server/context.h +++ b/citadel/server/context.h @@ -56,10 +56,8 @@ struct CitContext { // Redirect this session's output to a memory buffer? StrBuf *redirect_buffer; // the buffer StrBuf *StatusMessage; -#ifdef HAVE_OPENSSL SSL *ssl; int redirect_ssl; -#endif char curr_user[USERNAME_SIZE]; // name of current user int logged_in; // logged in? diff --git a/citadel/server/modules/crypto/serv_crypto.c b/citadel/server/modules/crypto/serv_crypto.c index 5d41fa27c..541479af1 100644 --- a/citadel/server/modules/crypto/serv_crypto.c +++ b/citadel/server/modules/crypto/serv_crypto.c @@ -7,11 +7,9 @@ #include #include "../../sysdep.h" -#ifdef HAVE_OPENSSL #include #include #include -#endif #include @@ -32,8 +30,6 @@ #include "../../config.h" #include "../../ctdl_module.h" -#ifdef HAVE_OPENSSL - SSL_CTX *ssl_ctx = NULL; // This SSL context is used for all sessions. char *ssl_cipher_list = CIT_CIPHERS; @@ -609,5 +605,3 @@ void endtls(void) { CC->ssl = NULL; CC->redirect_ssl = 0; } - -#endif // HAVE_OPENSSL diff --git a/citadel/server/modules/crypto/serv_crypto.h b/citadel/server/modules/crypto/serv_crypto.h index b5ee85d53..4ef8033d5 100644 --- a/citadel/server/modules/crypto/serv_crypto.h +++ b/citadel/server/modules/crypto/serv_crypto.h @@ -7,7 +7,6 @@ // Which ciphers will be offered; see https://www.openssl.org/docs/manmaster/man1/ciphers.html #define CIT_CIPHERS "ALL:RC4+RSA:+SSLv2:+TLSv1:!MD5:@STRENGTH" -#ifdef HAVE_OPENSSL #define OPENSSL_NO_KRB5 /* work around redhat b0rken ssl headers */ void init_ssl(void); void client_write_ssl (const char *buf, int nbytes); @@ -19,5 +18,3 @@ void cmd_gtls(char *params); void endtls(void); void CtdlStartTLS(char *ok_response, char *nosup_response, char *error_response); extern SSL_CTX *ssl_ctx; - -#endif diff --git a/citadel/server/modules/ctdlproto/serv_ctdlproto.c b/citadel/server/modules/ctdlproto/serv_ctdlproto.c index ae267b596..d5e7ffe61 100644 --- a/citadel/server/modules/ctdlproto/serv_ctdlproto.c +++ b/citadel/server/modules/ctdlproto/serv_ctdlproto.c @@ -1,72 +1,56 @@ -/* - * Citadel protocol main dispatcher - * - * Copyright (c) 1987-2017 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Citadel protocol main dispatcher +// Copyright (c) 1987-2024 by the citadel.org team +// This program is open source software. Use, duplication, or disclosure are subject to the GNU General Public License v3. #include #include - #include "../../citserver.h" #include "../../ctdl_module.h" #include "../../config.h" -/* - * This loop recognizes all server commands. - */ + +// This loop recognizes all server commands. void do_command_loop(void) { - struct CitContext *CCC = CC; char cmdbuf[SIZ]; - time(&CCC->lastcmd); - memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */ + time(&CC->lastcmd); + memset(cmdbuf, 0, sizeof cmdbuf); // Clear it, just in case if (client_getln(cmdbuf, sizeof cmdbuf) < 1) { syslog(LOG_INFO, "Citadel client disconnected: ending session."); - CCC->kill_me = KILLME_CLIENT_DISCONNECTED; + CC->kill_me = KILLME_CLIENT_DISCONNECTED; return; } - /* Log the server command, but don't show passwords... */ - if ( (strncasecmp(cmdbuf, "PASS", 4)) && (strncasecmp(cmdbuf, "SETP", 4)) ) { - syslog(LOG_DEBUG, "[%s(%ld)] %s", - CCC->curr_user, CCC->user.usernum, cmdbuf - ); + // Log the server command, but don't show passwords... + if ( (strncasecmp(cmdbuf, "PASS", 4)) + && (strncasecmp(cmdbuf, "SETP", 4)) + ) { + syslog(LOG_DEBUG, "[%s(%ld)] %s", CC->curr_user, CC->user.usernum, cmdbuf); } else { - syslog(LOG_DEBUG, "[%s(%ld)]