X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a63be306e4bcb803e7aa3ab673a2e1d867adaaba..f64a1e235f8579c91d6ea0275d7d97e7a958709b:/src/src/tls-openssl.c diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index a9adb6134..b7b2f8847 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -1137,37 +1137,9 @@ construct_cipher_name(SSL *ssl, uschar *cipherbuf, int bsize, int *bits) yet reflect that. It should be a safe change anyway, even 0.9.8 versions have the accessor functions use const in the prototype. */ const SSL_CIPHER *c; -uschar *ver; +const uschar *ver; -switch (ssl->session->ssl_version) - { - case SSL2_VERSION: - ver = US"SSLv2"; - break; - - case SSL3_VERSION: - ver = US"SSLv3"; - break; - - case TLS1_VERSION: - ver = US"TLSv1"; - break; - -#ifdef TLS1_1_VERSION - case TLS1_1_VERSION: - ver = US"TLSv1.1"; - break; -#endif - -#ifdef TLS1_2_VERSION - case TLS1_2_VERSION: - ver = US"TLSv1.2"; - break; -#endif - - default: - ver = US"UNKNOWN"; - } +ver = (const uschar *)SSL_get_version(ssl); c = (const SSL_CIPHER *) SSL_get_current_cipher(ssl); SSL_CIPHER_get_bits(c, bits); @@ -1951,6 +1923,11 @@ one version of OpenSSL but the run-time linker picks up another version, it can result in serious failures, including crashing with a SIGSEGV. So report the version found by the compiler and the run-time version. +Note: some OS vendors backport security fixes without changing the version +number/string, and the version date remains unchanged. The _build_ date +will change, so we can more usefully assist with version diagnosis by also +reporting the build date. + Arguments: a FILE* to print the results to Returns: nothing */ @@ -1959,9 +1936,13 @@ void tls_version_report(FILE *f) { fprintf(f, "Library version: OpenSSL: Compile: %s\n" - " Runtime: %s\n", + " Runtime: %s\n" + " : %s\n", OPENSSL_VERSION_TEXT, - SSLeay_version(SSLEAY_VERSION)); + SSLeay_version(SSLEAY_VERSION), + SSLeay_version(SSLEAY_BUILT_ON)); +/* third line is 38 characters for the %s and the line is 73 chars long; +the OpenSSL output includes a "built on: " prefix already. */ }