[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Nov 18 12:42:54 UTC 2016


The branch master has been updated
       via  7524c520173c2dcf75c50d9748d2aa62e163d58a (commit)
       via  1d8a94fb7d9bbc5f381b55252461772ea0b2754f (commit)
       via  9576545a51c76d944318283461d55ac28a0bfbfc (commit)
      from  5defbe6f3892577af5811e12809233e7f8a69830 (commit)


- Log -----------------------------------------------------------------
commit 7524c520173c2dcf75c50d9748d2aa62e163d58a
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Fri Nov 18 00:01:28 2016 +0100

    Avoid warnings like unused enum value (as suggested by Rich Salz)
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1945)

commit 1d8a94fb7d9bbc5f381b55252461772ea0b2754f
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Thu Nov 17 21:08:49 2016 +0100

    Shift inside of switch back one level (code style change, as requested by Rich Salz)
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1945)

commit 9576545a51c76d944318283461d55ac28a0bfbfc
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Thu Nov 17 17:16:50 2016 +0100

    Add LMTP support (RFC 2033) to s_client ("-starttls lmtp")
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1945)

-----------------------------------------------------------------------

Summary of changes:
 apps/s_client.c       | 20 +++++++++++++++-----
 doc/man1/s_client.pod |  2 +-
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/apps/s_client.c b/apps/s_client.c
index cfd7cbd..f6b556d 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -619,7 +619,8 @@ const OPTIONS s_client_options[] = {
     {"keymatexportlen", OPT_KEYMATEXPORTLEN, 'p',
      "Export len bytes of keying material (default 20)"},
     {"fallback_scsv", OPT_FALLBACKSCSV, '-', "Send the fallback SCSV"},
-    {"name", OPT_SMTPHOST, 's', "Hostname to use for \"-starttls smtp\""},
+    {"name", OPT_SMTPHOST, 's',
+     "Hostname to use for \"-starttls lmtp\" or \"-starttls smtp\""},
     {"CRL", OPT_CRL, '<', "CRL file to use"},
     {"crl_download", OPT_CRL_DOWNLOAD, '-', "Download CRL from distribution points"},
     {"CRLform", OPT_CRLFORM, 'F', "CRL format (PEM or DER) PEM is default"},
@@ -743,7 +744,8 @@ typedef enum PROTOCOL_choice {
     PROTO_XMPP_SERVER,
     PROTO_CONNECT,
     PROTO_IRC,
-    PROTO_POSTGRES
+    PROTO_POSTGRES,
+    PROTO_LMTP
 } PROTOCOL_CHOICE;
 
 static const OPT_PAIR services[] = {
@@ -756,6 +758,7 @@ static const OPT_PAIR services[] = {
     {"telnet", PROTO_TELNET},
     {"irc", PROTO_IRC},
     {"postgres", PROTO_POSTGRES},
+    {"lmtp", PROTO_LMTP},
     {NULL, 0}
 };
 
@@ -1854,6 +1857,7 @@ int s_client_main(int argc, char **argv)
     switch ((PROTOCOL_CHOICE) starttls_proto) {
     case PROTO_OFF:
         break;
+    case PROTO_LMTP:
     case PROTO_SMTP:
         {
             /*
@@ -1867,14 +1871,20 @@ int s_client_main(int argc, char **argv)
             int foundit = 0;
             BIO *fbio = BIO_new(BIO_f_buffer());
             BIO_push(fbio, sbio);
-            /* wait for multi-line response to end from SMTP */
+            /* Wait for multi-line response to end from LMTP or SMTP */
             do {
                 mbuf_len = BIO_gets(fbio, mbuf, BUFSIZZ);
             }
             while (mbuf_len > 3 && mbuf[3] == '-');
-            BIO_printf(fbio, "EHLO %s\r\n", ehlo);
+            if (starttls_proto == (int)PROTO_LMTP)
+                BIO_printf(fbio, "LHLO %s\r\n", ehlo);
+            else
+                BIO_printf(fbio, "EHLO %s\r\n", ehlo);
             (void)BIO_flush(fbio);
-            /* wait for multi-line response to end EHLO SMTP response */
+            /*
+             * Wait for multi-line response to end LHLO LMTP or EHLO SMTP
+             * response.
+             */
             do {
                 mbuf_len = BIO_gets(fbio, mbuf, BUFSIZZ);
                 if (strstr(mbuf, "STARTTLS"))
diff --git a/doc/man1/s_client.pod b/doc/man1/s_client.pod
index 03b5cda..2ebd682 100644
--- a/doc/man1/s_client.pod
+++ b/doc/man1/s_client.pod
@@ -437,7 +437,7 @@ command for more information.
 send the protocol-specific message(s) to switch to TLS for communication.
 B<protocol> is a keyword for the intended protocol.  Currently, the only
 supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
-"irc" and "postgres."
+"irc", "postgres" and "lmtp".
 
 =item B<-xmpphost hostname>
 


More information about the openssl-commits mailing list