Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Nov 2018 10:48:33 +0000 (UTC)
From:      Alex Dupre <ale@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r485593 - in branches/2018Q4/security/pam_p11: . files
Message-ID:  <201811221048.wAMAmXng099868@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ale
Date: Thu Nov 22 10:48:33 2018
New Revision: 485593
URL: https://svnweb.freebsd.org/changeset/ports/485593

Log:
  MFH: r482217 r482333 r482904
  
  Update to 0.2.0 release and fix build with OpenSSL 1.1.
  
  Approved by:	ports-secteam (blanket, build fix)

Added:
  branches/2018Q4/security/pam_p11/files/patch-configure.ac
     - copied unchanged from r482904, head/security/pam_p11/files/patch-configure.ac
  branches/2018Q4/security/pam_p11/files/patch-src_Makefile.am
     - copied unchanged from r482904, head/security/pam_p11/files/patch-src_Makefile.am
  branches/2018Q4/security/pam_p11/files/patch-src_pam__p11.c
     - copied, changed from r482217, head/security/pam_p11/files/patch-src_pam__p11.c
Deleted:
  branches/2018Q4/security/pam_p11/files/patch-configure
  branches/2018Q4/security/pam_p11/files/patch-src_pam_p11.c
  branches/2018Q4/security/pam_p11/pkg-plist
Modified:
  branches/2018Q4/security/pam_p11/Makefile
  branches/2018Q4/security/pam_p11/distinfo
  branches/2018Q4/security/pam_p11/files/patch-src_test.c
  branches/2018Q4/security/pam_p11/pkg-descr
Directory Properties:
  branches/2018Q4/   (props changed)

Modified: branches/2018Q4/security/pam_p11/Makefile
==============================================================================
--- branches/2018Q4/security/pam_p11/Makefile	Thu Nov 22 10:18:45 2018	(r485592)
+++ branches/2018Q4/security/pam_p11/Makefile	Thu Nov 22 10:48:33 2018	(r485593)
@@ -2,10 +2,10 @@
 # $FreeBSD$
 
 PORTNAME=	pam_p11
-PORTVERSION=	0.1.5
-PORTREVISION=	3
+PORTVERSION=	0.2.0
+PORTREVISION=	1
 CATEGORIES=	security
-MASTER_SITES=	SF/opensc/${PORTNAME}
+MASTER_SITES=	https://github.com/OpenSC/pam_p11/releases/download/pam_p11-${PORTVERSION}/
 
 MAINTAINER=	ale@FreeBSD.org
 COMMENT=	PAM module using crypto tokens for auth
@@ -14,20 +14,26 @@ LICENSE=	LGPL21
 
 LIB_DEPENDS=	libp11.so:security/libp11
 
-OPTIONS_DEFINE=	DOCS
+USES=		libtool pkgconfig ssl autoreconf
 
+OPTIONS_DEFINE=	DOCS NLS
+
 GNU_CONFIGURE=	yes
-USES=		libtool pkgconfig ssl
 
+NLS_CONFIGURE_ENABLE=	nls
+NLS_USES=	gettext
+NLS_PLIST_FILES=share/locale/de/LC_MESSAGES/pam_p11.mo
+
+CONFIGURE_ARGS=	--with-libintl-prefix=${LOCALBASE}
+
 CONFIGURE_ENV=	OPENSSL_CFLAGS="-I${OPENSSLINC}" \
-		OPENSSL_LIBS="-L${OPENSSLLIB} -lssl"
+		OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto"
 
+PLIST_FILES=	lib/security/pam_p11.so
+
 PORTDOCS=	*
 
 post-install:
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}/wiki
-	@(cd ${WRKSRC} && ${CP} NEWS ${STAGEDIR}${DOCSDIR})
-	@(cd ${WRKSRC}/doc && ${CP} README ${STAGEDIR}${DOCSDIR})
-	@(cd ${WRKSRC}/doc && ${CP} *.css *.html ${STAGEDIR}${DOCSDIR}/wiki)
+	${INSTALL_DATA} ${WRKSRC}/NEWS ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Modified: branches/2018Q4/security/pam_p11/distinfo
==============================================================================
--- branches/2018Q4/security/pam_p11/distinfo	Thu Nov 22 10:18:45 2018	(r485592)
+++ branches/2018Q4/security/pam_p11/distinfo	Thu Nov 22 10:48:33 2018	(r485593)
@@ -1,2 +1,3 @@
-SHA256 (pam_p11-0.1.5.tar.gz) = 74da875467c4ba156f7cb7eaec0718f92dded03f40db3c6c0423c03f44d9f25a
-SIZE (pam_p11-0.1.5.tar.gz) = 348181
+TIMESTAMP = 1539433560
+SHA256 (pam_p11-0.2.0.tar.gz) = 088d4c05d23fee9535f1b16f6c993c88b11cbed0288d5a1d0b37da2f390325a2
+SIZE (pam_p11-0.2.0.tar.gz) = 417550

