2011-04-09 23:34:13 +02:00
|
|
|
--- openssl.c.orig
|
|
|
|
+++ openssl.c
|
|
|
|
@@ -63,6 +63,7 @@ static sigjmp_buf ssljmp;
|
|
|
|
#include <openssl/x509.h>
|
|
|
|
#include <openssl/pem.h>
|
|
|
|
#include <openssl/rand.h>
|
|
|
|
+#include <openssl/engine.h>
|
|
|
|
|
|
|
|
#include "rcv.h"
|
|
|
|
#include <errno.h>
|
|
|
|
@@ -105,7 +106,7 @@ static SSL_METHOD *ssl_select_method(con
|
2010-04-20 02:07:59 +02:00
|
|
|
static void ssl_load_verifications(struct sock *sp);
|
|
|
|
static void ssl_certificate(struct sock *sp, const char *uhp);
|
|
|
|
static enum okay ssl_check_host(const char *server, struct sock *sp);
|
|
|
|
-static int smime_verify(struct message *m, int n, STACK *chain,
|
|
|
|
+static int smime_verify(struct message *m, int n, STACK_OF(X509) *chain,
|
|
|
|
X509_STORE *store);
|
|
|
|
static EVP_CIPHER *smime_cipher(const char *name);
|
|
|
|
static int ssl_password_cb(char *buf, int size, int rwflag, void *userdata);
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -166,6 +167,10 @@ ssl_init(void)
|
|
|
|
verbose = value("verbose") != NULL;
|
|
|
|
if (initialized == 0) {
|
|
|
|
SSL_library_init();
|
|
|
|
+/* Load all bundled ENGINEs into memory and make them visible */
|
|
|
|
+ ENGINE_load_builtin_engines();
|
|
|
|
+ /* Register all of them for every algorithm they collectively implement */
|
|
|
|
+ ENGINE_register_all_complete();
|
|
|
|
initialized = 1;
|
|
|
|
}
|
|
|
|
if (rand_init == 0)
|
|
|
|
@@ -211,9 +216,12 @@ ssl_select_method(const char *uhp)
|
|
|
|
|
|
|
|
cp = ssl_method_string(uhp);
|
|
|
|
if (cp != NULL) {
|
|
|
|
+#ifndef OPENSSL_NO_SSL2
|
|
|
|
if (equal(cp, "ssl2"))
|
|
|
|
method = SSLv2_client_method();
|
|
|
|
- else if (equal(cp, "ssl3"))
|
|
|
|
+ else
|
|
|
|
+#endif
|
|
|
|
+ if (equal(cp, "ssl3"))
|
|
|
|
method = SSLv3_client_method();
|
|
|
|
else if (equal(cp, "tls1"))
|
|
|
|
method = TLSv1_client_method();
|
|
|
|
@@ -308,7 +316,7 @@ ssl_check_host(const char *server, struc
|
2010-04-20 02:07:59 +02:00
|
|
|
X509 *cert;
|
|
|
|
X509_NAME *subj;
|
|
|
|
char data[256];
|
|
|
|
- /*GENERAL_NAMES*/STACK *gens;
|
|
|
|
+ STACK_OF(GENERAL_NAME) *gens;
|
|
|
|
GENERAL_NAME *gen;
|
|
|
|
int i;
|
|
|
|
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -494,7 +502,7 @@ smime_sign(FILE *ip, struct header *head
|
2010-04-20 02:07:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
-smime_verify(struct message *m, int n, STACK *chain, X509_STORE *store)
|
|
|
|
+smime_verify(struct message *m, int n, STACK_OF(X509) *chain, X509_STORE *store)
|
|
|
|
{
|
|
|
|
struct message *x;
|
|
|
|
char *cp, *sender, *to, *cc, *cnttype;
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -503,7 +511,8 @@ smime_verify(struct message *m, int n, S
|
2010-04-20 02:07:59 +02:00
|
|
|
off_t size;
|
|
|
|
BIO *fb, *pb;
|
|
|
|
PKCS7 *pkcs7;
|
|
|
|
- STACK *certs, *gens;
|
|
|
|
+ STACK_OF(X509) *certs;
|
|
|
|
+ STACK_OF(GENERAL_NAME) *gens;
|
|
|
|
X509 *cert;
|
|
|
|
X509_NAME *subj;
|
|
|
|
char data[LINESIZE];
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -612,7 +621,7 @@ cverify(void *vp)
|
2010-04-20 02:07:59 +02:00
|
|
|
{
|
|
|
|
int *msgvec = vp, *ip;
|
|
|
|
int ec = 0;
|
|
|
|
- STACK *chain = NULL;
|
|
|
|
+ STACK_OF(X509) *chain = NULL;
|
|
|
|
X509_STORE *store;
|
|
|
|
char *ca_dir, *ca_file;
|
|
|
|
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -685,7 +694,7 @@ smime_encrypt(FILE *ip, const char *cert
|
2010-04-20 02:07:59 +02:00
|
|
|
X509 *cert;
|
|
|
|
PKCS7 *pkcs7;
|
|
|
|
BIO *bb, *yb;
|
|
|
|
- STACK *certs;
|
|
|
|
+ STACK_OF(X509) *certs;
|
|
|
|
EVP_CIPHER *cipher;
|
|
|
|
|
|
|
|
certfile = expand((char *)certfile);
|
2011-04-09 23:34:13 +02:00
|
|
|
@@ -948,9 +957,9 @@ smime_certsave(struct message *m, int n,
|
2010-04-20 02:07:59 +02:00
|
|
|
off_t size;
|
|
|
|
BIO *fb, *pb;
|
|
|
|
PKCS7 *pkcs7;
|
|
|
|
- STACK *certs;
|
|
|
|
+ STACK_OF(X509) *certs;
|
|
|
|
X509 *cert;
|
|
|
|
- STACK *chain = NULL;
|
|
|
|
+ STACK_OF(X509) *chain = NULL;
|
|
|
|
enum okay ok = OKAY;
|
|
|
|
|
|
|
|
message_number = n;
|