From nobody@FreeBSD.org  Tue Apr 30 20:42:01 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 8299C680
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 20:42:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [69.147.83.34])
	by mx1.freebsd.org (Postfix) with ESMTP id 646C5176F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 20:42:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3UKg0qF054908
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 20:42:00 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r3UKg08Q054907;
	Tue, 30 Apr 2013 20:42:00 GMT
	(envelope-from nobody)
Message-Id: <201304302042.r3UKg08Q054907@red.freebsd.org>
Date: Tue, 30 Apr 2013 20:42:00 GMT
From: Mike Carlson <mike@bayphoto.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] net/openldap24-server: Add SHA2 password module
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         178268
>Category:       ports
>Synopsis:       [patch] net/openldap24-server: Add SHA2 password module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 30 20:50:00 UTC 2013
>Closed-Date:    Thu May 30 01:13:41 UTC 2013
>Last-Modified:  Thu May 30 01:13:41 UTC 2013
>Originator:     Mike Carlson
>Release:        9.1-RELEASE
>Organization:
Bay Photo Lab
>Environment:
FreeBSD b-bot.discdrive.bayphoto.com 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
There is a SHA2 password backend module in contrib/slapd-modules/passwd/sha2 that allows for SHA256 and SHA384 as well as SHA512 hash algorithms.

It would be really cool if this was a option, otherwise, I have to compile and install by hand.

There is a usability issue though, and that is slappasswd does not understand the new hash providers.

Example:
    # slappasswd -h "{SSHA}" -s test
    {SSHA}el+EK4rV5AnEodolaO2qXKyxLHsbSmnR
    
    # slappasswd -h "{SHA512}" -s test
    Password generation failed for scheme {SHA512}: scheme not recognized

With that, I still feel it is useful, so attached is a svn diff for ports/net/openldap24-server
>How-To-Repeat:
n/a
>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 316958)
+++ Makefile	(working copy)
@@ -69,7 +69,7 @@
 OPTIONS_DEFINE+=	ACCESSLOG AUDITLOG COLLECT CONSTRAINT DDS
 OPTIONS_DEFINE+=	DEREF DYNGROUP DYNLIST MEMBEROF PPOLICY PROXYCACHE
 OPTIONS_DEFINE+=	REFINT RETCODE RWM SEQMOD SSSVLV SYNCPROV TRANSLUCENT
-OPTIONS_DEFINE+=	UNIQUE VALSORT SMBPWD DYNAMIC_BACKENDS SASL
+OPTIONS_DEFINE+=	UNIQUE VALSORT SMBPWD SHA2 DYNAMIC_BACKENDS SASL
 
 OPTIONS_DEFAULT=	BDB TCP_WRAPPERS SEQMOD SYNCPROV DYNAMIC_BACKENDS
 
@@ -110,6 +110,7 @@
 UNIQUE_DESC=		With attribute Uniqueness overlay
 VALSORT_DESC=		With Value Sorting overlay
 SMBPWD_DESC=		With Samba Password hashes overlay
+SHA2_DESC=			With SHA2 Password hashes overlay
 DYNAMIC_BACKENDS_DESC=	Build dynamic backends
 .endif
 
@@ -440,6 +441,12 @@
 PLIST_SUB+=		SMBPWD="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MSHA2}
+PLIST_SUB+=		SHA2=""
+.else
+PLIST_SUB+=		SHA2="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MRLOOKUPS}
 CONFIGURE_ARGS+=	--enable-rlookups
 PLIST_SUB+=		RLOOKUPS=""
@@ -517,6 +524,12 @@
 .endif
 .endif
 
