From e7621e8371917cc06d0abce0929c3166e29007fb Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Mon, 1 Aug 2016 22:39:20 +0100 Subject: [PATCH] testcases for TLS --- test/confs/0900 | 5 +- test/confs/2090 | 1 + test/confs/2091 | 1 + test/confs/2190 | 1 + test/confs/2191 | 1 + test/log/2090 | 5 ++ test/log/2091 | 7 ++ test/log/2190 | 5 ++ test/log/2191 | 9 +++ test/scripts/2000-GnuTLS/2090 | 78 +++++++++++++++++++ test/scripts/2000-GnuTLS/2091 | 9 +++ test/scripts/2100-OpenSSL/2190 | 77 ++++++++++++++++++ test/scripts/2100-OpenSSL/2191 | 1 + test/stdout/2090 | 110 ++++++++++++++++++++++++++ test/stdout/2190 | 138 +++++++++++++++++++++++++++++++++ 15 files changed, 447 insertions(+), 1 deletion(-) create mode 120000 test/confs/2090 create mode 120000 test/confs/2091 create mode 120000 test/confs/2190 create mode 120000 test/confs/2191 create mode 100644 test/log/2090 create mode 100644 test/log/2091 create mode 100644 test/log/2190 create mode 100644 test/log/2191 create mode 100644 test/scripts/2000-GnuTLS/2090 create mode 100644 test/scripts/2000-GnuTLS/2091 create mode 100644 test/scripts/2100-OpenSSL/2190 create mode 120000 test/scripts/2100-OpenSSL/2191 create mode 100644 test/stdout/2090 create mode 100644 test/stdout/2190 diff --git a/test/confs/0900 b/test/confs/0900 index 3235f1ee7..245d9fa96 100644 --- a/test/confs/0900 +++ b/test/confs/0900 @@ -1,6 +1,7 @@ # Exim test configuration 0900 SERVER= X= +Y= OPT= exim_path = EXIM_PATH @@ -11,7 +12,7 @@ log_file_path = DIR/spool/log/SERVER%slog gecos_pattern = "" gecos_name = CALLER_NAME chunking_advertise_hosts = * -tls_advertise_hosts = +tls_advertise_hosts = ${if eq {Y}{tls} {*}} # ----- Main settings ----- @@ -25,6 +26,8 @@ queue_only smtp_receive_timeout = 2s log_selector = +received_recipients +tls_certificate = ${if eq {SERVER}{server}{DIR/aux-fixed/cert1}fail} +tls_privatekey = ${if eq {SERVER}{server}{DIR/aux-fixed/cert1}fail} # ----- ACL ----- diff --git a/test/confs/2090 b/test/confs/2090 new file mode 120000 index 000000000..1bb987150 --- /dev/null +++ b/test/confs/2090 @@ -0,0 +1 @@ +0900 \ No newline at end of file diff --git a/test/confs/2091 b/test/confs/2091 new file mode 120000 index 000000000..1bb987150 --- /dev/null +++ b/test/confs/2091 @@ -0,0 +1 @@ +0900 \ No newline at end of file diff --git a/test/confs/2190 b/test/confs/2190 new file mode 120000 index 000000000..1bb987150 --- /dev/null +++ b/test/confs/2190 @@ -0,0 +1 @@ +0900 \ No newline at end of file diff --git a/test/confs/2191 b/test/confs/2191 new file mode 120000 index 000000000..1bb987150 --- /dev/null +++ b/test/confs/2191 @@ -0,0 +1 @@ +0900 \ No newline at end of file diff --git a/test/log/2090 b/test/log/2090 new file mode 100644 index 000000000..630d2c6a4 --- /dev/null +++ b/test/log/2090 @@ -0,0 +1,5 @@ + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 10HmaX-0005vi-00 <= someone@some.domain H=(rhu.barb) [127.0.0.1] P=esmtps X=TLS1.x:xxxxRSA_AES_256_CBC_SHAnnn:256 CV=no K S=sss for CALLER@the.local.host.name +1999-03-02 09:44:33 10HmaY-0005vi-00 <= someone@some.domain H=(rhu.barb) [127.0.0.1] P=esmtps X=TLS1.x:xxxxRSA_AES_256_CBC_SHAnnn:256 CV=no K S=sss for CALLER@the.local.host.name diff --git a/test/log/2091 b/test/log/2091 new file mode 100644 index 000000000..3c1be5c84 --- /dev/null +++ b/test/log/2091 @@ -0,0 +1,7 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local S=sss for CALLER@test.ex +1999-03-02 09:44:33 10HmaX-0005vi-00 => CALLER@test.ex R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] X=TLS1.x:xxxxRSA_AES_256_CBC_SHAnnn:256 CV=no C="250- 340 byte chunk, total 340\\n250 OK id=10HmaY-0005vi-00" +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1224 +1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> H=localhost (the.local.host.name) [127.0.0.1] P=esmtps X=TLS1.x:xxxxRSA_AES_256_CBC_SHAnnn:256 CV=no K S=sss id=E10HmaX-0005vi-00@the.local.host.name for CALLER@test.ex diff --git a/test/log/2190 b/test/log/2190 new file mode 100644 index 000000000..356a4ad92 --- /dev/null +++ b/test/log/2190 @@ -0,0 +1,5 @@ + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 10HmaX-0005vi-00 <= someone@some.domain H=(rhu.barb) [127.0.0.1] P=esmtps X=TLSv1:AES256-SHA:256 CV=no K S=sss for CALLER@the.local.host.name +1999-03-02 09:44:33 10HmaY-0005vi-00 <= someone@some.domain H=(rhu.barb) [127.0.0.1] P=esmtps X=TLSv1:AES256-SHA:256 CV=no K S=sss for CALLER@the.local.host.name diff --git a/test/log/2191 b/test/log/2191 new file mode 100644 index 000000000..4ff843230 --- /dev/null +++ b/test/log/2191 @@ -0,0 +1,9 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local S=sss for CALLER@test.ex +1999-03-02 09:44:33 10HmaX-0005vi-00 [127.0.0.1] SSL verify error: depth=0 error=self signed certificate cert=/C=UK/O=The Exim Maintainers/OU=Test Suite/CN=Phil Pennock +1999-03-02 09:44:33 10HmaX-0005vi-00 [127.0.0.1] SSL verify error: certificate name mismatch: "/C=UK/O=The Exim Maintainers/OU=Test Suite/CN=Phil Pennock" +1999-03-02 09:44:33 10HmaX-0005vi-00 => CALLER@test.ex R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] X=TLSv1:AES256-SHA:256 CV=no C="250- 340 byte chunk, total 340\\n250 OK id=10HmaY-0005vi-00" +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1224 +1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> H=localhost (the.local.host.name) [127.0.0.1] P=esmtps X=TLSv1:AES256-SHA:256 CV=no K S=sss id=E10HmaX-0005vi-00@the.local.host.name for CALLER@test.ex diff --git a/test/scripts/2000-GnuTLS/2090 b/test/scripts/2000-GnuTLS/2090 new file mode 100644 index 000000000..f799016f1 --- /dev/null +++ b/test/scripts/2000-GnuTLS/2090 @@ -0,0 +1,78 @@ +# TLS server, CHUNKING reception +gnutls +exim -DSERVER=server -DY=tls -bd -oX PORT_D +**** +# +# non-piplined +client-gnutls 127.0.0.1 PORT_D +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250-STARTTLS +??? 250 HELP +STARTTLS +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250 HELP +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +BDAT 88 LAST +To: Susan@random.com +From: Sam@random.com +Subject: This is a bodyless test message + +??? 250- +??? 250 +QUIT +??? 221 +**** +# +# pipelined +client-gnutls 127.0.0.1 PORT_D +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250-STARTTLS +??? 250 HELP +STARTTLS +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250 HELP +MAIL FROM: +RCPT TO: +BDAT 88 LAST +To: Susan@random.com +From: Sam@random.com +Subject: This is a bodyless test message + +??? 250 +??? 250 +??? 250- +??? 250 +QUIT +??? 221 +**** +# +# +killdaemon +no_msglog_check diff --git a/test/scripts/2000-GnuTLS/2091 b/test/scripts/2000-GnuTLS/2091 new file mode 100644 index 000000000..aa7b26058 --- /dev/null +++ b/test/scripts/2000-GnuTLS/2091 @@ -0,0 +1,9 @@ +# TLS client, CHUNKING transmission +gnutls +exim -DSERVER=server -DY=tls -bd -oX PORT_S +**** +exim -odf CALLER@test.ex +Test message. Contains FF: ΓΏ +**** +killdaemon +no_msglog_check diff --git a/test/scripts/2100-OpenSSL/2190 b/test/scripts/2100-OpenSSL/2190 new file mode 100644 index 000000000..bacca676d --- /dev/null +++ b/test/scripts/2100-OpenSSL/2190 @@ -0,0 +1,77 @@ +# TLS server, CHUNKING reception +exim -DSERVER=server -DY=tls -bd -oX PORT_D +**** +# +# non-piplined +client-ssl 127.0.0.1 PORT_D +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250-STARTTLS +??? 250 HELP +STARTTLS +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250 HELP +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +BDAT 88 LAST +To: Susan@random.com +From: Sam@random.com +Subject: This is a bodyless test message + +??? 250- +??? 250 +QUIT +??? 221 +**** +# +# pipelined +client-ssl 127.0.0.1 PORT_D +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250-STARTTLS +??? 250 HELP +STARTTLS +??? 220 +EHLO rhu.barb +??? 250- +??? 250-SIZE +??? 250-8BITMIME +??? 250-PIPELINING +??? 250-CHUNKING +??? 250 HELP +MAIL FROM: +RCPT TO: +BDAT 88 LAST +To: Susan@random.com +From: Sam@random.com +Subject: This is a bodyless test message + +??? 250 +??? 250 +??? 250- +??? 250 +QUIT +??? 221 +**** +# +# +killdaemon +no_msglog_check diff --git a/test/scripts/2100-OpenSSL/2191 b/test/scripts/2100-OpenSSL/2191 new file mode 120000 index 000000000..825b021c3 --- /dev/null +++ b/test/scripts/2100-OpenSSL/2191 @@ -0,0 +1 @@ +../2000-GnuTLS/2091 \ No newline at end of file diff --git a/test/stdout/2090 b/test/stdout/2090 new file mode 100644 index 000000000..e198f1279 --- /dev/null +++ b/test/stdout/2090 @@ -0,0 +1,110 @@ +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250-STARTTLS +<<< 250-STARTTLS +??? 250 HELP +<<< 250 HELP +>>> STARTTLS +??? 220 +<<< 220 TLS go ahead +Attempting to start TLS +Succeeded in starting TLS +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250 HELP +<<< 250 HELP +>>> MAIL FROM: +??? 250 +<<< 250 OK +>>> RCPT TO: +??? 250 +<<< 250 Accepted +>>> BDAT 88 LAST +>>> To: Susan@random.com +>>> From: Sam@random.com +>>> Subject: This is a bodyless test message +>>> +??? 250- +<<< 250- 88 byte chunk, total 88 +??? 250 +<<< 250 OK id=10HmaX-0005vi-00 +>>> QUIT +??? 221 +<<< 221 the.local.host.name closing connection +End of script +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250-STARTTLS +<<< 250-STARTTLS +??? 250 HELP +<<< 250 HELP +>>> STARTTLS +??? 220 +<<< 220 TLS go ahead +Attempting to start TLS +Succeeded in starting TLS +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250 HELP +<<< 250 HELP +>>> MAIL FROM: +>>> RCPT TO: +>>> BDAT 88 LAST +>>> To: Susan@random.com +>>> From: Sam@random.com +>>> Subject: This is a bodyless test message +>>> +??? 250 +<<< 250 OK +??? 250 +<<< 250 Accepted +??? 250- +<<< 250- 88 byte chunk, total 88 +??? 250 +<<< 250 OK id=10HmaY-0005vi-00 +>>> QUIT +??? 221 +<<< 221 the.local.host.name closing connection +End of script diff --git a/test/stdout/2190 b/test/stdout/2190 new file mode 100644 index 000000000..7942a8ce5 --- /dev/null +++ b/test/stdout/2190 @@ -0,0 +1,138 @@ +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250-STARTTLS +<<< 250-STARTTLS +??? 250 HELP +<<< 250 HELP +>>> STARTTLS +??? 220 +<<< 220 TLS go ahead +Attempting to start TLS +SSL info: before/connect initialization +SSL info: before/connect initialization +SSL info: SSLv3 read server hello A +SSL info: SSLv3 read server certificate A +SSL info: SSLv3 read server done A +SSL info: SSLv3 write client key exchange A +SSL info: SSLv3 write change cipher spec A +SSL info: SSLv3 write finished A +SSL info: SSLv3 flush data +SSL info: SSLv3 read server session ticket A +SSL info: SSLv3 read finished A +SSL info: SSL negotiation finished successfully +SSL info: SSL negotiation finished successfully +SSL connection using AES256-SHA +Succeeded in starting TLS +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250 HELP +<<< 250 HELP +>>> MAIL FROM: +??? 250 +<<< 250 OK +>>> RCPT TO: +??? 250 +<<< 250 Accepted +>>> BDAT 88 LAST +>>> To: Susan@random.com +>>> From: Sam@random.com +>>> Subject: This is a bodyless test message +>>> +??? 250- +<<< 250- 88 byte chunk, total 88 +??? 250 +<<< 250 OK id=10HmaX-0005vi-00 +>>> QUIT +??? 221 +<<< 221 the.local.host.name closing connection +End of script +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250-STARTTLS +<<< 250-STARTTLS +??? 250 HELP +<<< 250 HELP +>>> STARTTLS +??? 220 +<<< 220 TLS go ahead +Attempting to start TLS +SSL info: before/connect initialization +SSL info: before/connect initialization +SSL info: SSLv3 read server hello A +SSL info: SSLv3 read server certificate A +SSL info: SSLv3 read server done A +SSL info: SSLv3 write client key exchange A +SSL info: SSLv3 write change cipher spec A +SSL info: SSLv3 write finished A +SSL info: SSLv3 flush data +SSL info: SSLv3 read server session ticket A +SSL info: SSLv3 read finished A +SSL info: SSL negotiation finished successfully +SSL info: SSL negotiation finished successfully +SSL connection using AES256-SHA +Succeeded in starting TLS +>>> EHLO rhu.barb +??? 250- +<<< 250-the.local.host.name Hello rhu.barb [127.0.0.1] +??? 250-SIZE +<<< 250-SIZE 52428800 +??? 250-8BITMIME +<<< 250-8BITMIME +??? 250-PIPELINING +<<< 250-PIPELINING +??? 250-CHUNKING +<<< 250-CHUNKING +??? 250 HELP +<<< 250 HELP +>>> MAIL FROM: +>>> RCPT TO: +>>> BDAT 88 LAST +>>> To: Susan@random.com +>>> From: Sam@random.com +>>> Subject: This is a bodyless test message +>>> +??? 250 +<<< 250 OK +??? 250 +<<< 250 Accepted +??? 250- +<<< 250- 88 byte chunk, total 88 +??? 250 +<<< 250 OK id=10HmaY-0005vi-00 +>>> QUIT +??? 221 +<<< 221 the.local.host.name closing connection +End of script -- 2.30.2