Copied: branches/2018Q4/security/pam_p11/files/patch-configure.ac (from r482904, head/security/pam_p11/files/patch-configure.ac)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q4/security/pam_p11/files/patch-configure.ac	Thu Nov 22 10:48:33 2018	(r485593, copy of r482904, head/security/pam_p11/files/patch-configure.ac)
@@ -0,0 +1,14 @@
+--- configure.ac.orig	2018-10-24 11:06:32 UTC
++++ configure.ac
+@@ -85,6 +85,11 @@ PKG_CHECK_MODULES(
+ 	)]
+ )
+ 
++saved_LIBS="$LIBS"
++LIBS="$OPENSSL_LIBS $LIBS"
++AC_CHECK_FUNCS(EVP_MD_CTX_new EVP_MD_CTX_free EVP_MD_CTX_reset)
++LIBS="$saved_LIBS"
++
+ if test -z "${PAM_LIBS}"; then
+ 	AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
+ 	AC_ARG_VAR([PAM_LIBS], [linker flags for pam])

Copied: branches/2018Q4/security/pam_p11/files/patch-src_Makefile.am (from r482904, head/security/pam_p11/files/patch-src_Makefile.am)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q4/security/pam_p11/files/patch-src_Makefile.am	Thu Nov 22 10:48:33 2018	(r485593, copy of r482904, head/security/pam_p11/files/patch-src_Makefile.am)
@@ -0,0 +1,16 @@
+--- src/Makefile.am.orig	2018-10-24 12:39:40 UTC
++++ src/Makefile.am
+@@ -14,11 +14,11 @@ pam_p11_la_SOURCES = pam_p11.c base64.c 
+ noinst_PROGRAMS = test-login test-passwd
+ 
+ test_login_SOURCES = test.c login.c $(pam_p11_la_SOURCES)
+-test_login_LDADD   = -lpam_misc
++test_login_LDADD   = ${INTLLIBS}
+ test_login_CFLAGS  = $(AM_CFLAGS) -DLIBDIR=\"$(libdir)\" -DTEST
+ 
+ test_passwd_SOURCES = test.c passwd.c $(pam_p11_la_SOURCES)
+-test_passwd_LDADD   = -lpam_misc
++test_passwd_LDADD   = ${INTLLIBS}
+ test_passwd_CFLAGS  = $(AM_CFLAGS) -DLIBDIR=\"$(libdir)\" -DTEST
+ 
+ format:

Copied and modified: branches/2018Q4/security/pam_p11/files/patch-src_pam__p11.c (from r482217, head/security/pam_p11/files/patch-src_pam__p11.c)
==============================================================================
--- head/security/pam_p11/files/patch-src_pam__p11.c	Tue Oct 16 10:30:43 2018	(r482217, copy source)
+++ branches/2018Q4/security/pam_p11/files/patch-src_pam__p11.c	Thu Nov 22 10:48:33 2018	(r485593)
@@ -1,6 +1,24 @@
---- src/pam_p11.c.orig	2018-10-16 10:00:15 UTC
+--- src/pam_p11.c.orig	2018-05-04 14:52:04 UTC
 +++ src/pam_p11.c
-@@ -53,7 +53,7 @@
+@@ -31,6 +31,17 @@
+ #include <openssl/crypto.h>
+ #include <libp11.h>
+ 
++/* openssl deprecated API emulation */
++#ifndef HAVE_EVP_MD_CTX_NEW
++#define EVP_MD_CTX_new()	EVP_MD_CTX_create()
++#endif
++#ifndef HAVE_EVP_MD_CTX_FREE
++#define EVP_MD_CTX_free(ctx)	EVP_MD_CTX_destroy((ctx))
++#endif
++#ifndef HAVE_EVP_MD_CTX_RESET
++#define EVP_MD_CTX_reset(ctx)	EVP_MD_CTX_cleanup((ctx))
++#endif
++
+ #ifdef ENABLE_NLS
+ #include <libintl.h>
+ #include <locale.h>
+@@ -53,7 +64,7 @@
  #include <security/pam_ext.h>
  #else
  #define pam_syslog(handle, level, msg...) syslog(level, ## msg)
