Testsuite: GnuTLS server TLD startup errors testcase
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 21 May 2016 14:14:15 +0000 (15:14 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 21 May 2016 14:14:15 +0000 (15:14 +0100)
src/src/tls-gnu.c
test/confs/2034 [new symlink]
test/log/2034 [new file with mode: 0644]
test/scripts/2000-GnuTLS/2034 [new file with mode: 0644]
test/stdout/2034 [new file with mode: 0644]

index 45ee1017a034a8e9883659ea287763f1a6f3618c..c7c6b267440a81b88cf67717e4aeafcfc39f07e1 100644 (file)
@@ -1826,10 +1826,8 @@ state->fd_out = fileno(smtp_out);
 sigalrm_seen = FALSE;
 if (smtp_receive_timeout > 0) alarm(smtp_receive_timeout);
 do
-  {
   rc = gnutls_handshake(state->session);
-  } while ((rc == GNUTLS_E_AGAIN) ||
-      (rc == GNUTLS_E_INTERRUPTED && !sigalrm_seen));
+while (rc == GNUTLS_E_AGAIN ||  rc == GNUTLS_E_INTERRUPTED && !sigalrm_seen);
 alarm(0);
 
 if (rc != GNUTLS_E_SUCCESS)
diff --git a/test/confs/2034 b/test/confs/2034
new file mode 120000 (symlink)
index 0000000..6d0f5c2
--- /dev/null
@@ -0,0 +1 @@
+2006
\ No newline at end of file
diff --git a/test/log/2034 b/test/log/2034
new file mode 100644 (file)
index 0000000..f59667e
--- /dev/null
@@ -0,0 +1,4 @@
+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 TLS error on connection from (rhu.barb) [127.0.0.1] (gnutls_handshake): timed out
+1999-03-02 09:44:33 SMTP command timeout on connection from (rhu.barb) [127.0.0.1]
+1999-03-02 09:44:33 TLS error on connection from (rhu.barb) [127.0.0.1] (gnutls_handshake): An unexpected TLS packet was received.
diff --git a/test/scripts/2000-GnuTLS/2034 b/test/scripts/2000-GnuTLS/2034
new file mode 100644 (file)
index 0000000..b03c60d
--- /dev/null
@@ -0,0 +1,34 @@
+# TLS server: error in TLS session startup
+gnutls
+exim -DSERVER=server -bd -oX PORT_D
+****
+# timeout case
+client 127.0.0.1 PORT_D
+??? 220
+ehlo rhu.barb
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+starttls
+??? 220
++++ 3
+****
+#
+# bad TLS negotiation case
+client 127.0.0.1 PORT_D
+??? 220
+ehlo rhu.barb
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+starttls
+??? 220
+bogus
+****
+killdaemon
diff --git a/test/stdout/2034 b/test/stdout/2034
new file mode 100644 (file)
index 0000000..9453161
--- /dev/null
@@ -0,0 +1,42 @@
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> ehlo rhu.barb
+??? 250-
+<<< 250-myhost.test.ex Hello rhu.barb [127.0.0.1]
+??? 250-
+<<< 250-SIZE 52428800
+??? 250-
+<<< 250-8BITMIME
+??? 250-
+<<< 250-PIPELINING
+??? 250-
+<<< 250-STARTTLS
+??? 250
+<<< 250 HELP
+>>> starttls
+??? 220
+<<< 220 TLS go ahead
++++ 3
+End of script
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> ehlo rhu.barb
+??? 250-
+<<< 250-myhost.test.ex Hello rhu.barb [127.0.0.1]
+??? 250-
+<<< 250-SIZE 52428800
+??? 250-
+<<< 250-8BITMIME
+??? 250-
+<<< 250-PIPELINING
+??? 250-
+<<< 250-STARTTLS
+??? 250
+<<< 250 HELP
+>>> starttls
+??? 220
+<<< 220 TLS go ahead
+>>> bogus
+End of script