Module Name:    src
Committed By:   christos
Date:           Thu Aug  8 13:50:58 UTC 2019

Modified Files:
        src/external/bsd/openldap/dist/build: mkversion
        src/external/bsd/openldap/dist/clients/tools: common.c
        src/external/bsd/openldap/dist/include: Makefile.in ldap_pvt.h
            ldap_queue.h portable.hin
        src/external/bsd/openldap/dist/libraries/libldap: os-ip.c os-local.c
            tls_o.c
        src/external/bsd/openldap/dist/libraries/liblutil: detach.c md5.c
            passwd.c
        src/external/bsd/openldap/dist/libraries/librewrite: session.c
        src/external/bsd/openldap/dist/servers/slapd: filter.c
        src/external/bsd/openldap/dist/servers/slapd/overlays: deref.c
        src/external/bsd/openldap/include: ldap_features.h portable.h
Removed Files:
        src/external/bsd/openldap/dist/doc/man/man5: slapd-ldbm.5
        src/external/bsd/openldap/dist/tests/scripts:
            test058-syncrepl-asymmetric

Log Message:
merge conflicts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/build/mkversion
cvs rdiff -u -r1.7 -r1.8 \
    src/external/bsd/openldap/dist/clients/tools/common.c
cvs rdiff -u -r1.1.1.6 -r0 \
    src/external/bsd/openldap/dist/doc/man/man5/slapd-ldbm.5
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/include/Makefile.in \
    src/external/bsd/openldap/dist/include/portable.hin
cvs rdiff -u -r1.1.1.7 -r1.2 \
    src/external/bsd/openldap/dist/include/ldap_pvt.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/dist/include/ldap_queue.h
cvs rdiff -u -r1.8 -r1.9 \
    src/external/bsd/openldap/dist/libraries/libldap/os-ip.c
cvs rdiff -u -r1.9 -r1.10 \
    src/external/bsd/openldap/dist/libraries/libldap/os-local.c
cvs rdiff -u -r1.6 -r1.7 \
    src/external/bsd/openldap/dist/libraries/libldap/tls_o.c
cvs rdiff -u -r1.5 -r1.6 \
    src/external/bsd/openldap/dist/libraries/liblutil/detach.c \
    src/external/bsd/openldap/dist/libraries/liblutil/md5.c
cvs rdiff -u -r1.6 -r1.7 \
    src/external/bsd/openldap/dist/libraries/liblutil/passwd.c
cvs rdiff -u -r1.4 -r1.5 \
    src/external/bsd/openldap/dist/libraries/librewrite/session.c
cvs rdiff -u -r1.5 -r1.6 \
    src/external/bsd/openldap/dist/servers/slapd/filter.c
cvs rdiff -u -r1.4 -r1.5 \
    src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c
cvs rdiff -u -r1.1.1.5 -r0 \
    src/external/bsd/openldap/dist/tests/scripts/test058-syncrepl-asymmetric
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/include/ldap_features.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/include/portable.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/openldap/dist/build/mkversion
diff -u src/external/bsd/openldap/dist/build/mkversion:1.7 src/external/bsd/openldap/dist/build/mkversion:1.8
--- src/external/bsd/openldap/dist/build/mkversion:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/build/mkversion	Thu Aug  8 09:50:56 2019
@@ -3,7 +3,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2017 The OpenLDAP Foundation.
+## Copyright 1998-2019 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -50,11 +50,16 @@ if test $# != 1 ; then
 fi
 
 APPLICATION=$1
+#if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+   WHOWHERE="openldap"
+#else
+#   WHOWHERE="$USER@$(uname -n):$(pwd)"
+#fi
 
 cat << __EOF__
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,7 +72,7 @@ cat << __EOF__
  */
 
 static const char copyright[] =
-"Copyright 1998-2017 The OpenLDAP Foundation.  All rights reserved.\n"
+"Copyright 1998-2019 The OpenLDAP Foundation.  All rights reserved.\n"
 "COPYING RESTRICTIONS APPLY\n";
 
 $static $const char $SYMBOL[] =

