From lioux@uol.com.br  Sat Jun 26 09:49:34 2010
Return-Path: <lioux@uol.com.br>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6761B106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 2010 09:49:34 +0000 (UTC)
	(envelope-from lioux@uol.com.br)
Received: from goat.gigo.com (ipv6.gigo.com [IPv6:2001:470:1:18::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A2768FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 2010 09:49:34 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by goat.gigo.com (Postfix) with ESMTP id 374785C00
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 2010 02:49:34 -0700 (PDT)
Received: from goat.gigo.com ([127.0.0.1])
	by localhost (vette.gigo.com [127.0.0.1]) (amavisd-new, port 10023)
	with ESMTP id rRfM+99JJzUD for <FreeBSD-gnats-submit@freebsd.org>;
	Sat, 26 Jun 2010 02:49:34 -0700 (PDT)
Received: from 189.72.155.250 (189-72-155-250.bsace702.dsl.brasiltelecom.net.br [189.72.155.250])
	by goat.gigo.com (Postfix) with ESMTPSA id BD9225C3F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 2010 02:49:32 -0700 (PDT)
Received: (qmail 18188 invoked by uid 1001); 26 Jun 2010 06:49:34 -0300
Message-Id: <20100626094934.18094.qmail@exxodus.fedaykin.here>
Date: 26 Jun 2010 06:49:34 -0300
From: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ale@FreeBSD.org
Subject: [PATCH] security/opensc: Fix build against security/libassuan 2.0.0
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         148164
>Category:       ports
>Synopsis:       [PATCH] security/opensc: Fix build against security/libassuan 2.0.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 26 09:50:04 UTC 2010
>Closed-Date:    Mon Jun 28 07:41:27 UTC 2010
>Last-Modified:  Mon Jun 28 07:50:01 UTC 2010
>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@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:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jun 26 09:50:13 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148164 
State-Changed-From-To: open->closed 
State-Changed-By: ale 
State-Changed-When: Mon Jun 28 07:41:06 UTC 2010 
State-Changed-Why:  
Update committed, thanks. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/148164: commit references a PR
Date: Mon, 28 Jun 2010 07:40:56 +0000 (UTC)

 ale         2010-06-28 07:40:42 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/opensc      Makefile 
   Added files:
     security/opensc/files patch-src_signer_dialog.c 
   Log:
   Even if opensc 0.12.x will drop signer plugin, update it to use libassuan2.
   
   PR:             ports/148164
   Submitted by:   lioux
   Feature safe:   yes
   
   Revision  Changes    Path
   1.43      +7 -2      ports/security/opensc/Makefile
   1.1       +97 -0     ports/security/opensc/files/patch-src_signer_dialog.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
