X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/ef57b25bfa7623c3f8a8e65f927165c4ddc7c43b..f5730918ef684baafbd9e606a1d4eb06914563cc:/src/src/tls.c diff --git a/src/src/tls.c b/src/src/tls.c index 76e72b5f5..4a23aaae9 100644 --- a/src/src/tls.c +++ b/src/src/tls.c @@ -5,6 +5,7 @@ /* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* 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 @@ -156,7 +157,7 @@ for (unsigned loop = 20; if (--loop == 0) { errno = ELOOP; return FALSE; } filename = buf[0] == '/' ? string_copyn(buf, (unsigned)len) /* mem released by tls_set_watch */ - : string_sprintf("%.*s/%.*s", (int)(s - filename), (int)len); + : string_sprintf("%.*s/%.*s", (int)(s - filename), filename, (int)len, buf); s = Ustrrchr(filename, '/'); } if (errno != EINVAL) @@ -361,6 +362,8 @@ tls_watch_invalidate(); #endif tls_server_creds_invalidate(); + +/* _expire is for a time-limited selfsign server cert */ tls_creds_expire = (lifetime = tls_server_creds_init()) ? time(NULL) + lifetime : 0;