X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcrypto.c;h=8792a341e0780c3515dcfe201e2ca41f32c8b444;hb=fb6f6fa4ec4e3277e30d84326d48e6850822d318;hp=9dd62118e32006be4dfefd6dc9d95d4bab6f61e8;hpb=a13d1d34c6f9bb9b2ffd448e177200151ce42e79;p=citadel.git diff --git a/webcit/crypto.c b/webcit/crypto.c index 9dd62118e..8792a341e 100644 --- a/webcit/crypto.c +++ b/webcit/crypto.c @@ -1,19 +1,13 @@ /* - * Copyright (c) 1996-2010 by the citadel.org team + * Copyright (c) 1996-2012 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 as - * published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. - * + * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -58,7 +52,7 @@ void shutdown_ssl(void) */ void init_ssl(void) { - SSL_METHOD *ssl_method; + const SSL_METHOD *ssl_method; RSA *rsa=NULL; X509_REQ *req = NULL; X509 *cer = NULL; @@ -391,7 +385,7 @@ void init_ssl(void) * starts SSL/TLS encryption for the current session. */ int starttls(int sock) { - int retval, bits, alg_bits, r; + int retval, bits, alg_bits;/*r; */ SSL *newssl; pthread_setspecific(ThreadSSL, NULL); @@ -421,7 +415,7 @@ int starttls(int sock) { errval = SSL_get_error(newssl, retval); ssl_error_reason = ERR_reason_error_string(ERR_get_error()); if (ssl_error_reason == NULL) { - syslog(3, "SSL_accept failed: errval=%i, retval=%i %s\n", errval, retval, strerror(errval)); + syslog(3, "SSL_accept failed: errval=%ld, retval=%d %s\n", errval, retval, strerror(errval)); } else { syslog(3, "SSL_accept failed: %s\n", ssl_error_reason); @@ -436,7 +430,7 @@ int starttls(int sock) { errval = SSL_get_error(newssl, retval); ssl_error_reason = ERR_reason_error_string(ERR_get_error()); if (ssl_error_reason == NULL) { - syslog(3, "SSL_accept failed: errval=%i, retval=%i (%s)\n", errval, retval, strerror(errval)); + syslog(3, "SSL_accept failed: errval=%ld, retval=%d (%s)\n", errval, retval, strerror(errval)); } else { syslog(3, "SSL_accept failed: %s\n", ssl_error_reason); @@ -448,7 +442,7 @@ int starttls(int sock) { else { syslog(15, "SSL_accept success\n"); } - r = BIO_set_close(newssl->rbio, BIO_NOCLOSE); + /*r = */BIO_set_close(newssl->rbio, BIO_NOCLOSE); bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(newssl), &alg_bits); syslog(15, "SSL/TLS using %s on %s (%d of %d bits)\n", SSL_CIPHER_get_name(SSL_get_current_cipher(newssl)), @@ -470,13 +464,13 @@ int starttls(int sock) { */ void endtls(void) { - SSL_CTX *ctx = NULL; + /*SSL_CTX *ctx;*/ if (THREADSSL == NULL) return; syslog(15, "Ending SSL/TLS\n"); SSL_shutdown(THREADSSL); - ctx = SSL_get_SSL_CTX(THREADSSL); + /*ctx = */SSL_get_SSL_CTX(THREADSSL); /* I don't think this is needed, and it crashes the server anyway *