X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/3386088d5af4d4c61faa12ae29560e2c5bd43304..dcd037631f32cdaed817d40ac086f4d933f51bd0:/src/src/tls.c diff --git a/src/src/tls.c b/src/src/tls.c index 6b1a189a9..f34cf6321 100644 --- a/src/src/tls.c +++ b/src/src/tls.c @@ -2,13 +2,13 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2015 */ +/* Copyright (c) University of Cambridge 1995 - 2016 */ /* See the file NOTICE for conditions of use and distribution. */ /* This module provides TLS (aka SSL) support for Exim. The code for OpenSSL is based on a patch that was originally contributed by Steve Haslam. It was adapted from stunnel, a GPL program by Michal Trojnara. The code for GNU TLS is -based on a patch contributed by Nikos Mavroyanopoulos. Because these packages +based on a patch contributed by Nikos Mavrogiannopoulos. Because these packages are so very different, the functions for each are kept in separate files. The relevant file is #included as required, after any any common functions. @@ -87,19 +87,20 @@ return TRUE; static uschar * to_tz(uschar * tz) { - uschar * old = US getenv("TZ"); - setenv("TZ", CS tz, 1); - tzset(); - return old; +uschar * old = US getenv("TZ"); +(void) setenv("TZ", CCS tz, 1); +tzset(); +return old; } + static void restore_tz(uschar * tz) { - if (tz) - setenv("TZ", CS tz, 1); - else - unsetenv("TZ"); - tzset(); +if (tz) + (void) setenv("TZ", CCS tz, 1); +else + (void) os_unsetenv(US"TZ"); +tzset(); } /************************************************* @@ -107,18 +108,18 @@ restore_tz(uschar * tz) *************************************************/ #ifdef USE_GNUTLS -#include "tls-gnu.c" -#include "tlscert-gnu.c" +# include "tls-gnu.c" +# include "tlscert-gnu.c" -#define ssl_xfer_buffer (state_server.xfer_buffer) -#define ssl_xfer_buffer_lwm (state_server.xfer_buffer_lwm) -#define ssl_xfer_buffer_hwm (state_server.xfer_buffer_hwm) -#define ssl_xfer_eof (state_server.xfer_eof) -#define ssl_xfer_error (state_server.xfer_error) +# define ssl_xfer_buffer (state_server.xfer_buffer) +# define ssl_xfer_buffer_lwm (state_server.xfer_buffer_lwm) +# define ssl_xfer_buffer_hwm (state_server.xfer_buffer_hwm) +# define ssl_xfer_eof (state_server.xfer_eof) +# define ssl_xfer_error (state_server.xfer_error) #else -#include "tls-openssl.c" -#include "tlscert-openssl.c" +# include "tls-openssl.c" +# include "tlscert-openssl.c" #endif