Index: src/external/bsd/openldap/dist/clients/tools/common.c
diff -u src/external/bsd/openldap/dist/clients/tools/common.c:1.7 src/external/bsd/openldap/dist/clients/tools/common.c:1.8
--- src/external/bsd/openldap/dist/clients/tools/common.c:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/clients/tools/common.c	Thu Aug  8 09:50:56 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: common.c,v 1.7 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: common.c,v 1.8 2019/08/08 13:50:56 christos Exp $	*/
 
 /* common.c - common routines for the ldap client tools */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * Portions Copyright 2003 Kurt D. Zeilenga.
  * Portions Copyright 2003 IBM Corporation.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: common.c,v 1.7 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.8 2019/08/08 13:50:56 christos Exp $");
 
 #include "portable.h"
 

Index: src/external/bsd/openldap/dist/include/Makefile.in
diff -u src/external/bsd/openldap/dist/include/Makefile.in:1.7 src/external/bsd/openldap/dist/include/Makefile.in:1.8
--- src/external/bsd/openldap/dist/include/Makefile.in:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/include/Makefile.in	Thu Aug  8 09:50:57 2019
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2017 The OpenLDAP Foundation.
+## Copyright 1998-2019 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -21,7 +21,7 @@ install-local: FORCE
 		$(srcdir)/ldap.h $(srcdir)/ldap_cdefs.h \
 		$(srcdir)/ldap_schema.h $(srcdir)/ldap_utf8.h \
 		$(srcdir)/slapi-plugin.h ldap_features.h \
-		$(srcdir)/ldif.h ; \
+		$(srcdir)/ldif.h $(srcdir)/openldap.h ; \
 	do \
 		$(INSTALL) $(INSTALLFLAGS) -m 644 $$header $(DESTDIR)$(includedir); \
 	done
Index: src/external/bsd/openldap/dist/include/portable.hin
diff -u src/external/bsd/openldap/dist/include/portable.hin:1.7 src/external/bsd/openldap/dist/include/portable.hin:1.8
--- src/external/bsd/openldap/dist/include/portable.hin:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/include/portable.hin	Thu Aug  8 09:50:57 2019
@@ -4,7 +4,7 @@
 /* begin of portable.h.pre */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation
+ * Copyright 1998-2019 The OpenLDAP Foundation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1006,7 +1006,7 @@
 /* define for Referential Integrity overlay */
 #undef SLAPD_OVER_REFINT
 
-/* define for Referential Integrity overlay */
+/* define for Return Code Integrity overlay */
 #undef SLAPD_OVER_RETCODE
 
 /* define for Rewrite/Remap overlay */

Index: src/external/bsd/openldap/dist/include/ldap_pvt.h
diff -u src/external/bsd/openldap/dist/include/ldap_pvt.h:1.1.1.7 src/external/bsd/openldap/dist/include/ldap_pvt.h:1.2
--- src/external/bsd/openldap/dist/include/ldap_pvt.h:1.1.1.7	Thu Aug  8 09:31:03 2019
+++ src/external/bsd/openldap/dist/include/ldap_pvt.h	Thu Aug  8 09:50:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldap_pvt.h,v 1.1.1.7 2019/08/08 13:31:03 christos Exp $	*/
+/*	$NetBSD: ldap_pvt.h,v 1.2 2019/08/08 13:50:57 christos Exp $	*/
 
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
@@ -270,6 +270,9 @@ struct sockbuf; /* avoid pulling in <lbe
 LDAP_F (int) ldap_pvt_sasl_install LDAP_P(( struct sockbuf *, void * ));
 LDAP_F (void) ldap_pvt_sasl_remove LDAP_P(( struct sockbuf * ));
 
+LDAP_F (int) ldap_pvt_tls_check_hostname LDAP_P(( LDAP *, void *, const char *));
+
+
 /*
  * SASL encryption support for LBER Sockbufs
  */

