summaryrefslogtreecommitdiffstats
path: root/network/ssmtp/patches/fix-tls1.3-handshake.patch
diff options
context:
space:
mode:
Diffstat (limited to 'network/ssmtp/patches/fix-tls1.3-handshake.patch')
-rw-r--r--network/ssmtp/patches/fix-tls1.3-handshake.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/network/ssmtp/patches/fix-tls1.3-handshake.patch b/network/ssmtp/patches/fix-tls1.3-handshake.patch
new file mode 100644
index 0000000000..a84f45b84a
--- /dev/null
+++ b/network/ssmtp/patches/fix-tls1.3-handshake.patch
@@ -0,0 +1,24 @@
+Subject: Fix TLS 1.3 handshake
+From: Jeff King <peff@peff.net>
+Bug-Debian: https://bugs.debian.org/932605
+Last-Update: 2019-08-13
+
+diff --git a/ssmtp.c b/ssmtp.c
+index 7ab79ab..6b2b9d0 100644
+--- a/ssmtp.c
++++ b/ssmtp.c
+@@ -1291,8 +1291,12 @@ fd_getc() -- Read a character from an fd
+ ssize_t fd_getc(int fd, void *c)
+ {
+ #ifdef HAVE_SSL
+- if(use_tls == True) {
+- return(SSL_read(ssl, c, 1));
++ if(use_tls == True) {
++ int attempt = 3;
++ int ret = 0;
++ while (attempt-- > 0 && ret == 0)
++ ret = SSL_read(ssl, c, 1);
++ return ret;
+ }
+ #endif
+ return(read(fd, c, 1));