View | Details | Raw Unified | Return to bug 205540
Collapse All | Expand All

(-)mail/heirloom-mailx/files/patch-openssl.c (-8 / +27 lines)
Lines 19-25 Link Here
19
 static EVP_CIPHER *smime_cipher(const char *name);
19
 static EVP_CIPHER *smime_cipher(const char *name);
20
 static int ssl_password_cb(char *buf, int size, int rwflag, void *userdata);
20
 static int ssl_password_cb(char *buf, int size, int rwflag, void *userdata);
21
 static FILE *smime_sign_cert(const char *xname, const char *xname2, int warn);
21
 static FILE *smime_sign_cert(const char *xname, const char *xname2, int warn);
22
@@ -203,19 +208,25 @@ ssl_verify_cb(int success, X509_STORE_CT
22
@@ -130,6 +135,7 @@ ssl_rand_init(void)
23
 	char *cp;
24
 	int state = 0;
25
 
26
+#ifndef OPENSSL_NO_EGD
27
 	if ((cp = value("ssl-rand-egd")) != NULL) {
28
 		cp = expand(cp);
29
 		if (RAND_egd(cp) == -1) {
30
@@ -138,7 +144,9 @@ ssl_rand_init(void)
31
 					cp);
32
 		} else
33
 			state = 1;
34
-	} else if ((cp = value("ssl-rand-file")) != NULL) {
35
+	} else 
36
+#endif /* OPENSSL_NO_EGD */
37
+	if ((cp = value("ssl-rand-file")) != NULL) {
38
 		cp = expand(cp);
39
 		if (RAND_load_file(cp, 1024) == -1) {
40
 			fprintf(stderr, catgets(catd, CATSET, 246,
41
@@ -203,19 +211,25 @@ ssl_verify_cb(int success, X509_STORE_CT
23
 	return 1;
42
 	return 1;
24
 }
43
 }
25
 
44
 
Lines 49-55 Link Here
49
 			method = TLSv1_client_method();
68
 			method = TLSv1_client_method();
50
 		else {
69
 		else {
51
 			fprintf(stderr, catgets(catd, CATSET, 244,
70
 			fprintf(stderr, catgets(catd, CATSET, 244,
52
@@ -308,7 +319,11 @@ ssl_check_host(const char *server, struc
71
@@ -308,7 +322,11 @@ ssl_check_host(const char *server, struc
53
 	X509 *cert;
72
 	X509 *cert;
54
 	X509_NAME *subj;
73
 	X509_NAME *subj;
55
 	char data[256];
74
 	char data[256];
Lines 61-67 Link Here
61
 	GENERAL_NAME	*gen;
80
 	GENERAL_NAME	*gen;
62
 	int	i;
81
 	int	i;
63
 
82
 
64
@@ -357,7 +372,8 @@ ssl_open(const char *server, struct sock
83
@@ -357,7 +375,8 @@ ssl_open(const char *server, struct sock
65
 
84
 
66
 	ssl_init();
85
 	ssl_init();
67
 	ssl_set_vrfy_level(uhp);
86
 	ssl_set_vrfy_level(uhp);
Lines 71-77 Link Here
71
 		ssl_gen_err(catgets(catd, CATSET, 261, "SSL_CTX_new() failed"));
90
 		ssl_gen_err(catgets(catd, CATSET, 261, "SSL_CTX_new() failed"));
72
 		return STOP;
91
 		return STOP;
73
 	}
92
 	}
74
@@ -496,7 +512,11 @@ smime_sign(FILE *ip, struct header *head
93
@@ -496,7 +515,11 @@ smime_sign(FILE *ip, struct header *head
75
 }
94
 }
76
 
95
 
77
 static int
96
 static int
Lines 83-89 Link Here
83
 {
102
 {
84
 	struct message	*x;
103
 	struct message	*x;
85
 	char	*cp, *sender, *to, *cc, *cnttype;
104
 	char	*cp, *sender, *to, *cc, *cnttype;
86
@@ -505,7 +525,12 @@ smime_verify(struct message *m, int n, S
105
@@ -505,7 +528,12 @@ smime_verify(struct message *m, int n, S
87
 	off_t	size;
106
 	off_t	size;
88
 	BIO	*fb, *pb;
107
 	BIO	*fb, *pb;
89
 	PKCS7	*pkcs7;
108
 	PKCS7	*pkcs7;
Lines 96-102 Link Here
96
 	X509	*cert;
115
 	X509	*cert;
97
 	X509_NAME	*subj;
116
 	X509_NAME	*subj;
98
 	char	data[LINESIZE];
117
 	char	data[LINESIZE];
99
@@ -614,7 +639,11 @@ cverify(void *vp)
118
@@ -614,7 +642,11 @@ cverify(void *vp)
100
 {
119
 {
101
 	int	*msgvec = vp, *ip;
120
 	int	*msgvec = vp, *ip;
102
 	int	ec = 0;
121
 	int	ec = 0;
Lines 108-114 Link Here
108
 	X509_STORE	*store;
127
 	X509_STORE	*store;
109
 	char	*ca_dir, *ca_file;
128
 	char	*ca_dir, *ca_file;
110
 
129
 
111
@@ -687,7 +716,11 @@ smime_encrypt(FILE *ip, const char *cert
130
@@ -687,7 +719,11 @@ smime_encrypt(FILE *ip, const char *cert
112
 	X509	*cert;
131
 	X509	*cert;
113
 	PKCS7	*pkcs7;
132
 	PKCS7	*pkcs7;
114
 	BIO	*bb, *yb;
133
 	BIO	*bb, *yb;
Lines 120-126 Link Here
120
 	EVP_CIPHER	*cipher;
139
 	EVP_CIPHER	*cipher;
121
 
140
 
122
 	certfile = expand((char *)certfile);
141
 	certfile = expand((char *)certfile);
123
@@ -950,9 +983,14 @@ smime_certsave(struct message *m, int n,
142
@@ -950,9 +986,14 @@ smime_certsave(struct message *m, int n,
124
 	off_t	size;
143
 	off_t	size;
125
 	BIO	*fb, *pb;
144
 	BIO	*fb, *pb;
126
 	PKCS7	*pkcs7;
145
 	PKCS7	*pkcs7;

Return to bug 205540