Index: src/external/bsd/openldap/dist/include/ldap_queue.h
diff -u src/external/bsd/openldap/dist/include/ldap_queue.h:1.5 src/external/bsd/openldap/dist/include/ldap_queue.h:1.6
--- src/external/bsd/openldap/dist/include/ldap_queue.h:1.5	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/include/ldap_queue.h	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: ldap_queue.h,v 1.5 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: ldap_queue.h,v 1.6 2019/08/08 13:50:57 christos Exp $	*/
 
 /* ldap_queue.h -- queue macros */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2001-2017 The OpenLDAP Foundation.
+ * Copyright 2001-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Index: src/external/bsd/openldap/dist/libraries/libldap/os-ip.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/os-ip.c:1.8 src/external/bsd/openldap/dist/libraries/libldap/os-ip.c:1.9
--- src/external/bsd/openldap/dist/libraries/libldap/os-ip.c:1.8	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/libldap/os-ip.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: os-ip.c,v 1.8 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: os-ip.c,v 1.9 2019/08/08 13:50:57 christos Exp $	*/
 
 /* os-ip.c -- platform-specific TCP & UDP related code */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * Portions Copyright 1999 Lars Uffmann.
  * All rights reserved.
  *
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: os-ip.c,v 1.8 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: os-ip.c,v 1.9 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 
@@ -448,7 +448,7 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t 
 		if ( connect(s, sin, addrlen) != AC_SOCKET_ERROR ) {
 			osip_debug(ld, "connect success\n", 0, 0, 0);
 
-			if ( opt_tv && ldap_pvt_ndelay_off(ld, s) == -1 )
+			if ( !async && opt_tv && ldap_pvt_ndelay_off(ld, s) == -1 )
 				return ( -1 );
 			return ( 0 );
 		}
@@ -628,6 +628,9 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *
 			continue;
 		}
 
+#ifndef LDAP_PF_INET6
+		if ( sai->ai_family == AF_INET6 ) continue;
+#endif
 		/* we assume AF_x and PF_x are equal for all x */
 		s = ldap_int_socket( ld, sai->ai_family, socktype );
 		if ( s == AC_SOCKET_INVALID ) {

Index: src/external/bsd/openldap/dist/libraries/libldap/os-local.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/os-local.c:1.9 src/external/bsd/openldap/dist/libraries/libldap/os-local.c:1.10
--- src/external/bsd/openldap/dist/libraries/libldap/os-local.c:1.9	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/libldap/os-local.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: os-local.c,v 1.9 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: os-local.c,v 1.10 2019/08/08 13:50:57 christos Exp $	*/
 
 /* os-local.c -- platform-specific domain socket code */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: os-local.c,v 1.9 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: os-local.c,v 1.10 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 
@@ -114,7 +114,7 @@ ldap_pvt_close_socket(LDAP *ld, int s)
 #define TRACE do { \
 	char ebuf[128]; \
 	oslocal_debug(ld, \
-		"ldap_is_socket_ready: errror on socket %d: errno: %d (%s)\n", \
+		"ldap_is_socket_ready: error on socket %d: errno: %d (%s)\n", \
 		s, \
 		errno, \
 		AC_STRERROR_R(errno, ebuf, sizeof ebuf)); \
@@ -364,5 +364,5 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *
 	return rc;
 }
 #else
-static int dummy;
+static int dummy; /* generate also a warning: 'dummy' defined but not used (at least here) */
 #endif /* LDAP_PF_LOCAL */

Index: src/external/bsd/openldap/dist/libraries/libldap/tls_o.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/tls_o.c:1.6 src/external/bsd/openldap/dist/libraries/libldap/tls_o.c:1.7
--- src/external/bsd/openldap/dist/libraries/libldap/tls_o.c:1.6	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/libldap/tls_o.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: tls_o.c,v 1.6 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: tls_o.c,v 1.7 2019/08/08 13:50:57 christos Exp $	*/
 
 /* tls_o.c - Handle tls/ssl using OpenSSL */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2008-2017 The OpenLDAP Foundation.
