Your message dated Sat, 12 Jan 2019 23:00:19 +0000
with message-id <e1gisgj-0000dk...@fasolo.debian.org>
and subject line Bug#794999: fixed in openldap 2.4.47+dfsg-2
has caused the Debian Bug report #794999,
regarding openldap: include pbkdf2 contrib module into Debian's openldap 
packages
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
794999: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794999
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: openldap
Version: 2.4.41+dfsg-1
Severity: wishlist
Tags: upstream patch

Hi,

please include the pbkdf2 contrib module in Debian's openldap packages.

The attacked patch does this:

* It starts by preparing contrib/password/pbkdf2/pw-pdkdf2.c to work with nettle
  * debian/patches/TS8198-0001-fix-an-always-true-check.patch
    patch is taken from upstream ITS#8198
  * ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch

* Then it adapts contrib/password/pbkdf2/Makefile to follow Debian's rules
  * pbkdf2-makefile-use-dpkg-buildflags
  * pbkdf2-makefile

* Of course it doesn't forget to add a manual page
  (derived from a patch I sent upstream as a part of ITS#8205)
  * pbkdf2-makefile-manpage

* Finally it updates debian/rules to make sure the module's files get compiled
  and installed

I have this patch included in my private packaging of openldap.

When creating the patch, I tried to
* avoid changing existing patches
  That's the reason for the 'pbkdf2-makefile-use-dpkg-buildflags' patch file.
  Feel free to merge it into 'contrib-modules-use-dpkg-buildflags'
* adhere to existing patch naming logic
  e.g. 'pbkdf2-makefile'
  
Thanks for your work on openldap in Debian!

Best
Peter

PS: support for getting ITS#8198 and ITS#8205 included upstream is very welcome


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.0.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From 755e6302f3f095919eed04d1849172cc61d42d8d Mon Sep 17 00:00:00 2001
From: Peter Marschall <pe...@adpm.de>
Date: Sat, 8 Aug 2015 12:26:57 +0200
Subject: [PATCH] build and install pw-pbkdf2

Start by preparing contrib/password/pbkdf2/pw-pdkdf2.c to work with nettle
* debian/patches/TS8198-0001-fix-an-always-true-check.patch
  patch is taken from upstream ITS#8198
* ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch

Then adapt contrib/password/pbkdf2/Makefile to follow Debian's rules
* pbkdf2-makefile-use-dpkg-buildflags
* pbkdf2-makefile

Don't forget to add a manual page (taken from a patch upstreamed in ITS#8205)
* pbkdf2-makefile-manpage

Finally compile & install it by adapting debian/rules
---
 .../ITS8198-0001-fix-an-always-true-check.patch    |  48 +++++
 ...e-libnettle-instead-of-openssl-for-crypto.patch | 196 +++++++++++++++++++++
 debian/patches/pbkdf2-makefile                     |  43 +++++
 debian/patches/pbkdf2-makefile-manpage             | 184 +++++++++++++++++++
 debian/patches/pbkdf2-makefile-use-dpkg-buildflags |  19 ++
 debian/patches/series                              |   5 +
 debian/rules                                       |   2 +
 7 files changed, 497 insertions(+)
 create mode 100644 debian/patches/ITS8198-0001-fix-an-always-true-check.patch
 create mode 100644 debian/patches/ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch
 create mode 100644 debian/patches/pbkdf2-makefile
 create mode 100644 debian/patches/pbkdf2-makefile-manpage
 create mode 100644 debian/patches/pbkdf2-makefile-use-dpkg-buildflags

diff --git a/debian/patches/ITS8198-0001-fix-an-always-true-check.patch b/debian/patches/ITS8198-0001-fix-an-always-true-check.patch
new file mode 100644
index 0000000..f67297e
--- /dev/null
+++ b/debian/patches/ITS8198-0001-fix-an-always-true-check.patch
@@ -0,0 +1,48 @@
+From f9e42bc1ce85a8c2bc7f3daa06a553b0f79ea6d8 Mon Sep 17 00:00:00 2001
+From: Luca Bruno <luca.br...@rocket-internet.de>
+Date: Wed, 5 Nov 2014 16:15:55 +0100
+Subject: [PATCH] Fix an always-true check
+
+Fixed asprintf return value check, in order to properly catch
+error conditions. This has been caught by clang -Wtautological-compare:
+
+pw-pbkdf2.c:132:17: warning: comparison of unsigned expression < 0 is always false
+        if(msg->bv_len < 0){
+           ~~~~~~~~~~~ ^ ~
+
+Signed-off-by: Luca Bruno <luca.br...@rocket-internet.de>
+---
+ contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c b/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
+index e7c300e..e0f5dfd 100644
+--- a/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
++++ b/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
+@@ -99,7 +99,7 @@ static int pbkdf2_format(
+ 	struct berval *msg)
+ {
+ 
+-	int rc;
++	int rc, msg_len;
+ 	char salt_b64[LUTIL_BASE64_ENCODE_LEN(PBKDF2_SALT_SIZE) + 1];
+ 	char dk_b64[LUTIL_BASE64_ENCODE_LEN(PBKDF2_MAX_DK_SIZE) + 1];
+ 
+@@ -115,13 +115,15 @@ static int pbkdf2_format(
+ 		return LUTIL_PASSWD_ERR;
+ 	}
+ 	b64_to_ab64(dk_b64);
+-	msg->bv_len = asprintf(&msg->bv_val, "%s%d$%s$%s",
++	msg_len = asprintf(&msg->bv_val, "%s%d$%s$%s",
+ 						   sc->bv_val, iteration,
+ 						   salt_b64, dk_b64);
+-	if(msg->bv_len < 0){
++	if(msg_len < 0){
++		msg->bv_len = 0;
+ 		return LUTIL_PASSWD_ERR;
+ 	}
+ 
++	msg->bv_len = msg_len;
+ 	return LUTIL_PASSWD_OK;
+ }
+ 
diff --git a/debian/patches/ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch b/debian/patches/ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch
new file mode 100644
index 0000000..75cb2a8
--- /dev/null
+++ b/debian/patches/ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch
@@ -0,0 +1,196 @@
+From b98457fbb009e92d394e0d99851fc720df334db7 Mon Sep 17 00:00:00 2001
+From: Luca Bruno <luca.br...@rocket-internet.de>
+Date: Wed, 5 Nov 2014 15:32:33 +0100
+Subject: [PATCH] Optionally use libnettle instead of OpenSSL for crypto
+
+OpenLDAP can be configured to be either built with OpenSSL or
+GnuTLS. This commit adds support for building pw-pbkbdf2 module
+without OpenSSL, by using PBKDF2 crypto primitives provided by
+libnettle.
+Closes hamano/openldap-pbkdf2#2
+
+Signed-off-by: Luca Bruno <luca.br...@rocket-internet.de>
+---
+ contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c | 104 ++++++++++++++++++++++++
+ 1 file changed, 104 insertions(+)
+
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c b/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
+index e0f5dfd..8355908 100644
+--- a/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
++++ b/contrib/slapd-modules/passwd/pbkdf2/pw-pbkdf2.c
+@@ -22,8 +22,19 @@
+ #include <ac/string.h>
+ #include "lber_pvt.h"
+ #include "lutil.h"
++#include <stdio.h>
++#include <stdlib.h>
+ 
++#ifdef HAVE_OPENSSL
+ #include <openssl/evp.h>
++#elif HAVE_GNUTLS
++#include <nettle/pbkdf2.h>
++#include <nettle/hmac.h>
++typedef void (*pbkdf2_hmac_update)(void *, unsigned, const uint8_t *);
++typedef void (*pbkdf2_hmac_digest)(void *, unsigned, uint8_t *);
++#else
++#error Unsupported crypto backend.
++#endif
+ 
+ #define PBKDF2_ITERATION 10000
+ #define PBKDF2_SALT_SIZE 16
+@@ -139,11 +150,22 @@ static int pbkdf2_encrypt(
+ 	struct berval dk;
+ 	int iteration = PBKDF2_ITERATION;
+ 	int rc;
++#ifdef HAVE_OPENSSL
+ 	const EVP_MD *md;
++#else
++	struct hmac_sha1_ctx sha1_ctx;
++	struct hmac_sha256_ctx sha256_ctx;
++	struct hmac_sha512_ctx sha512_ctx;
++	void * current_ctx = NULL;
++	pbkdf2_hmac_update current_hmac_update = NULL;
++	pbkdf2_hmac_digest current_hmac_digest = NULL;
++#endif
+ 
+ 	salt.bv_val = (char *)salt_value;
+ 	salt.bv_len = sizeof(salt_value);
+ 	dk.bv_val = (char *)dk_value;
++
++#ifdef HAVE_OPENSSL
+ 	if(!ber_bvcmp(scheme, &pbkdf2_scheme)){
+ 		dk.bv_len = PBKDF2_SHA1_DK_SIZE;
+ 		md = EVP_sha1();
+@@ -159,16 +181,52 @@ static int pbkdf2_encrypt(
+ 	}else{
+ 		return LUTIL_PASSWD_ERR;
+ 	}
++#else
++	if(!ber_bvcmp(scheme, &pbkdf2_scheme)){
++		dk.bv_len = PBKDF2_SHA1_DK_SIZE;
++		current_ctx = &sha1_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha1_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha1_digest;
++		hmac_sha1_set_key(current_ctx, passwd->bv_len, (const uint8_t *) passwd->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha1_scheme)){
++		dk.bv_len = PBKDF2_SHA1_DK_SIZE;
++		current_ctx = &sha1_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha1_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha1_digest;
++		hmac_sha1_set_key(current_ctx, passwd->bv_len, (const uint8_t *) passwd->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha256_scheme)){
++		dk.bv_len = PBKDF2_SHA256_DK_SIZE;
++		current_ctx = &sha256_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha256_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha256_digest;
++		hmac_sha256_set_key(current_ctx, passwd->bv_len, (const uint8_t *) passwd->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha512_scheme)){
++		dk.bv_len = PBKDF2_SHA512_DK_SIZE;
++		current_ctx = &sha512_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha512_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha512_digest;
++		hmac_sha512_set_key(current_ctx, passwd->bv_len, (const uint8_t *) passwd->bv_val);
++	}else{
++		return LUTIL_PASSWD_ERR;
++	}
++#endif
+ 
+ 	if(lutil_entropy((unsigned char *)salt.bv_val, salt.bv_len) < 0){
+ 		return LUTIL_PASSWD_ERR;
+ 	}
+ 
++#ifdef HAVE_OPENSSL
+ 	if(!PKCS5_PBKDF2_HMAC(passwd->bv_val, passwd->bv_len,
+ 						  (unsigned char *)salt.bv_val, salt.bv_len,
+ 						  iteration, md, dk.bv_len, dk_value)){
+ 		return LUTIL_PASSWD_ERR;
+ 	}
++#else
++	PBKDF2(current_ctx, current_hmac_update, current_hmac_digest,
++						  dk.bv_len, iteration,
++						  salt.bv_len, (const uint8_t *) salt.bv_val,
++						  dk.bv_len, dk_value);
++#endif
+ 
+ #ifdef SLAPD_PBKDF2_DEBUG
+ 	printf("Encrypt for %s\n", scheme->bv_val);
+@@ -215,7 +273,16 @@ static int pbkdf2_check(
+ 	char dk_b64[LUTIL_BASE64_ENCODE_LEN(PBKDF2_MAX_DK_SIZE) + 1];
+ 	unsigned char input_dk_value[PBKDF2_MAX_DK_SIZE];
+ 	size_t dk_len;
++#ifdef HAVE_OPENSSL
+ 	const EVP_MD *md;
++#else
++	struct hmac_sha1_ctx sha1_ctx;
++	struct hmac_sha256_ctx sha256_ctx;
++	struct hmac_sha512_ctx sha512_ctx;
++	void * current_ctx = NULL;
++	pbkdf2_hmac_update current_hmac_update = NULL;
++	pbkdf2_hmac_digest current_hmac_digest = NULL;
++#endif
+ 
+ #ifdef SLAPD_PBKDF2_DEBUG
+ 	printf("Checking for %s\n", scheme->bv_val);
+@@ -223,6 +290,7 @@ static int pbkdf2_check(
+ 	printf("  Input Cred:\t%s\n", cred->bv_val);
+ #endif
+ 
++#ifdef HAVE_OPENSSL
+ 	if(!ber_bvcmp(scheme, &pbkdf2_scheme)){
+ 		dk_len = PBKDF2_SHA1_DK_SIZE;
+ 		md = EVP_sha1();
+@@ -238,6 +306,35 @@ static int pbkdf2_check(
+ 	}else{
+ 		return LUTIL_PASSWD_ERR;
+ 	}
++#else
++	if(!ber_bvcmp(scheme, &pbkdf2_scheme)){
++		dk_len = PBKDF2_SHA1_DK_SIZE;
++		current_ctx = &sha1_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha1_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha1_digest;
++		hmac_sha1_set_key(current_ctx, cred->bv_len, (const uint8_t *) cred->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha1_scheme)){
++		dk_len = PBKDF2_SHA1_DK_SIZE;
++		current_ctx = &sha1_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha1_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha1_digest;
++		hmac_sha1_set_key(current_ctx, cred->bv_len, (const uint8_t *) cred->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha256_scheme)){
++		dk_len = PBKDF2_SHA256_DK_SIZE;
++		current_ctx = &sha256_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha256_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha256_digest;
++		hmac_sha256_set_key(current_ctx, cred->bv_len, (const uint8_t *) cred->bv_val);
++	}else if(!ber_bvcmp(scheme, &pbkdf2_sha512_scheme)){
++		dk_len = PBKDF2_SHA512_DK_SIZE;
++		current_ctx = &sha512_ctx;
++		current_hmac_update = (pbkdf2_hmac_update) &hmac_sha512_update;
++		current_hmac_digest = (pbkdf2_hmac_digest) &hmac_sha512_digest;
++		hmac_sha512_set_key(current_ctx, cred->bv_len, (const uint8_t *) cred->bv_val);
++	}else{
++		return LUTIL_PASSWD_ERR;
++	}
++#endif
+ 
+ 	iteration = atoi(passwd->bv_val);
+ 	if(iteration < 1){
+@@ -287,11 +384,18 @@ static int pbkdf2_check(
+ 		return LUTIL_PASSWD_ERR;
+ 	}
+ 
++#ifdef HAVE_OPENSSL
+ 	if(!PKCS5_PBKDF2_HMAC(cred->bv_val, cred->bv_len,
+ 						  salt_value, PBKDF2_SALT_SIZE,
+ 						  iteration, md, dk_len, input_dk_value)){
+ 		return LUTIL_PASSWD_ERR;
+ 	}
++#else
++	PBKDF2(current_ctx, current_hmac_update, current_hmac_digest,
++						  dk_len, iteration,
++						  PBKDF2_SALT_SIZE, salt_value,
++						  dk_len, input_dk_value);
++#endif
+ 
+ 	rc = memcmp(dk_value, input_dk_value, dk_len);
+ #ifdef SLAPD_PBKDF2_DEBUG
diff --git a/debian/patches/pbkdf2-makefile b/debian/patches/pbkdf2-makefile
new file mode 100644
index 0000000..a943c2e
--- /dev/null
+++ b/debian/patches/pbkdf2-makefile
@@ -0,0 +1,43 @@
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/Makefile b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+index 64ad97c..1bb0826 100644
+--- a/contrib/slapd-modules/passwd/pbkdf2/Makefile
++++ b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+@@ -2,30 +2,30 @@
+ 
+ LDAP_SRC = ../../../..
+ LDAP_BUILD = ../../../..
+-LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
+-LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
+-	$(LDAP_BUILD)/libraries/liblber/liblber.la
++LDAP_INC = -I$(LDAP_BUILD)/debian/build/include -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
++LDAP_LIB = $(LDAP_BUILD)/debian/build/libraries/libldap_r/libldap_r.la \
++	$(LDAP_BUILD)/debian/build/libraries/liblber/liblber.la
+ 
+-LIBTOOL = $(LDAP_BUILD)/libtool
++LIBTOOL = $(LDAP_BUILD)/debian/build/libtool
+ CC = gcc
+ OPT = -g -O2 -Wall
+ #DEFS = -DSLAPD_PBKDF2_DEBUG
+ 
+ INCS = $(LDAP_INC)
+-LIBS = $(LDAP_LIB) -lcrypto
++LIBS = $(LDAP_LIB) -lnettle
+ 
+ PROGRAMS = pw-pbkdf2.la
+ LTVER = 0:0:0
+ 
+ #prefix=/usr/local
+-prefix=`grep -e "^prefix =" $(LDAP_BUILD)/Makefile | cut -d= -f2`
++prefix=/usr
+ 
+ exec_prefix=$(prefix)
+-ldap_subdir=/openldap
++ldap_subdir=/ldap
+ 
+ libdir=$(exec_prefix)/lib
+ libexecdir=$(exec_prefix)/libexec
+-moduledir = $(libexecdir)$(ldap_subdir)
++moduledir = $(libdir)$(ldap_subdir)
+ 
+ .SUFFIXES: .c .o .lo
+ 
diff --git a/debian/patches/pbkdf2-makefile-manpage b/debian/patches/pbkdf2-makefile-manpage
new file mode 100644
index 0000000..aa08375
--- /dev/null
+++ b/debian/patches/pbkdf2-makefile-manpage
@@ -0,0 +1,184 @@
+From: Peter Marschall <pe...@adpm.de>
+Date: Sat, 8 Aug 2015 17:32:04 +0200
+Subject: [PATCH] contrib/passwd/pbkdf2: add man page, install it too
+
+Add a manual page slapd-pw-pbkdf2.5 and update passwd/pbkdf2's Makefile to
+install the new manual page.
+
+This patch is derived from the corresponding patch upstreamed in ITS#8205
+
+---
+ contrib/slapd-modules/passwd/pbkdf2/Makefile       |  15 ++-
+ .../slapd-modules/passwd/pbkdf2/slapd-pw-pbkdf2.5  | 112 +++++++++++++++++++++
+ 2 files changed, 126 insertions(+), 1 deletion(-)
+ create mode 100644 contrib/slapd-modules/passwd/pbkdf2/slapd-pw-pbkdf2.5
+
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/Makefile b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+index 64ad97c..fa98b0f 100644
+--- a/contrib/slapd-modules/passwd/pbkdf2/Makefile
++++ b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+@@ -7,6 +7,7 @@
+ 	$(LDAP_BUILD)/debian/build/libraries/liblber/liblber.la
+ 
+ LIBTOOL = $(LDAP_BUILD)/debian/build/libtool
++INSTALL = /usr/bin/install
+ CC = gcc
+ OPT = -g -O2 -Wall
+ #DEFS = -DSLAPD_PBKDF2_DEBUG
+@@ -15,6 +16,7 @@
+ LIBS = $(LDAP_LIB) -lnettle
+ 
+ PROGRAMS = pw-pbkdf2.la
++MANPAGES = slapd-pw-pbkdf2.5
+ LTVER = 0:0:0
+ 
+ #prefix=/usr/local
+@@ -26,6 +28,8 @@
+ libdir=$(exec_prefix)/lib
+ libexecdir=$(exec_prefix)/libexec
+ moduledir = $(libdir)$(ldap_subdir)
++mandir = $(exec_prefix)/share/man
++man5dir = $(mandir)/man5
+ 
+ .SUFFIXES: .c .o .lo
+ 
+@@ -41,8 +45,17 @@
+ clean:
+ 	rm -rf *.o *.lo *.la .libs
+ 
+-install:	$(PROGRAMS)
++install: install-lib install-man FORCE
++
++install-lib: $(PROGRAMS)
+ 	mkdir -p $(DESTDIR)$(moduledir)
+ 	for p in $(PROGRAMS) ; do \
+ 		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
+ 	done
++
++install-man: $(MANPAGES)
++	mkdir -p  $(DESTDIR)$(man5dir)
++	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)
++
++FORCE:
++
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/slapd-pw-pbkdf2.5 b/contrib/slapd-modules/passwd/pbkdf2/slapd-pw-pbkdf2.5
+new file mode 100644
+index 0000000..3556cc6
+--- /dev/null
++++ b/contrib/slapd-modules/passwd/pbkdf2/slapd-pw-pbkdf2.5
+@@ -0,0 +1,112 @@
++.TH SLAPD-PW-PBKDF2 5 "RELEASEDATE" "OpenLDAP LDVERSION"
++.\" Copyright 2015 The OpenLDAP Foundation All Rights Reserved.
++.\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
++.\" $OpenLDAP$
++.SH NAME
++slapd-pw-pbkdf2 \- SHA-2 password module to slapd
++.SH SYNOPSIS
++ETCDIR/slapd.conf
++.RS
++.LP
++.B moduleload
++.B pw-pbkdf2
++.RE
++.SH DESCRIPTION
++.LP
++The 
++.B pw-pbkdf2
++module to
++.BR slapd (8)
++provides support for the use of the key stretching function
++PBKDF2 (Password-Based Key Derivation Function 2) following RFC 2898
++in hashed passwords in OpenLDAP.
++.LP
++It does so by providing the following additional password schemes for use in slapd:
++.RS
++.TP
++.B {PBKDF2}
++alias to {PBKDF2-SHA1}
++.TP
++.B {PBKDF2-SHA1}
++PBKDF2 using HMAC-SHA-1 as the underlying pseudorandom function
++.TP
++.B {PBKDF2-SHA256}
++PBKDF2 using HMAC-SHA-256 as the underlying pseudorandom function
++.TP
++.B {PBKDF2-SHA512}
++PBKDF2 using HMAC-SHA-512 as the underlying pseudorandom function
++.RE
++
++.SH CONFIGURATION
++The 
++.B pw-pbkdf2
++module does not need any configuration.
++.LP
++After loading the module, the password schemes
++{PBKDF2}, {PBKDF2-SHA1}, {PBKDF2-SHA256}, and {PBKDF2-SHA512}
++will be recognised in values of the
++.I userPassword
++attribute.
++.LP
++You can then instruct OpenLDAP to use these schemes when processing
++the LDAPv3 Password Modify (RFC 3062) extended operations by using the
++.BR password-hash
++option in
++.BR slapd.conf (5).
++
++.SH NOTES
++If you want to use the schemes described here with
++.BR slappasswd (8),
++don't forget to load the module using its command line options.
++The relevant option/value is:
++.RS
++.LP
++.B \-o
++.BR module\-load = pw-pbkdf2
++.LP
++.RE
++Depending on
++.BR pw-pbkdf2 's
++location, you may also need:
++.RS
++.LP
++.B \-o
++.BR module\-path = \fIpathspec\fP
++.RE
++
++.SH EXAMPLES
++All of the userPassword LDAP attributes below encode the password
++.RI ' secret '.
++.EX
++.LP
++userPassword: {PBKDF2-SHA512}10000$/oQ4xZi382mk7kvCd3ZdkA$2wqjpuyV2l0U/a1QwoQPOtlQL.UcJGNACj1O24balruqQb/NgPW6OCvvrrJP8.SzA3/5iYvLnwWPzeX8IK/bEQ
++.LP
++userPassword: {PBKDF2-SHA256}10000$jq40ImWtmpTE.aYDYV1GfQ$mpiL4ui02ACmYOAnCjp/MI1gQk50xLbZ54RZneU0fCg
++.LP
++userPassword: {PBKDF2-SHA1}10000$QJTEclnXgh9Cz3ChCWpdAg$9.s98jwFJM.NXJK9ca/oJ5AyoAQ
++.EE
++.LP
++To make {PBKDF2-SHA512} the password hash used in Password Modify extended operations,
++simply set this line in slapd.conf(5):
++.EX
++.LP
++password-hash   {PBKDF2-SHA512}
++.EX
++
++.SH SEE ALSO
++.BR slapd.conf (5),
++.BR ldappasswd (1),
++.BR slappasswd (8),
++.BR ldap (3),
++.LP
++"OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
++.LP
++
++.SH ACKNOWLEDGEMENTS
++This manual page has been writen by Peter Marschall based on the
++module's README file written by HAMANO Tsukasa <ham...@osstech.co.jp>
++.LP
++.B OpenLDAP
++is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
++.B OpenLDAP
++is derived from University of Michigan LDAP 3.3 Release.
+-- 
+2.5.0
+
diff --git a/debian/patches/pbkdf2-makefile-use-dpkg-buildflags b/debian/patches/pbkdf2-makefile-use-dpkg-buildflags
new file mode 100644
index 0000000..72be40f
--- /dev/null
+++ b/debian/patches/pbkdf2-makefile-use-dpkg-buildflags
@@ -0,0 +1,19 @@
+diff --git a/contrib/slapd-modules/passwd/pbkdf2/Makefile b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+index 64ad97c..b23c5c1 100644
+--- a/contrib/slapd-modules/passwd/pbkdf2/Makefile
++++ b/contrib/slapd-modules/passwd/pbkdf2/Makefile
+@@ -30,12 +30,12 @@ moduledir = $(libexecdir)$(ldap_subdir)
+ .SUFFIXES: .c .o .lo
+ 
+ .c.lo:
+-	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
++	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
+ 
+ all:		$(PROGRAMS)
+ 
+ pw-pbkdf2.la: pw-pbkdf2.lo
+-	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
++	$(LIBTOOL) --mode=link $(CC) $(OPT) $(LDFLAGS) -version-info $(LTVER) \
+ 	-rpath $(moduledir) -module -o $@ $? $(LIBS)
+ 
+ clean:
diff --git a/debian/patches/series b/debian/patches/series
index 87dda63..c2dd376 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -26,3 +26,8 @@ ITS6035-olcauthzregex-needs-restart.patch
 starttls-MSbug.patch
 listmatch.patch
 facsimileNumberMatch.patch
+ITS8198-0001-fix-an-always-true-check.patch
+ITS8198-0002-optionally-use-libnettle-instead-of-openssl-for-crypto.patch
+pbkdf2-makefile-use-dpkg-buildflags
+pbkdf2-makefile
+pbkdf2-makefile-manpage
diff --git a/debian/rules b/debian/rules
index 1196dd6..4fa1f36 100755
--- a/debian/rules
+++ b/debian/rules
@@ -91,6 +91,7 @@ override_dh_auto_build:
 	$(MAKE) -C contrib/slapd-modules/autogroup
 	$(MAKE) -C contrib/slapd-modules/lastbind
 	$(MAKE) -C contrib/slapd-modules/passwd/sha2
+	$(MAKE) -C contrib/slapd-modules/passwd/pbkdf2
 
 override_dh_auto_install:
 	dh_auto_install -- $(MAKEVARS)
@@ -98,6 +99,7 @@ override_dh_auto_install:
 	$(MAKE) -C contrib/slapd-modules/autogroup install DESTDIR=$(installdir)
 	$(MAKE) -C contrib/slapd-modules/lastbind install DESTDIR=$(installdir)
 	$(MAKE) -C contrib/slapd-modules/passwd/sha2 install DESTDIR=$(installdir)
+	$(MAKE) -C contrib/slapd-modules/passwd/pbkdf2 install DESTDIR=$(installdir)
 
 	# Empty the dependency_libs file in the .la files.
 	for F in $(installdir)/usr/lib/ldap/*.la; do \
-- 
2.5.0


--- End Message ---
--- Begin Message ---
Source: openldap
Source-Version: 2.4.47+dfsg-2

We believe that the bug you reported is fixed in the latest version of
openldap, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 794...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ryan Tandy <r...@nardis.ca> (supplier of updated openldap package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 12 Jan 2019 11:18:03 -0800
Source: openldap
Binary: slapd slapd-contrib slapd-smbk5pwd ldap-utils libldap-2.4-2 
libldap-common libldap2-dev slapi-dev
Architecture: source amd64 all
Version: 2.4.47+dfsg-2
Distribution: unstable
Urgency: medium
Maintainer: Debian OpenLDAP Maintainers 
<pkg-openldap-de...@lists.alioth.debian.org>
Changed-By: Ryan Tandy <r...@nardis.ca>
Description:
 ldap-utils - OpenLDAP utilities
 libldap-2.4-2 - OpenLDAP libraries
 libldap-common - OpenLDAP common files for libraries
 libldap2-dev - OpenLDAP development libraries
 slapd      - OpenLDAP server (slapd)
 slapd-contrib - contributed plugins for OpenLDAP slapd
 slapd-smbk5pwd - transitional package for slapd-contrib
 slapi-dev  - development libraries for OpenLDAP SLAPI plugin interface
Closes: 592362 711469 794999 803197
Changes:
 openldap (2.4.47+dfsg-2) unstable; urgency=medium
 .
   * Reintroduce slapi-dev binary package. (Closes: #711469)
     Thanks to Florian Schlichting.
   * Do not call gnutls_global_set_mutex(). (Closes: #803197)
   * Use dh_auto_* to build and install contrib modules.
     - Stop patching the clean rule in smbk5pwd's Makefile.
   * Explicitly list overlays and man pages installed by slapd package in
     slapd.install and slapd.manpages files.
   * Set common variables for contrib Makefiles by make(1) command line instead
     of patching every Makefile.
   * Build and install more contrib plugins in a new slapd-contrib package:
     - pw-apr1 and pw-netscape (Closes: #592362)
     - pw-pbkdf2 (Closes: #794999)
   * Import the slapo-pw-pbkdf2 man page from upstream git master and install
     it with the slapd-contrib package.
   * Add smbk5pwd to slapd-contrib and turn slapd-smbk5pwd into a transitional
     package. Drop smbk5pwd README since it now has a man page which is a
     better resource for users.
     - Use Breaks to ensure that slapd is not upgraded in between removing the
       old smbk5pwd module and installing the new one.
   * Include the apr1-atol.pl and apr1-lota.pl helper scripts in the
     slapd-contrib package as examples.
   * Merge remaining contrib Makefile patches into a single contrib-makefiles
     patch.
Checksums-Sha1:
 6ea2706becff7859a8633d9302132f2b8d4390d3 2835 openldap_2.4.47+dfsg-2.dsc
 b8e056e0364b49654909ec368232574f6ba9bc8e 165044 
openldap_2.4.47+dfsg-2.debian.tar.xz
 5030c1a1f9017f125a5bd525f20d6ac5656c5d0b 538576 
ldap-utils-dbgsym_2.4.47+dfsg-2_amd64.deb
 5d567919ec40187c3ac109cb7669421629368ae4 197276 
ldap-utils_2.4.47+dfsg-2_amd64.deb
 120fa5ed3aecaab66530d16c401f1756ebe69798 515492 
libldap-2.4-2-dbgsym_2.4.47+dfsg-2_amd64.deb
 462c00137c1b4af224e287e0547170e08160a270 224300 
libldap-2.4-2_2.4.47+dfsg-2_amd64.deb
 db1af3d25f0456a471b8b2142bd6ab754f31cb08 89200 
libldap-common_2.4.47+dfsg-2_all.deb
 25a3bb90e941887d0d10d372086314cf233e1e16 330860 
libldap2-dev_2.4.47+dfsg-2_amd64.deb
 3adafa2b76a1c6a21e15d4d4473a2aae8d00670c 10446 
openldap_2.4.47+dfsg-2_amd64.buildinfo
 c0f4df300b19520c0163e95481543aeebc96f72a 61904 
slapd-contrib-dbgsym_2.4.47+dfsg-2_amd64.deb
 57a5a8a5c355ea682d42f2d13d58a0f82498d97a 99984 
slapd-contrib_2.4.47+dfsg-2_amd64.deb
 64b92d46804d421e7570a86e42cdf74334af4723 6967704 
slapd-dbgsym_2.4.47+dfsg-2_amd64.deb
 ab258a75b6a93575bf93deca3fc50b6a6683f747 82512 
slapd-smbk5pwd_2.4.47+dfsg-2_all.deb
 11922d8b2a1859b98669db19c5d17666035e248b 1433548 slapd_2.4.47+dfsg-2_amd64.deb
 0f5a104766bb98d12184cc2570d32f847b894647 90096 
slapi-dev_2.4.47+dfsg-2_amd64.deb
Checksums-Sha256:
 0cf3ee5ddb7515fc063bb23103e58b2a5c591526e96959fe28a0c058e914ca87 2835 
openldap_2.4.47+dfsg-2.dsc
 5958da264391619c780973772b07b611da0ea52f3e0ebd6175f394b2addf8d7a 165044 
openldap_2.4.47+dfsg-2.debian.tar.xz
 b1ed73404e6fba6503a054c72d802fbf7cc26c28ae6c3134c9208d7acfbdc6d7 538576 
ldap-utils-dbgsym_2.4.47+dfsg-2_amd64.deb
 13f4c076d4f0f96454ef0bf79b6062ff1e355b0ffed26d64d806d24c726cdc1a 197276 
ldap-utils_2.4.47+dfsg-2_amd64.deb
 e23208498351b4d217f9a23d3f314e8802c9642a6d47a99542de0f7a62c35d6f 515492 
libldap-2.4-2-dbgsym_2.4.47+dfsg-2_amd64.deb
 8b599568d2b293b021d801bd01b9c76861f9dfce31a37a3822d2b510cca23140 224300 
libldap-2.4-2_2.4.47+dfsg-2_amd64.deb
 a9b6b6eac6afcdb957f7d5aa9612f46324c66c1763c4f090eb09038d031e20c9 89200 
libldap-common_2.4.47+dfsg-2_all.deb
 f2720d8ca1fefad3b4bb58ed6c7872a860b6d7406a6424ebaf23274693ecbdac 330860 
libldap2-dev_2.4.47+dfsg-2_amd64.deb
 bb46be582390ca6f152422e91e986a8baba4a702322e82942d43a18a4ad59f0a 10446 
openldap_2.4.47+dfsg-2_amd64.buildinfo
 ef25e26e3f70c33dcadd42a5611f30d4408b3988e2d089068b0375e242fd65a7 61904 
slapd-contrib-dbgsym_2.4.47+dfsg-2_amd64.deb
 04ef323dac41123e8bf67e2eeff2c27c558e91e3e82161565c73ca351f9338b1 99984 
slapd-contrib_2.4.47+dfsg-2_amd64.deb
 f61126bf21d9b30da6d31bcbf55e1a6e459a42e0900f0174b4283e946dc4d156 6967704 
slapd-dbgsym_2.4.47+dfsg-2_amd64.deb
 ab37baf3d5b7dfda7cb6c23cdc8e9ccaf6b8686f88633686ad3c33d4e277f16d 82512 
slapd-smbk5pwd_2.4.47+dfsg-2_all.deb
 9caa68d31bafd6080645c7e6082b61fb61386db76ee78cf2a6b7b51b292e6a93 1433548 
slapd_2.4.47+dfsg-2_amd64.deb
 ed7703896e68b63ac4a91d795f6a5610f458a81b94a645183c44ed6dc8556ce4 90096 
slapi-dev_2.4.47+dfsg-2_amd64.deb
Files:
 a1b29c2ef836a4e6f956c7183c7eaf98 2835 net optional openldap_2.4.47+dfsg-2.dsc
 cc6d5d98dc536d3a935272ad2ee5f98e 165044 net optional 
openldap_2.4.47+dfsg-2.debian.tar.xz
 d0b297cdd0620d4d3281a6e67b0286ed 538576 debug optional 
ldap-utils-dbgsym_2.4.47+dfsg-2_amd64.deb
 f13a7984d504de9ba895764c0934a7d9 197276 net optional 
ldap-utils_2.4.47+dfsg-2_amd64.deb
 29526a7d655582f06c9dc794da9b65bb 515492 debug optional 
libldap-2.4-2-dbgsym_2.4.47+dfsg-2_amd64.deb
 6e3712d83d2b2d7576d69dc5b8282633 224300 libs optional 
libldap-2.4-2_2.4.47+dfsg-2_amd64.deb
 608698db65e5f37114c1d0f9b188e4d2 89200 libs optional 
libldap-common_2.4.47+dfsg-2_all.deb
 81b35c556efd8cd762b7ce32cc9c001a 330860 libdevel optional 
libldap2-dev_2.4.47+dfsg-2_amd64.deb
 736a459ee8cffcc3fd749ab2263cf145 10446 net optional 
openldap_2.4.47+dfsg-2_amd64.buildinfo
 fa0314ac6700be2a1143b1ae9dfc45cc 61904 debug optional 
slapd-contrib-dbgsym_2.4.47+dfsg-2_amd64.deb
 28190054ff43f7cfc00b3a03daee577d 99984 net optional 
slapd-contrib_2.4.47+dfsg-2_amd64.deb
 8fbdeb34a528ed06970748816e9c6d53 6967704 debug optional 
slapd-dbgsym_2.4.47+dfsg-2_amd64.deb
 a04ceb34164981f52144c260e45a2fb7 82512 oldlibs optional 
slapd-smbk5pwd_2.4.47+dfsg-2_all.deb
 80a01cd77d445fddc5879b6c987dfffa 1433548 net optional 
slapd_2.4.47+dfsg-2_amd64.deb
 bc92ef8343056188358f38fb59a418f2 90096 libdevel optional 
slapi-dev_2.4.47+dfsg-2_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEkpeKbhleSSGCX3/w808JdE6fXdkFAlw6XTgACgkQ808JdE6f
XdmnOxAAm8obmnB7tjlRBuqpsImyUk2JO2wl4w4lDgwec6NiUdILQbXpaI2a7Ve1
Ly5IgPwm/VY9XlzuAXaWiz/H5JSTQEtdgokZ/Zem9Sme2d0BnN0peZRoERjW/dqK
kdPG3sUPg9vtfNCqDhQkKOZ+jYLZd9pNMqTKVZHNFGs/k5ONKz3Hpy6GXVMR0s9b
lWuK3s2NxFXRQv+P62hTdw2SJtIqk79G2No+oVttNNKWSCU9cpbG3WYOhc8KbdeY
WRtN3RhfecE08pSpsAjXHK/H8TaCJ6sUZ1YioiA180bvNbvlcm6R/eahslQdM2L0
OFc4aJzXG4sFbALD2XyqQMe1/3+Kojv+Dv3pmJZ7dW+8BOn5y73VwzxhMsWjmSRP
MYOzibzrTPBM45geqvcIDAmXxc9UgRnIh74s3b98PwoifXoNg2wtbRMf+lb6zWwa
9XtU/YRyU9s2m9EBY6dOHikB014m+vQeG78EP2SAwlWnUTL4pQiSzab4haogH3fH
AaDepqjkpHLb4zMmLqx/GDuz8VH678FDKl2/1vzX0zSoXtI86fpW23qj2o58Ezix
+Iv3a79KPPy2ixxHhkrD3PEiLwTfrky0ZnlniSKWFfmIcAWfAnEt62Brf18wQxVS
3OqJjDCuBdGRD1v8N7Xfa7g1ZRqb+fCCWaqsXhfHNVW6sQ6LQro=
=WD8v
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to