ssl_ctx = SSL_CTX_new(SSLv23_server_method()) instead of using a temporary variable...
authorArt Cancro <ajc@citadel.org>
Fri, 7 Jan 2022 16:38:19 +0000 (11:38 -0500)
committerArt Cancro <ajc@citadel.org>
Fri, 7 Jan 2022 16:38:19 +0000 (11:38 -0500)
citadel/modules/crypto/serv_crypto.c
citadel/server.h
webcit-ng/tls.c
webcit/crypto.c

index 302be080e427ec3d00c5e1653daeba6aa89c6674..cbb190cde857e987a76c0b3a87a22622aec3ec9b 100644 (file)
@@ -133,7 +133,6 @@ void update_key_and_cert_if_needed(void) {
 
 
 void init_ssl(void) {
-       const SSL_METHOD *ssl_method;
        RSA *rsa = NULL;
        X509_REQ *req = NULL;
        X509 *cer = NULL;
@@ -145,8 +144,7 @@ void init_ssl(void) {
        // Initialize SSL transport layer
        SSL_library_init();
        SSL_load_error_strings();
-       ssl_method = SSLv23_server_method();
-       if (!(ssl_ctx = SSL_CTX_new(ssl_method))) {
+       if (!(ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
                syslog(LOG_ERR, "crypto: SSL_CTX_new failed: %s", ERR_reason_error_string(ERR_get_error()));
                return;
        }
index ef7b4aa84e0eb3fadfe8912159039df030b04d8b..f0af5c6475d81931721e604755f41c2416c747bd 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main declarations file for the Citadel server
  *
- * Copyright (c) 1987-2020 by the citadel.org team
+ * Copyright (c) 1987-2022 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.
@@ -155,6 +155,7 @@ enum {
        S_SINGLE_USER,
        S_LDAP,
        S_IM_LOGS,
+       S_OPENSSL,
        MAX_SEMAPHORES
 };
 
index 988ac2541722b44b83afb2912833905f78bb37ad..b82f8b34ffedcae7980c1be09a0eba58a6b0392d 100644 (file)
@@ -44,7 +44,6 @@ void bind_to_key_and_certificate(void) {
 
 // Initialize ssl engine, load certs and initialize openssl internals
 void init_ssl(void) {
-       const SSL_METHOD *ssl_method;
        RSA *rsa = NULL;
        X509_REQ *req = NULL;
        X509 *cer = NULL;
@@ -58,8 +57,7 @@ void init_ssl(void) {
        // Initialize SSL transport layer
        SSL_library_init();
        SSL_load_error_strings();
-       ssl_method = SSLv23_server_method();
-       if (!(ssl_ctx = SSL_CTX_new(ssl_method))) {
+       if (!(ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
                syslog(LOG_WARNING, "SSL_CTX_new failed: %s", ERR_reason_error_string(ERR_get_error()));
                return;
        }
index bd08639026d7e721bcd284ac8ec7fa1955820f2f..971d1e06bf0a2c0d3080ef0430b10aace51c9360 100644 (file)
@@ -50,7 +50,6 @@ void bind_to_key_and_certificate(void) {
 
 // initialize ssl engine, load certs and initialize openssl internals
 void init_ssl(void) {
-       const SSL_METHOD *ssl_method;
 
 #ifndef OPENSSL_NO_EGD
        if (!access("/var/run/egd-pool", F_OK)) {
@@ -66,8 +65,7 @@ void init_ssl(void) {
        // Initialize SSL transport layer
        SSL_library_init();
        SSL_load_error_strings();
-       ssl_method = SSLv23_server_method();
-       if (!(ssl_ctx = SSL_CTX_new(ssl_method))) {
+       if (!(ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
                syslog(LOG_WARNING, "SSL_CTX_new failed: %s", ERR_reason_error_string(ERR_get_error()));
                return;
        }