+ * Copyright 2008-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls_o.c,v 1.6 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: tls_o.c,v 1.7 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 
@@ -48,6 +48,9 @@ __RCSID("$NetBSD: tls_o.c,v 1.6 2018/02/
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include <openssl/safestack.h>
+#include <openssl/bn.h>
+#include <openssl/rsa.h>
+#include <openssl/dh.h>
 #elif defined( HAVE_SSL_H )
 #include <ssl.h>
 #endif
@@ -59,6 +62,9 @@ __RCSID("$NetBSD: tls_o.c,v 1.6 2018/02/
 typedef SSL_CTX tlso_ctx;
 typedef SSL tlso_session;
 
+static BIO_METHOD * tlso_bio_method = NULL;
+static BIO_METHOD * tlso_bio_setup( void );
+
 static int  tlso_opt_trace = 1;
 
 static void tlso_report_error( void );
@@ -88,6 +94,13 @@ static void tlso_locking_cb( int mode, i
 	}
 }
 
+#if OPENSSL_VERSION_NUMBER >= 0x0909000
+static void tlso_thread_self( CRYPTO_THREADID *id )
+{
+	CRYPTO_THREADID_set_pointer( id, (void *)ldap_pvt_thread_self() );
+}
+#define CRYPTO_set_id_callback(foo)	CRYPTO_THREADID_set_callback(foo)
+#else
 static unsigned long tlso_thread_self( void )
 {
 	/* FIXME: CRYPTO_set_id_callback only works when ldap_pvt_thread_t
@@ -100,6 +113,7 @@ static unsigned long tlso_thread_self( v
 
 	return (unsigned long) ldap_pvt_thread_self();
 }
+#endif
 
 static void tlso_thr_init( void )
 {
@@ -118,6 +132,43 @@ static void tlso_thr_init( void ) {}
 #endif
 #endif /* OpenSSL 1.1 */
 
+#if OPENSSL_VERSION_NUMBER < 0x10100000
+/*
+ * OpenSSL 1.1 API and later makes the BIO method concrete types internal.
+ */
+
+static BIO_METHOD *
+BIO_meth_new( int type, const char *name )
+{
+	BIO_METHOD *method = LDAP_MALLOC( sizeof(BIO_METHOD) );
+	memset( method, 0, sizeof(BIO_METHOD) );
+
+	method->type = type;
+	method->name = name;
+
+	return method;
+}
+
+static void
+BIO_meth_free( BIO_METHOD *meth )
+{
+	if ( meth == NULL ) {
+		return;
+	}
+
+	LDAP_FREE( meth );
+}
+
+#define BIO_meth_set_write(m, f) (m)->bwrite = (f)
+#define BIO_meth_set_read(m, f) (m)->bread = (f)
+#define BIO_meth_set_puts(m, f) (m)->bputs = (f)
+#define BIO_meth_set_gets(m, f) (m)->bgets = (f)
+#define BIO_meth_set_ctrl(m, f) (m)->ctrl = (f)
+#define BIO_meth_set_create(m, f) (m)->create = (f)
+#define BIO_meth_set_destroy(m, f) (m)->destroy = (f)
+
+#endif /* OpenSSL 1.1 */
+
 static STACK_OF(X509_NAME) *
 tlso_ca_list( char * bundle, char * dir )
 {
@@ -173,6 +224,8 @@ tlso_init( void )
 	/* FIXME: mod_ssl does this */
 	X509V3_add_standard_extensions();
 
+	tlso_bio_method = tlso_bio_setup();
+
 	return 0;
 }
 
@@ -184,6 +237,8 @@ tlso_destroy( void )
 {
 	struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT();   
 
+	BIO_meth_free( tlso_bio_method );
+
 #if OPENSSL_VERSION_NUMBER < 0x10100000
 	EVP_cleanup();
 #if OPENSSL_VERSION_NUMBER < 0x10000000
@@ -332,10 +387,9 @@ tlso_ctx_init( struct ldapoptions *lo, s
 		return -1;
 	}
 
-	if ( lo->ldo_tls_dhfile ) {
-		DH *dh = NULL;
+	if ( is_server && lo->ldo_tls_dhfile ) {
+		DH *dh;
 		BIO *bio;
-		SSL_CTX_set_options( ctx, SSL_OP_SINGLE_DH_USE );
 
 		if (( bio=BIO_new_file( lt->lt_dhfile,"r" )) == NULL ) {
 			Debug( LDAP_DEBUG_ANY,
@@ -354,6 +408,38 @@ tlso_ctx_init( struct ldapoptions *lo, s
 		}
 		BIO_free( bio );
 		SSL_CTX_set_tmp_dh( ctx, dh );
+		SSL_CTX_set_options( ctx, SSL_OP_SINGLE_DH_USE );
+		DH_free( dh );
+	}
+
+	if ( is_server && lo->ldo_tls_ecname ) {
+#ifdef OPENSSL_NO_EC
+		Debug( LDAP_DEBUG_ANY,
+			"TLS: Elliptic Curves not supported.\n", 0,0,0 );
+		return -1;
+#else
+		EC_KEY *ecdh;
+
+		int nid = OBJ_sn2nid( lt->lt_ecname );
+		if ( nid == NID_undef ) {
+			Debug( LDAP_DEBUG_ANY,
+				"TLS: could not use EC name `%s'.\n",
+				lo->ldo_tls_ecname,0,0);
+			tlso_report_error();
+			return -1;
+		}
+		ecdh = EC_KEY_new_by_curve_name( nid );
+		if ( ecdh == NULL ) {
+			Debug( LDAP_DEBUG_ANY,
+				"TLS: could not generate key for EC name `%s'.\n",
+				lo->ldo_tls_ecname,0,0);
+			tlso_report_error();
+			return -1;
+		}
+		SSL_CTX_set_tmp_ecdh( ctx, ecdh );
+		SSL_CTX_set_options( ctx, SSL_OP_SINGLE_ECDH_USE );
+		EC_KEY_free( ecdh );
+#endif
 	}
 
 	if ( tlso_opt_trace ) {
@@ -402,7 +488,20 @@ tlso_session_connect( LDAP *ld, tls_sess
 	tlso_session *s = (tlso_session *)sess;
 
 	/* Caller expects 0 = success, OpenSSL returns 1 = success */
-	return SSL_connect( s ) - 1;
+	int rc = SSL_connect( s ) - 1;
+#ifdef LDAP_USE_NON_BLOCKING_TLS
+	if ( rc < 0 ) {
+		int sockerr = sock_errno();
+		int sslerr = SSL_get_error( s, rc+1 );
+		if ( sslerr == SSL_ERROR_WANT_READ || sslerr == SSL_ERROR_WANT_WRITE ) {
+			rc = 0;
+		} else if ( sslerr == SSL_ERROR_SYSCALL &&
+			( sockerr == EAGAIN || sockerr == ENOTCONN )) {
+			rc = 0;
+		}
+	}
+#endif /* LDAP_USE_NON_BLOCKING_TLS */
+	return rc;
 }
 
 static int
@@ -827,33 +926,21 @@ tlso_bio_puts( BIO *b, const char *str )
 	return tlso_bio_write( b, str, strlen( str ) );
 }
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
-struct bio_method_st {
-    int type;
-    const char *name;
-    int (*bwrite) (BIO *, const char *, int);
-    int (*bread) (BIO *, char *, int);
-    int (*bputs) (BIO *, const char *);
-    int (*bgets) (BIO *, char *, int);
-    long (*ctrl) (BIO *, int, long, void *);
-    int (*create) (BIO *);
-    int (*destroy) (BIO *);
-    long (*callback_ctrl) (BIO *, int, bio_info_cb *);
-};
-#endif
-
-static BIO_METHOD tlso_bio_method =
+static BIO_METHOD *
+tlso_bio_setup( void )
 {
-	( 100 | 0x400 ),		/* it's a source/sink BIO */
-	"sockbuf glue",
-	tlso_bio_write,
-	tlso_bio_read,
-	tlso_bio_puts,
-	tlso_bio_gets,
-	tlso_bio_ctrl,
-	tlso_bio_create,
-	tlso_bio_destroy
-};
+	/* it's a source/sink BIO */
+	BIO_METHOD * method = BIO_meth_new( 100 | 0x400, "sockbuf glue" );
+	BIO_meth_set_write( method, tlso_bio_write );
+	BIO_meth_set_read( method, tlso_bio_read );
+	BIO_meth_set_puts( method, tlso_bio_puts );
+	BIO_meth_set_gets( method, tlso_bio_gets );
+	BIO_meth_set_ctrl( method, tlso_bio_ctrl );
+	BIO_meth_set_create( method, tlso_bio_create );
+	BIO_meth_set_destroy( method, tlso_bio_destroy );
+
+	return method;
+}
 
 static int
 tlso_sb_setup( Sockbuf_IO_Desc *sbiod, void *arg )
@@ -870,7 +957,7 @@ tlso_sb_setup( Sockbuf_IO_Desc *sbiod, v
 	
 	p->session = arg;
 	p->sbiod = sbiod;
-	bio = BIO_new( &tlso_bio_method );
+	bio = BIO_new( tlso_bio_method );
 	BIO_set_data( bio, p );
 	SSL_set_bio( p->session, bio, bio );
 	sbiod->sbiod_pvt = p;
@@ -1191,11 +1278,13 @@ tlso_seed_PRNG( const char *randfile )
 		 * The fact is that when $HOME is NULL, .rnd is used.
 		 */
 		randfile = RAND_file_name( buffer, sizeof( buffer ) );
-
-	} else if (RAND_egd(randfile) > 0) {
+	}
+#ifndef OPENSSL_NO_EGD
+	else if (RAND_egd(randfile) > 0) {
 		/* EGD socket */
 		return 0;
 	}
+#endif
 
 	if (randfile == NULL) {
 		Debug( LDAP_DEBUG_ANY,

Index: src/external/bsd/openldap/dist/libraries/liblutil/detach.c
diff -u src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.5 src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.6
--- src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.5	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/liblutil/detach.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: detach.c,v 1.5 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: detach.c,v 1.6 2019/08/08 13:50:57 christos Exp $	*/
 
 /* detach.c -- routines to daemonize a process */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: detach.c,v 1.5 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: detach.c,v 1.6 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 
Index: src/external/bsd/openldap/dist/libraries/liblutil/md5.c
diff -u src/external/bsd/openldap/dist/libraries/liblutil/md5.c:1.5 src/external/bsd/openldap/dist/libraries/liblutil/md5.c:1.6
--- src/external/bsd/openldap/dist/libraries/liblutil/md5.c:1.5	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/liblutil/md5.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: md5.c,v 1.5 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: md5.c,v 1.6 2019/08/08 13:50:57 christos Exp $	*/
 
 /* md5.c -- MD5 message-digest algorithm */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
    public domain.  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: md5.c,v 1.5 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: md5.c,v 1.6 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 

Index: src/external/bsd/openldap/dist/libraries/liblutil/passwd.c
diff -u src/external/bsd/openldap/dist/libraries/liblutil/passwd.c:1.6 src/external/bsd/openldap/dist/libraries/liblutil/passwd.c:1.7
--- src/external/bsd/openldap/dist/libraries/liblutil/passwd.c:1.6	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/liblutil/passwd.c	Thu Aug  8 09:50:57 2019
@@ -1,9 +1,9 @@
-/*	$NetBSD: passwd.c,v 1.6 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: passwd.c,v 1.7 2019/08/08 13:50:57 christos Exp $	*/
 
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: passwd.c,v 1.6 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: passwd.c,v 1.7 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 

Index: src/external/bsd/openldap/dist/libraries/librewrite/session.c
diff -u src/external/bsd/openldap/dist/libraries/librewrite/session.c:1.4 src/external/bsd/openldap/dist/libraries/librewrite/session.c:1.5
--- src/external/bsd/openldap/dist/libraries/librewrite/session.c:1.4	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/libraries/librewrite/session.c	Thu Aug  8 09:50:57 2019
@@ -1,9 +1,9 @@
-/*	$NetBSD: session.c,v 1.4 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: session.c,v 1.5 2019/08/08 13:50:57 christos Exp $	*/
 
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2017 The OpenLDAP Foundation.
+ * Copyright 2000-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Index: src/external/bsd/openldap/dist/servers/slapd/filter.c
diff -u src/external/bsd/openldap/dist/servers/slapd/filter.c:1.5 src/external/bsd/openldap/dist/servers/slapd/filter.c:1.6
--- src/external/bsd/openldap/dist/servers/slapd/filter.c:1.5	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/servers/slapd/filter.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: filter.c,v 1.5 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: filter.c,v 1.6 2019/08/08 13:50:57 christos Exp $	*/
 
 /* filter.c - routines for parsing and dealing with filters */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: filter.c,v 1.5 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: filter.c,v 1.6 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 

Index: src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c
diff -u src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.4 src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.5
--- src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.4	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c	Thu Aug  8 09:50:57 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: deref.c,v 1.4 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: deref.c,v 1.5 2019/08/08 13:50:57 christos Exp $	*/
 
 /* deref.c - dereference overlay */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * Portions Copyright 2008 Pierangelo Masarati.
  * All rights reserved.
  *
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: deref.c,v 1.4 2018/02/06 01:57:23 christos Exp $");
+__RCSID("$NetBSD: deref.c,v 1.5 2019/08/08 13:50:57 christos Exp $");
 
 #include "portable.h"
 

Index: src/external/bsd/openldap/include/ldap_features.h
diff -u src/external/bsd/openldap/include/ldap_features.h:1.5 src/external/bsd/openldap/include/ldap_features.h:1.6
--- src/external/bsd/openldap/include/ldap_features.h:1.5	Wed May 28 07:09:18 2014
+++ src/external/bsd/openldap/include/ldap_features.h	Thu Aug  8 09:50:57 2019
@@ -22,10 +22,10 @@
 #define _LDAP_FEATURES_H 1
 
 /* OpenLDAP API version macros */
-#define LDAP_VENDOR_VERSION 20439
+#define LDAP_VENDOR_VERSION 20448
 #define LDAP_VENDOR_VERSION_MAJOR 2
 #define LDAP_VENDOR_VERSION_MINOR 4
-#define LDAP_VENDOR_VERSION_PATCH 39
+#define LDAP_VENDOR_VERSION_PATCH 48
 
 /*
 ** WORK IN PROGRESS!

Index: src/external/bsd/openldap/include/portable.h
diff -u src/external/bsd/openldap/include/portable.h:1.7 src/external/bsd/openldap/include/portable.h:1.8
--- src/external/bsd/openldap/include/portable.h:1.7	Thu Jan 12 18:03:49 2017
+++ src/external/bsd/openldap/include/portable.h	Thu Aug  8 09:50:57 2019
@@ -5,7 +5,7 @@
 /* begin of portable.h.pre */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2014 The OpenLDAP Foundation
+ * Copyright 1998-2019 The OpenLDAP Foundation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -852,7 +852,7 @@
 #define LDAP_SYSLOG 1
 
 /* Version */
-#define LDAP_VENDOR_VERSION 20439
+#define LDAP_VENDOR_VERSION 20448
 
 /* Major */
 #define LDAP_VENDOR_VERSION_MAJOR 2
@@ -861,7 +861,7 @@
 #define LDAP_VENDOR_VERSION_MINOR 4
 
 /* Patch */
-#define LDAP_VENDOR_VERSION_PATCH 39
+#define LDAP_VENDOR_VERSION_PATCH 48
 
 /* define if memcmp is not 8-bit clean or is otherwise broken */
 /* #undef NEED_MEMCMP_REPLACEMENT */
@@ -876,7 +876,7 @@
 #define OPENLDAP_PACKAGE "OpenLDAP"
 
 /* Version */
-#define OPENLDAP_VERSION "2.4.39"
+#define OPENLDAP_VERSION "2.4.48"
 
 /* Define to the address where bug reports for this package should be sent. */
 #define PACKAGE_BUGREPORT ""

Reply via email to