pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/imap-uw fix deprecated methods.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/df9c69cfa380
branches:  trunk
changeset: 378854:df9c69cfa380
user:      christos <christos%pkgsrc.org@localhost>
date:      Mon Apr 16 21:27:56 2018 +0000

description:
fix deprecated methods.

diffstat:

 mail/imap-uw/Makefile                                 |   4 +-
 mail/imap-uw/distinfo                                 |   7 +-
 mail/imap-uw/patches/patch-src_osdep_unix_ssl__unix.c |  93 +++++++++++++++++-
 3 files changed, 93 insertions(+), 11 deletions(-)

diffs (180 lines):

diff -r 913cdef3660f -r df9c69cfa380 mail/imap-uw/Makefile
--- a/mail/imap-uw/Makefile     Mon Apr 16 21:27:54 2018 +0000
+++ b/mail/imap-uw/Makefile     Mon Apr 16 21:27:56 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.146 2018/04/15 07:43:22 wiz Exp $
+# $NetBSD: Makefile,v 1.147 2018/04/16 21:27:56 christos Exp $
 #
 # ATTENTION:
 # The Kerberos support in this software is known to be problematic. If you
@@ -11,7 +11,7 @@
 
 DISTNAME=      imap-2007f
 PKGNAME=       ${DISTNAME:S/-/-uw-/}
-PKGREVISION=   6
+PKGREVISION=   7
 CATEGORIES=    mail
 MASTER_SITES=  ftp://ftp.cac.washington.edu/imap/
 EXTRACT_SUFX=  .tar.Z
diff -r 913cdef3660f -r df9c69cfa380 mail/imap-uw/distinfo
--- a/mail/imap-uw/distinfo     Mon Apr 16 21:27:54 2018 +0000
+++ b/mail/imap-uw/distinfo     Mon Apr 16 21:27:56 2018 +0000
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.46 2018/04/15 07:43:22 wiz Exp $
+$NetBSD: distinfo,v 1.47 2018/04/16 21:27:56 christos Exp $
 
 SHA1 (imap-2007f.tar.Z) = 1c9935e5a261baec85dadcbc0c514b66fa3ce0a5
 RMD160 (imap-2007f.tar.Z) = 14f40284e9e164c0ed7677f1e5d8e3309c7c58c1
 SHA512 (imap-2007f.tar.Z) = 2c728deaf66d23158c61ae55ff94f05d2a1cf0168002760321ca30c6ee1c58c0a4c7bc14ece0097ea662df6c7c49be3b91c8e5e943724c9e2736800fa9298dae
 Size (imap-2007f.tar.Z) = 2793529 bytes
+<<<<<<< distinfo
+=======
+>>>>>>> 1.46
 SHA1 (patch-aa) = ac880c250dfee3d0d316063ace5b92cd2f190510
 SHA1 (patch-ab) = c7985a2db4d4b5c8d2644492b2e48f8ebe2d64b1
 SHA1 (patch-ac) = eab1435fdf7ab59ea8afbde949a92dd756e6aea3
@@ -40,4 +43,4 @@
 SHA1 (patch-src_c-client_misc.c) = d22ca95fb333b5234c66440faf5d6e30a148bad1
 SHA1 (patch-src_c-client_misc.h) = 5cf51d186b04ebb45c79b8042bbdcb01716dd2ce
 SHA1 (patch-src_mlock_Makefile) = 6bf652f597ad21dffa44e01d6cb89525eeaf7fc9
-SHA1 (patch-src_osdep_unix_ssl__unix.c) = c36d87ab1f10e4a07bd50db5f8222daefa441251
+SHA1 (patch-src_osdep_unix_ssl__unix.c) = cdb4ce9420f649d7cbd6d1e433336c6be94b10f9
diff -r 913cdef3660f -r df9c69cfa380 mail/imap-uw/patches/patch-src_osdep_unix_ssl__unix.c
--- a/mail/imap-uw/patches/patch-src_osdep_unix_ssl__unix.c     Mon Apr 16 21:27:54 2018 +0000
+++ b/mail/imap-uw/patches/patch-src_osdep_unix_ssl__unix.c     Mon Apr 16 21:27:56 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_osdep_unix_ssl__unix.c,v 1.1 2018/04/15 07:43:22 wiz Exp $
+$NetBSD: patch-src_osdep_unix_ssl__unix.c,v 1.2 2018/04/16 21:27:57 christos Exp $
 
 Description: Support OpenSSL 1.1
  When building with OpenSSL 1.1 and newer, use the new built-in
@@ -7,8 +7,23 @@
 Bug-Debian: https://bugs.debian.org/828589
 
 --- src/osdep/unix/ssl_unix.c.orig     2011-07-23 00:20:10.000000000 +0000
