From 1fa9630fdd0378bcfbfa38b320c3f80986cf5808 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 6 Feb 2013 00:44:28 +0100 Subject: [PATCH] qmail-smtpd_auth-ssl-fix-spp --- qmail-smtpd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qmail-smtpd.c b/qmail-smtpd.c index 76cedcb..43570f4 100644 --- a/qmail-smtpd.c +++ b/qmail-smtpd.c @@ -65,6 +65,7 @@ void tls_init(); int tls_verify(); void tls_nogateway(); int ssl_rfd = -1, ssl_wfd = -1; /* SSL_get_Xfd() are broken */ +stralloc proto = {0}; #endif int safewrite(fd,buf,len) int fd; char *buf; int len; @@ -1062,7 +1063,16 @@ char *arg; case 0: if (!spp_auth(authcmds[i].text, user.s)) return; flagauth = 1; - protocol = "ESMTPA"; + if (ssl) { + if (!stralloc_copys(&proto, "ESMTPSA (") + || !stralloc_cats(&proto, SSL_get_cipher(ssl)) + || !stralloc_cats(&proto, " encrypted, authenticated)")) + die_nomem(); + if (!stralloc_0(&proto)) die_nomem(); + protocol = proto.s; + } else { + protocol = "ESMTPA"; + } relayclient = ""; remoteinfo = user.s; if (!env_unset("TCPREMOTEINFO")) die_read(); @@ -1079,7 +1089,6 @@ char *arg; /* this file is too long --------------------------------------------- GO ON */ #ifdef TLS -stralloc proto = {0}; int ssl_verified = 0; const char *ssl_verify_err = 0; -- cgit v1.2.3