Remove preprocessor tests for OpenSSL. It's a requirement. master
authorArt Cancro <ajc@citadel.org>
Wed, 22 May 2024 03:24:53 +0000 (03:24 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 22 May 2024 03:24:53 +0000 (03:24 +0000)
15 files changed:
citadel/configure
citadel/server/context.c
citadel/server/context.h
citadel/server/modules/crypto/serv_crypto.c
citadel/server/modules/crypto/serv_crypto.h
citadel/server/modules/ctdlproto/serv_ctdlproto.c
citadel/server/modules/imap/serv_imap.c
citadel/server/modules/nntp/serv_nntp.c
citadel/server/modules/pop3/serv_pop3.c
citadel/server/modules/smtp/serv_smtp.c
citadel/server/modules/xmpp/serv_xmpp.c
citadel/server/modules/xmpp/xmpp_queue.c
citadel/server/serv_extensions.c
citadel/server/server.h
citadel/server/sysdep.c

index ad136e3ac1b2ed79061c1688d1e648c2efc7e43b..381a2544c14090f781953154938489a6bf6ab279 100755 (executable)
@@ -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.
index 6415ce12abd290ea52e8d846fd4dc252701195a3..81709b5b59e81ee0056bb9301df2f149e1953e33 100644 (file)
@@ -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;
index d28dff7a7f59dadf481957b5bf65d9c8947c7245..1b207b64527b9a5349ea812ec26fe641f79c0370 100644 (file)
@@ -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?
index 5d41fa27c924817cb29cc58c517417ba7daf996c..541479af14c73f4848cc789b46fd27a80f30470d 100644 (file)
@@ -7,11 +7,9 @@
 #include <sys/types.h>
 #include "../../sysdep.h"
 
-#ifdef HAVE_OPENSSL
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
-#endif
 
 #include <time.h>
 
@@ -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
index b5ee85d53bd970058333422d20ce73e017134254..4ef8033d531d393b5220858171f9a48198a9e2b8 100644 (file)
@@ -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
index ae267b596fc5645f1a662b159c87066f32a803c3..d5e7ffe61b0c1bf8a634a9d2acec5fe7f2207f43 100644 (file)
@@ -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 <stdio.h>
 #include <libcitadel.h>
-
 #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)] <password command hidden from log>",
-                           CCC->curr_user, CCC->user.usernum
-               );
+               syslog(LOG_DEBUG, "[%s(%ld)] <password command hidden from log>", CC->curr_user, CC->user.usernum);
        }
 
        buffer_output();
 
