ports/148164: [PATCH] security/opensc: Fix build against security/libassuan 2.0.0

Mario Sergio Fujikawa Ferreira lioux at FreeBSD.org
Sat Jun 26 09:50:04 UTC 2010


>Number:         148164
>Category:       ports
>Synopsis:       [PATCH] security/opensc: Fix build against security/libassuan 2.0.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 26 09:50:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Mario Sergio Fujikawa Ferreira
>Release:        FreeBSD 8.1-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD exxodus.fedaykin.here 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #10: Thu Jun 17 12:28:13 BRT 2010
>Description:
- Fix build against security/libassuan 2.0.0 based on patch found
  on ticket

http://www.opensc-project.org/opensc/ticket/217

- Bump PORTREVISION to force users to upgrade

Added file(s):
- files/patch-src__signer__dialog.c

Port maintainer (ale at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- opensc-0.11.13_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/opensc/Makefile,v
retrieving revision 1.42
diff -d -u -u -r1.42 Makefile
--- Makefile	14 Jun 2010 00:42:52 -0000	1.42
+++ Makefile	26 Jun 2010 09:47:03 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	opensc
 PORTVERSION=	0.11.13
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security devel
 MASTER_SITES=	http://www.opensc-project.org/files/${PORTNAME}/ \
 		http://www.opensc-project.org/files/${PORTNAME}/testing/
@@ -76,7 +76,7 @@
 .endif
 
 .if defined(WITH_SIGNER)
-BUILD_DEPENDS+=	${LOCALBASE}/lib/libassuan.a:${PORTSDIR}/security/libassuan-1
+LIB_DEPENDS=	assuan.0:${PORTSDIR}/security/libassuan
 PINENTRY?=	${LOCALBASE}/bin/pinentry
 PINENTRY_PORT?=	security/pinentry
 RUN_DEPENDS+=	pinentry:${PORTSDIR}/${PINENTRY_PORT}
@@ -101,6 +101,8 @@
 post-patch:
 	@${REINPLACE_CMD} 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
 		${WRKSRC}/configure
+	@${REINPLACE_CMD} 's|tmp=1:0\.9\.2|tmp=2:2.0.0|' \
+		${WRKSRC}/configure
 .if !defined(WITH_SIGNER)
 	@${REINPLACE_CMD} 's|install-data-am: install-pluginDATA|install-data-am:|' \
 		${WRKSRC}/src/signer/Makefile.in
Index: files/patch-src__signer__dialog.c
===================================================================
RCS file: files/patch-src__signer__dialog.c
diff -N files/patch-src__signer__dialog.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src__signer__dialog.c	26 Jun 2010 09:47:03 -0000
@@ -0,0 +1,97 @@
+--- src/signer/dialog.c.orig	2010-02-16 07:03:25.000000000 -0200
++++ src/signer/dialog.c	2010-06-26 06:42:17.000000000 -0300
+@@ -15,31 +15,31 @@
+   char *buffer;
+ };
+ 
+-static AssuanError
++static gpg_error_t
+ getpin_cb (void *opaque, const void *buffer, size_t length)
+ {
+   struct entry_parm_s *parm = (struct entry_parm_s *) opaque;
+ 
+   /* we expect the pin to fit on one line */
+   if (parm->lines || length >= parm->size)
+-    return ASSUAN_Too_Much_Data;
++    return gpg_error(GPG_ERR_ASS_TOO_MUCH_DATA);
+ 
+   /* fixme: we should make sure that the assuan buffer is allocated in
+      secure memory or read the response byte by byte */
+   memcpy(parm->buffer, buffer, length);
+   parm->buffer[length] = 0;
+   parm->lines++;
+-  return (AssuanError) 0;
++  return gpg_error(GPG_ERR_NO_ERROR);
+ }
+ 
+ int ask_and_verify_pin_code(struct sc_pkcs15_card *p15card,
+ 			    struct sc_pkcs15_object *pin)
+ {
+-	int r;
++	gpg_error_t r;
+ 	size_t len;
+ 	const char *argv[3];
+ 	const char *pgmname = PIN_ENTRY;
+-	ASSUAN_CONTEXT ctx;
++	assuan_context_t ctx = NULL;
+ 	char buf[500];
+ 	char errtext[100];
+ 	struct entry_parm_s parm;
+@@ -48,16 +48,26 @@
+ 	argv[0] = pgmname;
+ 	argv[1] = NULL;
+ 	
+-	r = assuan_pipe_connect(&ctx, pgmname, (char **) argv, NULL);
++	assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT); 
++
++	r = assuan_new(&ctx); 
++	if (r) { 
++		printf("Can't initialize assuan context: %s\n)", 
++		gpg_strerror(r)); 
++		goto err; 
++	} 
++
++	r = assuan_pipe_connect(ctx, pgmname, (const char **) argv, \ 
++		NULL, NULL, NULL, 0);
+ 	if (r) {
+ 		printf("Can't connect to the PIN entry module: %s\n",
+-		       assuan_strerror((AssuanError) r));
++		       gpg_strerror(r));
+ 		goto err;
+ 	}
+ 	sprintf(buf, "SETDESC Enter PIN [%s] for digital signing  ", pin->label);
+ 	r = assuan_transact(ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL);
+ 	if (r) {
+-		printf("SETDESC: %s\n", assuan_strerror((AssuanError) r));
++		printf("SETDESC: %s\n", gpg_strerror(r));
+ 		goto err;
+ 	}
+ 	errtext[0] = 0;
+@@ -71,12 +81,12 @@
+ 		parm.size = sizeof(buf);
+ 		parm.buffer = buf;
+ 		r = assuan_transact(ctx, "GETPIN", getpin_cb, &parm, NULL, NULL, NULL, NULL);
+-		if (r == ASSUAN_Canceled) {
+-			assuan_disconnect(ctx);
++		if (gpg_err_code(r) == GPG_ERR_ASS_CANCELED) { 
++			assuan_release(ctx);
+ 			return -2;
+ 		}
+ 		if (r) {
+-			printf("GETPIN: %s\n", assuan_strerror((AssuanError) r));
++			printf("GETPIN: %s\n", gpg_strerror(r));
+ 			goto err;
+ 		}
+ 		len = strlen(buf);
+@@ -104,9 +114,9 @@
+ 			break;
+ 	}
+ 
+-	assuan_disconnect(ctx);	
++	assuan_release(ctx);
+ 	return 0;
+ err:	
+-	assuan_disconnect(ctx);
++	assuan_release(ctx);
+ 	return -1;
+ }
--- opensc-0.11.13_2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list