-+++ src/osdep/unix/ssl_unix.c
-@@ -227,8 +227,16 @@ static char *ssl_start_work (SSLSTREAM *
++++ src/osdep/unix/ssl_unix.c  2018-04-16 17:20:28.991950059 -0400
+@@ -219,16 +219,28 @@
+     (sslclientkey_t) mail_parameters (NIL,GET_SSLCLIENTKEY,NIL);
+   if (ssl_last_error) fs_give ((void **) &ssl_last_error);
+   ssl_last_host = host;
+-  if (!(stream->context = SSL_CTX_new ((flags & NET_TLSCLIENT) ?
+-                                     TLSv1_client_method () :
+-                                     SSLv23_client_method ())))
++  if (!(stream->context = SSL_CTX_new (
++#if OPENSSL_VERSION_NUMBER < 0x10100000UL
++  (flags & NET_TLSCLIENT) ?  TLSv1_client_method () : SSLv23_client_method ()
++#else
++  TLS_client_method()
++#endif
++  )))
+     return "SSL context failed";
+   SSL_CTX_set_options (stream->context,0);
                                /* disable certificate validation? */
    if (flags & NET_NOVALIDATECERT)
      SSL_CTX_set_verify (stream->context,SSL_VERIFY_NONE,NIL);
@@ -26,7 +41,7 @@
    SSL_CTX_set_default_verify_paths (stream->context);
                                /* ...unless a non-standard path desired */
    if (s = (char *) mail_parameters (NIL,GET_SSLCAPATH,NIL))
-@@ -266,6 +274,7 @@ static char *ssl_start_work (SSLSTREAM *
+@@ -266,6 +278,7 @@
    if (SSL_write (stream->con,"",0) < 0)
      return ssl_last_error ? ssl_last_error : "SSL negotiation failed";
                                /* need to validate host names? */
@@ -34,7 +49,7 @@
    if (!(flags & NET_NOVALIDATECERT) &&
        (err = ssl_validate_cert (cert = SSL_get_peer_certificate (stream->con),
                                host))) {
-@@ -275,6 +284,7 @@ static char *ssl_start_work (SSLSTREAM *
+@@ -275,6 +288,7 @@
      sprintf (tmp,"*%.128s: %.255s",err,cert ? cert->name : "???");
      return ssl_last_error = cpystr (tmp);
    }
@@ -42,7 +57,7 @@
    return NIL;
  }
  
-@@ -313,6 +323,7 @@ static int ssl_open_verify (int ok,X509_
+@@ -313,6 +327,7 @@
   * Returns: NIL if validated, else string of error message
   */
  
@@ -50,7 +65,7 @@
  static char *ssl_validate_cert (X509 *cert,char *host)
  {
    int i,n;
-@@ -342,6 +353,7 @@ static char *ssl_validate_cert (X509 *ce
+@@ -342,6 +357,7 @@
    else ret = "Unable to locate common name in certificate";
    return ret;
  }
@@ -58,3 +73,67 @@
  
  /* Case-independent wildcard pattern match
   * Accepts: base string
+@@ -702,9 +718,13 @@
+     if (stat (key,&sbuf)) strcpy (key,cert);
+   }
+                               /* create context */
+-  if (!(stream->context = SSL_CTX_new (start_tls ?
+-                                     TLSv1_server_method () :
+-                                     SSLv23_server_method ())))
++  if (!(stream->context = SSL_CTX_new (
++#if OPENSSL_VERSION_NUMBER < 0x10100000UL
++  start_tls ? TLSv1_server_method () : SSLv23_server_method ()
++#else
++  TLS_server_method ()
++#endif
++  )))
+     syslog (LOG_ALERT,"Unable to create SSL context, host=%.80s",
+           tcp_clienthost ());
+   else {                      /* set context options */
+@@ -772,17 +792,35 @@
+ {
+   unsigned long i;
+   static RSA *key = NIL;
+-  if (!key) {                 /* if don't have a key already */
+-                              /* generate key */
+-    if (!(key = RSA_generate_key (export ? keylength : 1024,RSA_F4,NIL,NIL))) {
+-      syslog (LOG_ALERT,"Unable to generate temp key, host=%.80s",
+-            tcp_clienthost ());
+-      while (i = ERR_get_error ())
+-      syslog (LOG_ALERT,"SSL error status: %s",ERR_error_string (i,NIL));
+-      exit (1);
+-    }
+-  }
+-  return key;
++  static BIGNUM *ebn = NIL;
++
++  if (key)
++     return key;
++
++  key = RSA_new ();
++  if (!key)                   /* if don't have a key already */
++    goto out;
++
++  ebn = BN_new ();
++  if (!ebn)
++    goto out;
++  BN_set_word (ebn, RSA_F4);
++
++  if (!RSA_generate_key_ex (key, export ? keylength : 1024, ebn, NIL))
++    goto out;
++  BN_free (ebn);
++   return key;
++
++out:
++  if (key)
++    RSA_free (key);
++  if (ebn)
++    BN_free (ebn);
++  syslog (LOG_ALERT,"Unable to generate temp key, host=%.80s",
++          tcp_clienthost ());
++  while (i = ERR_get_error ())
++    syslog (LOG_ALERT,"SSL error status: %s",ERR_error_string (i,NIL));
++  exit (1);
+ }
+ 
+ /* Wait for stdin input



Home | Main Index | Thread Index | Old Index