+.if ${PORT_OPTIONS:MSHA2}
+post-build:
+	@cd ${BUILD_WRKSRC}/contrib/slapd-modules/passwd/sha2; ${SETENV} ${MAKE_ENV} \
+		${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} all
+.endif
+
 pre-su-install:
 	@if [ -f ${PKGINSTALL} ]; then \
 		${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \
@@ -553,7 +566,14 @@
 		${PREFIX}/libexec/openldap/
 	@${LN} -s smbk5pwd.so.0 ${PREFIX}/libexec/openldap/smbk5pwd.so
 .endif
+.if ${PORT_OPTIONS:MSHA2}
+	@${INSTALL_DATA} ${WRKSRC}/contrib/slapd-modules/passwd/sha2/pw-sha2.la \
+		${PREFIX}/libexec/openldap/
+	@${INSTALL_PROGRAM} ${WRKSRC}/contrib/slapd-modules/passwd/sha2/.libs/pw-sha2.so.0 \
+		${PREFIX}/libexec/openldap/
+	@${LN} -s pw-sha2.so.0 ${PREFIX}/libexec/openldap/pw-sha2.so
 .endif
+.endif
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->delphij 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Apr 30 20:50:09 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178268 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/178268: commit references a PR
Date: Wed, 29 May 2013 23:42:53 +0000 (UTC)

 Author: delphij
 Date: Wed May 29 23:42:40 2013
 New Revision: 319397
 URL: http://svnweb.freebsd.org/changeset/ports/319397
 
 Log:
   Add an option to build SHA2 modules.
   
   PR:		ports/178268
   Submitted by:	Mike Carlson <mike bayphoto com>
 
 Modified:
   head/net/openldap24-server/Makefile
   head/net/openldap24-server/pkg-plist
 
 Modified: head/net/openldap24-server/Makefile
 ==============================================================================
 --- head/net/openldap24-server/Makefile	Wed May 29 23:36:16 2013	(r319396)
 +++ head/net/openldap24-server/Makefile	Wed May 29 23:42:40 2013	(r319397)
 @@ -69,7 +69,7 @@ OPTIONS_DEFINE+=	SOCK ODBC RLOOKUPS SLP 
  OPTIONS_DEFINE+=	ACCESSLOG AUDITLOG COLLECT CONSTRAINT DDS
  OPTIONS_DEFINE+=	DEREF DYNGROUP DYNLIST MEMBEROF PPOLICY PROXYCACHE
  OPTIONS_DEFINE+=	REFINT RETCODE RWM SEQMOD SSSVLV SYNCPROV TRANSLUCENT
 -OPTIONS_DEFINE+=	UNIQUE VALSORT SMBPWD DYNAMIC_BACKENDS SASL
 +OPTIONS_DEFINE+=	UNIQUE VALSORT SMBPWD SHA2 DYNAMIC_BACKENDS SASL
  
  OPTIONS_DEFAULT=	BDB TCP_WRAPPERS SEQMOD SYNCPROV DYNAMIC_BACKENDS
  
 @@ -110,6 +110,7 @@ TRANSLUCENT_DESC=	With Translucent Proxy
  UNIQUE_DESC=		With attribute Uniqueness overlay
  VALSORT_DESC=		With Value Sorting overlay
  SMBPWD_DESC=		With Samba Password hashes overlay
 +SHA2_DESC=		With SHA2 Password hashes overlay
  DYNAMIC_BACKENDS_DESC=	Build dynamic backends
  .endif
  
 @@ -440,6 +441,12 @@ PLIST_SUB+=		SMBPWD=""
  PLIST_SUB+=		SMBPWD="@comment "
  .endif
  
 +.if ${PORT_OPTIONS:MSHA2}
 +PLIST_SUB+=		SHA2=""
 +.else
 +PLIST_SUB+=		SHA2="@comment "
 +.endif
 +
  .if ${PORT_OPTIONS:MRLOOKUPS}
  CONFIGURE_ARGS+=	--enable-rlookups
  PLIST_SUB+=		RLOOKUPS=""
 @@ -510,11 +517,16 @@ test: build
  	@cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
  		${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} test
  
 -.if ${PORT_OPTIONS:MSMBPWD}
  post-build:
 +	@${DO_NADA}
 +.if ${PORT_OPTIONS:MSMBPWD}
  	@cd ${BUILD_WRKSRC}/contrib/slapd-modules/smbk5pwd; ${SETENV} ${MAKE_ENV} \
  		${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} DEFS="-DDO_SAMBA" all
  .endif
 +.if ${PORT_OPTIONS:MSHA2}
 +	@cd ${BUILD_WRKSRC}/contrib/slapd-modules/passwd/sha2; ${SETENV} ${MAKE_ENV} \
 +		${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} all
 +.endif
  .endif
  
  pre-su-install:
 @@ -553,6 +565,13 @@ post-install:
  		${PREFIX}/libexec/openldap/
  	@${LN} -s smbk5pwd.so.0 ${PREFIX}/libexec/openldap/smbk5pwd.so
  .endif
 +.if ${PORT_OPTIONS:MSHA2}
 +	@${INSTALL_DATA} ${WRKSRC}/contrib/slapd-modules/passwd/sha2/pw-sha2.la \
 +		${PREFIX}/libexec/openldap/
 +	@${INSTALL_PROGRAM} ${WRKSRC}/contrib/slapd-modules/passwd/sha2/.libs/pw-sha2.so.0 \
 +		${PREFIX}/libexec/openldap/
 +	@${LN} -s pw-sha2.so.0 ${PREFIX}/libexec/openldap/pw-sha2.so
 +.endif
  .endif
  	@${CAT} ${PKGMESSAGE}
  
 
 Modified: head/net/openldap24-server/pkg-plist
 ==============================================================================
 --- head/net/openldap24-server/pkg-plist	Wed May 29 23:36:16 2013	(r319396)
 +++ head/net/openldap24-server/pkg-plist	Wed May 29 23:42:40 2013	(r319397)
 @@ -82,6 +82,9 @@ etc/openldap/DB_CONFIG.example
  %%BACK_SQL%%libexec/openldap/back_sql-2.4.so.%%SHLIB_MAJOR%%
  %%BACK_SQL%%libexec/openldap/back_sql.la
  %%BACK_SQL%%libexec/openldap/back_sql.so
 +%%SHA2%%libexec/openldap/pw-sha2.la
 +%%SHA2%%libexec/openldap/pw-sha2.so
 +%%SHA2%%libexec/openldap/pw-sha2.so.0
  %%SMBPWD%%libexec/openldap/smbk5pwd.la
  %%SMBPWD%%libexec/openldap/smbk5pwd.so
  %%SMBPWD%%libexec/openldap/smbk5pwd.so.0
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Thu May 30 01:13:31 UTC 2013 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178268 
>Unformatted:
