From 1b190b21c5902274d6dea47b0e697933df7f0356 Mon Sep 17 00:00:00 2001 From: shattered Date: Sat, 1 Oct 2011 11:49:19 +0000 Subject: PR/44024 -- fix failure to build with recent openssl --- mail/heirloom-mailx/distinfo | 4 +- mail/heirloom-mailx/patches/patch-aa | 39 +++++++++++ mail/heirloom-mailx/patches/patch-ab | 132 +++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 mail/heirloom-mailx/patches/patch-aa create mode 100644 mail/heirloom-mailx/patches/patch-ab (limited to 'mail/heirloom-mailx') diff --git a/mail/heirloom-mailx/distinfo b/mail/heirloom-mailx/distinfo index 6bd74fc4453..4ef29c95851 100644 --- a/mail/heirloom-mailx/distinfo +++ b/mail/heirloom-mailx/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.1.1.1 2008/10/30 13:01:00 obache Exp $ +$NetBSD: distinfo,v 1.2 2011/10/01 11:49:19 shattered Exp $ SHA1 (mailx-12.4.tar.bz2) = b1e105adf9d36269daf317dedf68b6e4cca404a7 RMD160 (mailx-12.4.tar.bz2) = 8244d04d0a0058fdbe9867ca503c7cda8d580154 Size (mailx-12.4.tar.bz2) = 271482 bytes +SHA1 (patch-aa) = 797ebb4b536f6576112bb1a0ba871298d21b0a2b +SHA1 (patch-ab) = 604a85e40301ff38b8bf28bcca337469f784eeaf SHA1 (patch-ac) = cb9d4b12f26bb5f90947e1dbcb06960de8144f11 SHA1 (patch-ae) = 257317452b39d0b609885c637242145cf4e04c4d SHA1 (patch-af) = 22676bcb00593de777cf897c450e14130f3f0616 diff --git a/mail/heirloom-mailx/patches/patch-aa b/mail/heirloom-mailx/patches/patch-aa new file mode 100644 index 00000000000..ca59e884da4 --- /dev/null +++ b/mail/heirloom-mailx/patches/patch-aa @@ -0,0 +1,39 @@ +$NetBSD: patch-aa,v 1.1 2011/10/01 11:49:20 shattered Exp $ + +--- makeconfig.orig 2007-04-14 15:24:28.000000000 +0000 ++++ makeconfig +@@ -1,7 +1,7 @@ + #!/bin/sh + + # +-# Sccsid @(#)makeconfig 1.43 (gritter) 4/14/07 ++# Sccsid @(#)makeconfig 1.44 (gritter) 5/26/09 + # + + tmp=___build$$ +@@ -393,6 +393,25 @@ CERTAltNameEncodedContext foo; + ! + fi + ++if test x$have_openssl = xyes ++then ++ compile_check stack_of 'for STACK_OF()' '#define HAVE_STACK_OF' <<\! ++#include ++#include ++#include ++#include ++#include ++ ++int main(void) ++{ ++ STACK_OF(GENERAL_NAME) *gens = NULL; ++ printf("%p", gens); /* to make it used */ ++ SSLv23_client_method(); ++ PEM_read_PrivateKey(0, 0, 0, 0); ++ return 0; ++} ++! ++fi + + cat >$tmp2.c <<\! + #include diff --git a/mail/heirloom-mailx/patches/patch-ab b/mail/heirloom-mailx/patches/patch-ab new file mode 100644 index 00000000000..4a48e5f02ca --- /dev/null +++ b/mail/heirloom-mailx/patches/patch-ab @@ -0,0 +1,132 @@ +$NetBSD: patch-ab,v 1.1 2011/10/01 11:49:20 shattered Exp $ + +--- openssl.c.orig 2007-08-04 11:38:03.000000000 +0000 ++++ openssl.c +@@ -38,7 +38,7 @@ + + #ifndef lint + #ifdef DOSCCS +-static char sccsid[] = "@(#)openssl.c 1.25 (gritter) 8/4/07"; ++static char sccsid[] = "@(#)openssl.c 1.26 (gritter) 5/26/09"; + #endif + #endif /* not lint */ + +@@ -101,12 +101,17 @@ static void sslcatch(int s); + static int ssl_rand_init(void); + static void ssl_init(void); + static int ssl_verify_cb(int success, X509_STORE_CTX *store); +-static SSL_METHOD *ssl_select_method(const char *uhp); ++static const SSL_METHOD *ssl_select_method(const char *uhp); + 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); ++#ifdef HAVE_STACK_OF ++static int smime_verify(struct message *m, int n, STACK_OF(X509) *chain, ++ X509_STORE *store); ++#else + static int smime_verify(struct message *m, int n, STACK *chain, + X509_STORE *store); ++#endif + static EVP_CIPHER *smime_cipher(const char *name); + static int ssl_password_cb(char *buf, int size, int rwflag, void *userdata); + static FILE *smime_sign_cert(const char *xname, const char *xname2, int warn); +@@ -203,10 +208,10 @@ ssl_verify_cb(int success, X509_STORE_CT + return 1; + } + +-static SSL_METHOD * ++static const SSL_METHOD * + ssl_select_method(const char *uhp) + { +- SSL_METHOD *method; ++ const SSL_METHOD *method; + char *cp; + + cp = ssl_method_string(uhp); +@@ -308,7 +313,11 @@ ssl_check_host(const char *server, struc + X509 *cert; + X509_NAME *subj; + char data[256]; ++#ifdef HAVE_STACK_OF ++ STACK_OF(GENERAL_NAME) *gens; ++#else + /*GENERAL_NAMES*/STACK *gens; ++#endif + GENERAL_NAME *gen; + int i; + +@@ -357,7 +366,8 @@ ssl_open(const char *server, struct sock + + ssl_init(); + ssl_set_vrfy_level(uhp); +- if ((sp->s_ctx = SSL_CTX_new(ssl_select_method(uhp))) == NULL) { ++ if ((sp->s_ctx = ++ SSL_CTX_new((SSL_METHOD *)ssl_select_method(uhp))) == NULL) { + ssl_gen_err(catgets(catd, CATSET, 261, "SSL_CTX_new() failed")); + return STOP; + } +@@ -496,7 +506,11 @@ smime_sign(FILE *ip, struct header *head + } + + static int ++#ifdef HAVE_STACK_OF ++smime_verify(struct message *m, int n, STACK_OF(X509) *chain, X509_STORE *store) ++#else + smime_verify(struct message *m, int n, STACK *chain, X509_STORE *store) ++#endif + { + struct message *x; + char *cp, *sender, *to, *cc, *cnttype; +@@ -505,7 +519,12 @@ smime_verify(struct message *m, int n, S + off_t size; + BIO *fb, *pb; + PKCS7 *pkcs7; ++#ifdef HAVE_STACK_OF ++ STACK_OF(X509) *certs; ++ STACK_OF(GENERAL_NAME) *gens; ++#else + STACK *certs, *gens; ++#endif + X509 *cert; + X509_NAME *subj; + char data[LINESIZE]; +@@ -614,7 +633,11 @@ cverify(void *vp) + { + int *msgvec = vp, *ip; + int ec = 0; ++#ifdef HAVE_STACK_OF ++ STACK_OF(X509) *chain = NULL; ++#else + STACK *chain = NULL; ++#endif + X509_STORE *store; + char *ca_dir, *ca_file; + +@@ -687,7 +710,11 @@ smime_encrypt(FILE *ip, const char *cert + X509 *cert; + PKCS7 *pkcs7; + BIO *bb, *yb; ++#ifdef HAVE_STACK_OF ++ STACK_OF(X509) *certs; ++#else + STACK *certs; ++#endif + EVP_CIPHER *cipher; + + certfile = expand((char *)certfile); +@@ -950,9 +977,14 @@ smime_certsave(struct message *m, int n, + off_t size; + BIO *fb, *pb; + PKCS7 *pkcs7; ++#ifdef HAVE_STACK_OF ++ STACK_OF(X509) *certs; ++ STACK_OF(X509) *chain = NULL; ++#else + STACK *certs; +- X509 *cert; + STACK *chain = NULL; ++#endif ++ X509 *cert; + enum okay ok = OKAY; + + message_number = n; -- cgit v1.2.3