summaryrefslogtreecommitdiffstats
path: root/network/ssmtp/patches/fix-tls1.3-handshake.patch
blob: a84f45b84a2d0968e9fc855650396e4eaef53c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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));