slackbuilds_ponce/network/ssmtp/patches/fix-tls1.3-handshake.patch
B. Watson db8b3116f4
network/ssmtp: Clean up build.
Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-10-13 00:52:25 +07:00

24 lines
576 B
Diff

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));