View | Details | Raw Unified | Return to bug 148164
Collapse All | Expand All

(-)Makefile (-2 / +4 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	opensc
8
PORTNAME=	opensc
9
PORTVERSION=	0.11.13
9
PORTVERSION=	0.11.13
10
PORTREVISION=	1
10
PORTREVISION=	2
11
CATEGORIES=	security devel
11
CATEGORIES=	security devel
12
MASTER_SITES=	http://www.opensc-project.org/files/${PORTNAME}/ \
12
MASTER_SITES=	http://www.opensc-project.org/files/${PORTNAME}/ \
13
		http://www.opensc-project.org/files/${PORTNAME}/testing/
13
		http://www.opensc-project.org/files/${PORTNAME}/testing/
Lines 76-82 Link Here
76
.endif
76
.endif
77
77
78
.if defined(WITH_SIGNER)
78
.if defined(WITH_SIGNER)
79
BUILD_DEPENDS+=	${LOCALBASE}/lib/libassuan.a:${PORTSDIR}/security/libassuan-1
79
LIB_DEPENDS=	assuan.0:${PORTSDIR}/security/libassuan
80
PINENTRY?=	${LOCALBASE}/bin/pinentry
80
PINENTRY?=	${LOCALBASE}/bin/pinentry
81
PINENTRY_PORT?=	security/pinentry
81
PINENTRY_PORT?=	security/pinentry
82
RUN_DEPENDS+=	pinentry:${PORTSDIR}/${PINENTRY_PORT}
82
RUN_DEPENDS+=	pinentry:${PORTSDIR}/${PINENTRY_PORT}
Lines 101-106 Link Here
101
post-patch:
101
post-patch:
102
	@${REINPLACE_CMD} 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
102
	@${REINPLACE_CMD} 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
103
		${WRKSRC}/configure
103
		${WRKSRC}/configure
104
	@${REINPLACE_CMD} 's|tmp=1:0\.9\.2|tmp=2:2.0.0|' \
105
		${WRKSRC}/configure
104
.if !defined(WITH_SIGNER)
106
.if !defined(WITH_SIGNER)
105
	@${REINPLACE_CMD} 's|install-data-am: install-pluginDATA|install-data-am:|' \
107
	@${REINPLACE_CMD} 's|install-data-am: install-pluginDATA|install-data-am:|' \
106
		${WRKSRC}/src/signer/Makefile.in
108
		${WRKSRC}/src/signer/Makefile.in
(-)files/patch-src__signer__dialog.c (+97 lines)
Added Link Here
1
--- src/signer/dialog.c.orig	2010-02-16 07:03:25.000000000 -0200
2
+++ src/signer/dialog.c	2010-06-26 06:42:17.000000000 -0300
3
@@ -15,31 +15,31 @@
4
   char *buffer;
5
 };
6
 
7
-static AssuanError
8
+static gpg_error_t
9
 getpin_cb (void *opaque, const void *buffer, size_t length)
10
 {
11
   struct entry_parm_s *parm = (struct entry_parm_s *) opaque;
12
 
13
   /* we expect the pin to fit on one line */
14
   if (parm->lines || length >= parm->size)
15
-    return ASSUAN_Too_Much_Data;
16
+    return gpg_error(GPG_ERR_ASS_TOO_MUCH_DATA);
17
 
18
   /* fixme: we should make sure that the assuan buffer is allocated in
19
      secure memory or read the response byte by byte */
20
   memcpy(parm->buffer, buffer, length);
21
   parm->buffer[length] = 0;
22
   parm->lines++;
23
-  return (AssuanError) 0;
24
+  return gpg_error(GPG_ERR_NO_ERROR);
25
 }
26
 
27
 int ask_and_verify_pin_code(struct sc_pkcs15_card *p15card,
28
 			    struct sc_pkcs15_object *pin)
29
 {
30
-	int r;
31
+	gpg_error_t r;
32
 	size_t len;
33
 	const char *argv[3];
34
 	const char *pgmname = PIN_ENTRY;
35
-	ASSUAN_CONTEXT ctx;
36
+	assuan_context_t ctx = NULL;
37
 	char buf[500];
38
 	char errtext[100];
39
 	struct entry_parm_s parm;
40
@@ -48,16 +48,26 @@
41
 	argv[0] = pgmname;
42
 	argv[1] = NULL;
43
 	
44
-	r = assuan_pipe_connect(&ctx, pgmname, (char **) argv, NULL);
45
+	assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT); 
46
+
47
+	r = assuan_new(&ctx); 
48
+	if (r) { 
49
+		printf("Can't initialize assuan context: %s\n)", 
50
+		gpg_strerror(r)); 
51
+		goto err; 
52
+	} 
53
+
54
+	r = assuan_pipe_connect(ctx, pgmname, (const char **) argv, \ 
55
+		NULL, NULL, NULL, 0);
56
 	if (r) {
57
 		printf("Can't connect to the PIN entry module: %s\n",
58
-		       assuan_strerror((AssuanError) r));
59
+		       gpg_strerror(r));
60
 		goto err;
61
 	}
62
 	sprintf(buf, "SETDESC Enter PIN [%s] for digital signing  ", pin->label);
63
 	r = assuan_transact(ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL);
64
 	if (r) {
65
-		printf("SETDESC: %s\n", assuan_strerror((AssuanError) r));
66
+		printf("SETDESC: %s\n", gpg_strerror(r));
67
 		goto err;
68
 	}
69
 	errtext[0] = 0;
70
@@ -71,12 +81,12 @@
71
 		parm.size = sizeof(buf);
72
 		parm.buffer = buf;
73
 		r = assuan_transact(ctx, "GETPIN", getpin_cb, &parm, NULL, NULL, NULL, NULL);
74
-		if (r == ASSUAN_Canceled) {
75
-			assuan_disconnect(ctx);
76
+		if (gpg_err_code(r) == GPG_ERR_ASS_CANCELED) { 
77
+			assuan_release(ctx);
78
 			return -2;
79
 		}
80
 		if (r) {
81
-			printf("GETPIN: %s\n", assuan_strerror((AssuanError) r));
82
+			printf("GETPIN: %s\n", gpg_strerror(r));
83
 			goto err;
84
 		}
85
 		len = strlen(buf);
86
@@ -104,9 +114,9 @@
87
 			break;
88
 	}
89
 
90
-	assuan_disconnect(ctx);	
91
+	assuan_release(ctx);
92
 	return 0;
93
 err:	
94
-	assuan_disconnect(ctx);
95
+	assuan_release(ctx);
96
 	return -1;
97
 }

Return to bug 148164