From: Timo Sirainen Date: Mon, 28 Sep 2009 15:11:54 +0000 (-0400) Subject: login: ssl_security string now also shows the used compression. X-Git-Tag: 2.0.alpha1~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65c0c74c6c7214ec65481244451b6e8667949294;p=thirdparty%2Fdovecot%2Fcore.git login: ssl_security string now also shows the used compression. --HG-- branch : HEAD --- diff --git a/src/login-common/ssl-proxy-openssl.c b/src/login-common/ssl-proxy-openssl.c index 76dab6ce6f..fa210f02d4 100644 --- a/src/login-common/ssl-proxy-openssl.c +++ b/src/login-common/ssl-proxy-openssl.c @@ -667,17 +667,22 @@ const char *ssl_proxy_get_last_error(const struct ssl_proxy *proxy) const char *ssl_proxy_get_security_string(struct ssl_proxy *proxy) { SSL_CIPHER *cipher; + const COMP_METHOD *comp; int bits, alg_bits; + const char *comp_str; if (!proxy->handshaked) return ""; cipher = SSL_get_current_cipher(proxy->ssl); bits = SSL_CIPHER_get_bits(cipher, &alg_bits); - return t_strdup_printf("%s with cipher %s (%d/%d bits)", + comp = SSL_get_current_compression(proxy->ssl); + comp_str = comp == NULL ? "" : + t_strconcat(" ", SSL_COMP_get_name(comp), NULL); + return t_strdup_printf("%s with cipher %s (%d/%d bits)%s", SSL_get_version(proxy->ssl), SSL_CIPHER_get_name(cipher), - bits, alg_bits); + bits, alg_bits, comp_str); } void ssl_proxy_free(struct ssl_proxy **_proxy)