@@ -9,3 +27,39 @@
  		const char *fmt, va_list args)
  {
  	int r = PAM_CRED_INSUFFICIENT;
+@@ -549,7 +560,7 @@ static int key_find(pam_handle_t *pamh, 
+ 	return 0;
+ }
+ 
+-static int randomize(pam_handle_t *pamh, unsigned char *r, unsigned int r_len)
++static int randomize(pam_handle_t *pamh, unsigned char *r, int r_len)
+ {
+ 	int ok = 0;
+ 	int fd = open("/dev/urandom", O_RDONLY);
+@@ -572,7 +583,7 @@ static int key_verify(pam_handle_t *pamh
+ 	unsigned char signature[256];
+ 	unsigned int siglen = sizeof signature;
+ 	const EVP_MD *md = EVP_sha1();
+-	EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
++	EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
+ 	EVP_PKEY *privkey = PKCS11_get_private_key(authkey);
+ 	EVP_PKEY *pubkey = PKCS11_get_public_key(authkey);
+ 
+@@ -590,7 +601,7 @@ static int key_verify(pam_handle_t *pamh
+ 			|| !EVP_SignInit(md_ctx, md)
+ 			|| !EVP_SignUpdate(md_ctx, challenge, sizeof challenge)
+ 			|| !EVP_SignFinal(md_ctx, signature, &siglen, privkey)
+-			|| !EVP_MD_CTX_cleanup(md_ctx)
++			|| !EVP_MD_CTX_reset(md_ctx)
+ 			|| !EVP_VerifyInit(md_ctx, md)
+ 			|| !EVP_VerifyUpdate(md_ctx, challenge, sizeof challenge)
+ 			|| 1 != EVP_VerifyFinal(md_ctx, signature, siglen, pubkey)) {
+@@ -607,7 +618,7 @@ err:
+ 	if (NULL != privkey)
+ 		EVP_PKEY_free(privkey);
+ 	if (NULL != md_ctx) {
+-		EVP_MD_CTX_destroy(md_ctx);
++		EVP_MD_CTX_free(md_ctx);
+ 	}
+ 	return ok;
+ }

Modified: branches/2018Q4/security/pam_p11/files/patch-src_test.c
==============================================================================
--- branches/2018Q4/security/pam_p11/files/patch-src_test.c	Thu Nov 22 10:18:45 2018	(r485592)
+++ branches/2018Q4/security/pam_p11/files/patch-src_test.c	Thu Nov 22 10:48:33 2018	(r485593)
@@ -1,10 +1,23 @@
---- src/test.c.orig	2008-08-26 12:37:37.000000000 +0200
-+++ src/test.c	2008-08-26 12:37:45.000000000 +0200
-@@ -2,7 +2,6 @@
+--- src/test.c.orig	2018-05-04 14:52:04 UTC
++++ src/test.c
+@@ -22,9 +22,10 @@
+ 
+ #include <stdio.h>
  #include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
  
  #include <security/pam_appl.h>
 -#include <security/pam_misc.h>
  #include <security/pam_modules.h>
  
- int main(int argc, char **argv)
+ #ifndef LIBDIR
+@@ -42,7 +43,7 @@ int main(int argc, const char **argv)
+ 	};
+ 	pam_handle_t *pamh = NULL;
+ 	struct pam_conv conv = {
+-		misc_conv,
++		openpam_ttyconv,
+ 		NULL,
+ 	};
+ 	int r;

Modified: branches/2018Q4/security/pam_p11/pkg-descr
==============================================================================
--- branches/2018Q4/security/pam_p11/pkg-descr	Thu Nov 22 10:18:45 2018	(r485592)
+++ branches/2018Q4/security/pam_p11/pkg-descr	Thu Nov 22 10:48:33 2018	(r485593)
@@ -18,4 +18,4 @@ certificate chains, certificate authorities, revocatio
 lists or OCSP. Perfect for the small installation with no
 frills.
 
-WWW: https://github.com/OpenSC/OpenSC/wiki/pam_p11-simple-RSA-authentication-with-PKCS%2311-modules
+WWW: https://github.com/OpenSC/pam_p11



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811221048.wAMAmXng099868>