Package: ssmtp / 2.64-8

01-374327-use-gnutls.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374327

GPL code linked against OpenSSL without exception

[ Alejandro Rios ]
* Initial port from openssl to gnutls
 
[ Anibal Monsalve Salazar ]
* configure: replaced -lssl with -lgnutls-openssl
* ssmtp.c: replaced SSL_CTX_use_certificate_chain_file with
  SSL_CTX_use_certificate_file and marked SSL_CTX_check_private_key
  as not used.

Alejandro Rios <alerios@debian.org>
Anibal Monsalve Salazar <anibal@debian.org>

Index: ssmtp-2.64/configure
===================================================================
--- ssmtp-2.64.orig/configure
+++ ssmtp-2.64/configure
@@ -1562,7 +1562,7 @@ if test x$enableval = xyes ; then
 #define HAVE_SSL 1
 EOF
 
-	LIBS="$LIBS -lssl"
+	LIBS="$LIBS -lgnutls-openssl"
 fi
 enableval=""
 
Index: ssmtp-2.64/configure.in
===================================================================
--- ssmtp-2.64.orig/configure.in
+++ ssmtp-2.64/configure.in
@@ -52,7 +52,7 @@ AC_ARG_ENABLE(ssl,
 [  --enable-ssl           support for secure connection to mail server])
 if test x$enableval = xyes ; then
 	AC_DEFINE(HAVE_SSL)
-	LIBS="$LIBS -lssl"
+	LIBS="$LIBS -lgnutls-openssl"
 fi
 enableval=""
 
Index: ssmtp-2.64/ssmtp.c
===================================================================
--- ssmtp-2.64.orig/ssmtp.c
+++ ssmtp-2.64/ssmtp.c
@@ -26,11 +26,7 @@
 #include <ctype.h>
 #include <netdb.h>
 #ifdef HAVE_SSL
-#include <openssl/crypto.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
+#include <gnutls/openssl.h>
 #endif
 #ifdef MD5AUTH
 #include "md5auth/hmac_md5.h"
@@ -1133,7 +1129,7 @@ int smtp_open(char *host, int port)
 	}
 
 	if(use_cert == True) { 
-		if(SSL_CTX_use_certificate_chain_file(ctx, tls_cert) <= 0) {
+		if(SSL_CTX_use_certificate_file(ctx, tls_cert, SSL_FILETYPE_PEM) <= 0) {
 			perror("Use certfile");
 			return(-1);
 		}
@@ -1143,10 +1139,12 @@ int smtp_open(char *host, int port)
 			return(-1);
 		}
 
+#ifdef NOT_USED
 		if(!SSL_CTX_check_private_key(ctx)) {
 			log_event(LOG_ERR, "Private key does not match the certificate public key\n");
 			return(-1);
 		}
+#endif
 	}
 #endif