-       /*
-        * Let other clients see the last command we executed, and
-        * update the idle time, but not NOOP, QNOP, PEXP, GEXP, RWHO, or TIME.
-        */
-       if ( (strncasecmp(cmdbuf, "NOOP", 4))
-          && (strncasecmp(cmdbuf, "QNOP", 4))
-          && (strncasecmp(cmdbuf, "PEXP", 4))
-          && (strncasecmp(cmdbuf, "GEXP", 4))
-          && (strncasecmp(cmdbuf, "RWHO", 4))
-          && (strncasecmp(cmdbuf, "TIME", 4)) ) {
-               strcpy(CCC->lastcmdname, "    ");
-               safestrncpy(CCC->lastcmdname, cmdbuf, sizeof(CCC->lastcmdname));
-               time(&CCC->lastidle);
+       // Let other clients see the last command we executed, and
+       // update the idle time, but not NOOP, QNOP, PEXP, GEXP, RWHO, or TIME.
+       if (    (strncasecmp(cmdbuf, "NOOP", 4))
+               && (strncasecmp(cmdbuf, "QNOP", 4))
+               && (strncasecmp(cmdbuf, "PEXP", 4))
+               && (strncasecmp(cmdbuf, "GEXP", 4))
+               && (strncasecmp(cmdbuf, "RWHO", 4))
+               && (strncasecmp(cmdbuf, "TIME", 4))
+       ) {
+               strcpy(CC->lastcmdname, "    ");
+               safestrncpy(CC->lastcmdname, cmdbuf, sizeof(CC->lastcmdname));
+               time(&CC->lastidle);
        }
        
-       if ((strncasecmp(cmdbuf, "ENT0", 4))
-          && (strncasecmp(cmdbuf, "MESG", 4))
-          && (strncasecmp(cmdbuf, "MSGS", 4)))
-       {
-          CCC->cs_flags &= ~CS_POSTING;
+       if (    (strncasecmp(cmdbuf, "ENT0", 4))
+               && (strncasecmp(cmdbuf, "MESG", 4))
+               && (strncasecmp(cmdbuf, "MSGS", 4))
+       {
+               CC->cs_flags &= ~CS_POSTING;
        }
                   
        if (!DLoader_Exec_Cmd(cmdbuf)) {
@@ -75,7 +59,7 @@ void do_command_loop(void) {
 
        unbuffer_output();
 
-       /* Run any after-each-command routines registered by modules */
+       // Run any after-each-command routines registered by modules
        PerformSessionHooks(EVT_CMD);
 }
 
index d55971bb5f76de414b88cd4122b3bf9ad3ea2d8a..b9d2a41af95b0efdaef904e38f40b740718a4e32 100644 (file)
@@ -429,9 +429,7 @@ void imap_cleanup_function(void) {
 void imap_output_capability_string(void) {
        IAPuts("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=PLAIN AUTH=LOGIN UIDPLUS");
 
-#ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) IAPuts(" STARTTLS");
-#endif
 
 #ifndef DISABLE_IMAP_ACL
        IAPuts(" ACL");
@@ -516,9 +514,7 @@ void imap_greeting(void) {
  */
 void imaps_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
-#ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO;          /* kill session if no crypto */
-#endif
        imap_greeting();
 }
 
@@ -1544,9 +1540,7 @@ char *ctdl_module_init_imap(void) {
        RegisterImapCMD("LOGIN", "", imap_login, I_FLAG_NONE);
        RegisterImapCMD("AUTHENTICATE", "", imap_authenticate, I_FLAG_NONE);
        RegisterImapCMD("CAPABILITY", "", imap_capability, I_FLAG_NONE);
-#ifdef HAVE_OPENSSL
        RegisterImapCMD("STARTTLS", "", imap_starttls, I_FLAG_NONE);
-#endif
 
        /* The commans below require a logged-in state */
        RegisterImapCMD("SELECT", "", imap_select, I_FLAG_LOGGED_IN);
@@ -1584,9 +1578,7 @@ char *ctdl_module_init_imap(void) {
 
        if (!threading) {
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP);
-#ifdef HAVE_OPENSSL
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_imaps_port"), NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
-#endif
                CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30);
        }
        
index 4c581db632432c11313da844022969afb446807d..231b694cddb1c8a310767d4794e1219669169ee8 100644 (file)
@@ -175,9 +175,7 @@ void nntp_greeting(void) {
 // NNTPS is just like NNTP, except it goes crypto right away.
 void nntps_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
-#ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO;          // kill session if no crypto
-#endif
        nntp_greeting();
 }
 
@@ -204,9 +202,7 @@ void nntp_capabilities(void) {
        cprintf("MODE-READER\r\n");
        cprintf("LIST ACTIVE NEWSGROUPS\r\n");
        cprintf("OVER\r\n");
-#ifdef HAVE_OPENSSL
        cprintf("STARTTLS\r\n");
-#endif
        if (!CC->logged_in) {
                cprintf("AUTHINFO USER\r\n");
        }
@@ -1070,14 +1066,12 @@ char *ctdl_module_init_nntp(void) {
                                        NULL, 
                                        CitadelServiceNNTP);
 
-#ifdef HAVE_OPENSSL
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_nntps_port"),
                                        NULL,
                                        nntps_greeting,
                                        nntp_command_loop,
                                        NULL,
                                        CitadelServiceNNTPS);
-#endif
 
                CtdlRegisterSessionHook(nntp_cleanup_function, EVT_STOP, PRIO_STOP + 250);
        }
index 322f2d826038834c47f55d21ef714339a75c98e9..d624cfe9e07ebf749efb40e488e42b3f2e04f84a 100644 (file)
 #include "../../ctdl_module.h"
 
 
-// This cleanup function blows away the temporary memory and files used by
-// the POP3 server.
+// This cleanup function blows away the temporary memory and files used by the POP3 server.
 void pop3_cleanup_function(void) {
-       /* Don't do this stuff if this is not a POP3 session! */
+       // Don't do this stuff if this is not a POP3 session!
        if (CC->h_command_function != pop3_command_loop) return;
 
        struct citpop3 *pop3 = ((struct citpop3 *)CC->session_specific_data);
@@ -78,13 +77,10 @@ void pop3_greeting(void) {
 void pop3s_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
 
-/* kill session if no crypto */
-#ifdef HAVE_OPENSSL
-       if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO;
-#else
-       CC->kill_me = KILLME_NO_CRYPTO;
-#endif
-
+       // kill the session if TLS is not running by now
+       if (!CC->redirect_ssl) {
+               CC->kill_me = KILLME_NO_CRYPTO;
+       }
        pop3_greeting();
 }
 
@@ -149,10 +145,10 @@ int pop3_grab_mailbox(void) {
 
        if (CtdlGetRoom(&CC->room, MAILROOM) != 0) return(-1);
 
-       /* Load up the messages */
+       // Load up the messages
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, pop3_add_message, NULL);
 
-       /* Figure out which are old and which are new */
+       // Figure out which are old and which are new
         CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
        POP3->lastseen = (-1);
        if (POP3->num_msgs) for (i=0; i<POP3->num_msgs; ++i) {
@@ -516,11 +512,9 @@ void pop3_command_loop(void) {
                pop3_pass(&cmdbuf[5]);
        }
 
-#ifdef HAVE_OPENSSL
        else if (!strncasecmp(cmdbuf, "STLS", 4)) {
                pop3_stls();
        }
-#endif
 
        else if (!CC->logged_in) {
                cprintf("-ERR Not logged in.\r\n");
@@ -582,17 +576,15 @@ char *ctdl_module_init_pop3(void) {
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3);
-#ifdef HAVE_OPENSSL
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3s_port"),
                                        NULL,
                                        pop3s_greeting,
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3S);
-#endif
                CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP, PRIO_STOP + 30);
        }
        
-       /* return our module name for the log */
+       // return our module name for the log
        return "pop3";
 }
index b153207567cbf0aebb36357624d57e7cb2fe5b0d..9ecf144b1a6601a802fa1502a0b631f30ca387f0 100644 (file)
@@ -134,9 +134,9 @@ void smtp_greeting(int is_msa) {
 // SMTPS is just like SMTP, except it goes crypto right away.
 void smtps_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
-#ifdef HAVE_OPENSSL
-       if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO;          // kill session if no crypto
-#endif
+       if (!CC->redirect_ssl) {
+               CC->kill_me = KILLME_NO_CRYPTO;         // kill session if no crypto
+       }
        smtp_greeting(0);
 }
 
@@ -214,7 +214,6 @@ void smtp_hello(int which_command) {
                cprintf("250-HELP\r\n");
                cprintf("250-SIZE %ld\r\n", CtdlGetConfigLong("c_maxmsglen"));
 
-#ifdef HAVE_OPENSSL
                // Offer the STARTTLS option...
                if (    (!CC->redirect_ssl)                                                     // not if we're already TLS
                        && (    (SMTP->is_msa)                                                  // Always on port 587
@@ -223,7 +222,6 @@ void smtp_hello(int which_command) {
                ) {
                        cprintf("250-STARTTLS\r\n");
                }
-#endif
 
                cprintf("250-AUTH LOGIN PLAIN\r\n"
                        "250-AUTH=LOGIN PLAIN\r\n"
@@ -964,12 +962,10 @@ void smtp_command_loop(void) {
                smtp_rcpt();
                return;
        }
-#ifdef HAVE_OPENSSL
        if (!strncasecmp(ChrPtr(SMTP->Cmd), "STARTTLS", 8)) {
                smtp_starttls();
                return;
        }
-#endif
 
        cprintf("502 I'm afraid I can't do that.\r\n");
 }
@@ -1015,14 +1011,12 @@ char *ctdl_module_init_smtp(void) {
                                        NULL, 
                                        CitadelServiceSMTP_MTA);
 
-#ifdef HAVE_OPENSSL
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_smtps_port"),       // SMTPS MTA
                                        NULL,
                                        smtps_greeting,
                                        smtp_command_loop,
                                        NULL,
                                        CitadelServiceSMTPS_MTA);
-#endif
 
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_msa_port"),         // SMTP MSA
                                        NULL,
index 9dacbffad865639f8172a470fb4f24ba723d9d74..81b239c90ab4eebf71d8f0f5fd9483eae971b8eb 100644 (file)
@@ -192,11 +192,9 @@ void xmpp_stream_start(void *data, const char *supplied_el, const char **attr)
        /*
         * TLS encryption (but only if it isn't already active)
         */ 
-#ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) {
                cprintf("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'></starttls>");
        }
-#endif
 
        if (!CC->logged_in) {
                /* If we're not logged in yet, offer SASL as our feature set */
@@ -487,14 +485,9 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
        }
 
        else if (!strcasecmp(el, "starttls")) {
-#ifdef HAVE_OPENSSL
                cprintf("<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
                CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
                if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO;
-#else
-               cprintf("<failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
-               CC->kill_me = KILLME_NO_CRYPTO;
-#endif
        }
 
        else if (!strcasecmp(el, "ping")) {
index d1929a22689810954e42930329098c8d28cc3c9d..f52a6e26f3fb48c3f530a4c0e476bace18d9db11 100644 (file)
@@ -1,16 +1,6 @@
-/*
- * XMPP event queue
- *
- * Copyright (c) 2007-2021 by Art Cancro
- *
- * 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.
- */
+// XMPP event queue
+// Copyright (c) 2007-2024 by Art Cancro
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License v3.
 
 #include "../../sysdep.h"
 #include <stdlib.h>
@@ -49,7 +39,7 @@ void xmpp_queue_event(int event_type, char *email_addr) {
 
        syslog(LOG_DEBUG, "xmpp: xmpp_queue_event(%d, %s)", event_type, email_addr);
 
-       /* Purge events more than a minute old */
+       // Purge events more than a minute old
        begin_critical_section(S_XMPP_QUEUE);
        do {
                purged_something = 0;
@@ -64,7 +54,7 @@ void xmpp_queue_event(int event_type, char *email_addr) {
        } while(purged_something);
        end_critical_section(S_XMPP_QUEUE);
 
-       /* Create a new event */
+       // Create a new event
        new_event = (struct xmpp_event *) malloc(sizeof(struct xmpp_event));
        new_event->next = NULL;
        new_event->event_time = time(NULL);
@@ -73,7 +63,7 @@ void xmpp_queue_event(int event_type, char *email_addr) {
        new_event->session_which_generated_this_event = CC->cs_pid;
        safestrncpy(new_event->event_jid, email_addr, sizeof new_event->event_jid);
 
-       /* Add it to the list */
+       // Add it to the list
        begin_critical_section(S_XMPP_QUEUE);
        if (xmpp_queue == NULL) {
                xmpp_queue = new_event;
@@ -88,7 +78,7 @@ void xmpp_queue_event(int event_type, char *email_addr) {
        }
        end_critical_section(S_XMPP_QUEUE);
 
-       /* Tell the sessions that something is happening */
+       // Tell the sessions that something is happening
        begin_critical_section(S_SESSION_TABLE);
        for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
                if ((cptr->logged_in) && (cptr->h_async_function == xmpp_async_loop)) {
@@ -99,15 +89,13 @@ void xmpp_queue_event(int event_type, char *email_addr) {
 }
 
 
-/* 
- * Are we interested in anything from the queue?  (Called in async loop)
- */
+// Are we interested in anything from the queue?  (Called in async loop)
 void xmpp_process_events(void) {
        struct xmpp_event *xptr = NULL;
        int highest_event = 0;
 
        for (xptr=xmpp_queue; xptr!=NULL; xptr=xptr->next) {
-               if (xptr->event_seq > XMPP->last_event_processed) {             // we are getting crashes on this line?
+               if (xptr->event_seq > XMPP->last_event_processed) {
 
                        switch(xptr->event_type) {
 
index 8787beae805027c94b5d7336cea1e755473ea8dc..260bd8dc23a6bb994fd04b9348bf4d16e0f8dd25 100644 (file)
@@ -526,9 +526,7 @@ int PerformXmsgHooks(char *sender, char *sender_email, char *recp, char *msg) {
 
 // "Start TLS" function that is (hopefully) adaptable for any protocol
 void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *error_response) {
-#ifdef HAVE_OPENSSL
        CtdlStartTLS (ok_response, nosup_response, error_response);
-#endif
 }
 
 
index 8d1f7d0ff3bbf99c93e9bfa5895d407dc53e286b..24833b737cd9bd881e8e68245c8025211f932f58 100644 (file)
 #endif
 
 #include "citadel_defs.h"
-#ifdef HAVE_OPENSSL
 #define OPENSSL_NO_KRB5                        // work around redhat b0rken ssl headers
 #include <openssl/ssl.h>
-#endif
 
 
 // New format for a message in memory
index 58f94624dfd5b07cf01c60465c48b6a7dcc4f281..6f3209468c2298bd91fe03fedd9cad74d7713166 100644 (file)
@@ -69,9 +69,7 @@ void init_sysdep(void) {
 #endif
 
        // If we've got OpenSSL, we're going to use it.
-#ifdef HAVE_OPENSSL
        init_ssl();
-#endif
 
        if (pthread_key_create(&MyConKey, NULL) != 0) {                         // TSD for sessions
                syslog(LOG_CRIT, "sysdep: can't create TSD key: %m");
@@ -252,19 +250,17 @@ static unsigned on = 1, off = 0;
 
 void buffer_output(void) {
 #ifdef HAVE_TCP_BUFFERING
-#ifdef HAVE_OPENSSL
-       if (!CC->redirect_ssl)
-#endif
+       if (!CC->redirect_ssl) {
                setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &on, 4);
+       }
 #endif
 }
 
 void unbuffer_output(void) {
 #ifdef HAVE_TCP_BUFFERING
-#ifdef HAVE_OPENSSL
-       if (!CC->redirect_ssl)
-#endif
+       if (!CC->redirect_ssl) {
                setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &off, 4);
+       }
 #endif
 }
 
@@ -305,12 +301,10 @@ int client_write(const char *buf, int nbytes) {
                return 0;
        }
 
-#ifdef HAVE_OPENSSL
        if (Ctx->redirect_ssl) {
                client_write_ssl(buf, nbytes);
                return 0;
        }
-#endif
        if (Ctx->client_socket == -1) return -1;
 
        fdflags = fcntl(Ctx->client_socket, F_GETFL);
@@ -397,16 +391,13 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout) {
        const char *Error;
        int retval = 0;
 
-#ifdef HAVE_OPENSSL
        if (CC->redirect_ssl) {
                retval = client_read_sslblob(Target, bytes, timeout);
                if (retval < 0) {
                        syslog(LOG_ERR, "sysdep: client_read_blob() failed");
                }
        }
-       else 
-#endif
-       {
+       else {
                retval = StrBufReadBLOBBuffered(Target, 
                                                CC->RecvBuf.Buf,
                                                &CC->RecvBuf.ReadWritePointer,
@@ -505,14 +496,11 @@ int CtdlClientGetLine(StrBuf *Target) {
        int rc;
 
        FlushStrBuf(Target);
-#ifdef HAVE_OPENSSL
        if (CC->redirect_ssl) {
                rc = client_readline_sslbuffer(Target, CC->RecvBuf.Buf, &CC->RecvBuf.ReadWritePointer, 1);
                return rc;
        }
-       else 
-#endif
-       {
+       else {
                rc = StrBufTCP_read_buffered_line_fast(Target, 
                                                       CC->RecvBuf.Buf,
                                                       &CC->RecvBuf.ReadWritePointer,