View | Details | Raw Unified | Return to bug 123116 | Differences between
and this patch

Collapse All | Expand All

(-)pinentry/Makefile (-6 / +4 lines)
Lines 6-19 Link Here
6
#
6
#
7
7
8
PORTNAME=	pinentry
8
PORTNAME=	pinentry
9
PORTVERSION=	0.7.3
9
PORTVERSION=	0.7.5
10
PORTREVISION=	1
11
CATEGORIES=	security
10
CATEGORIES=	security
12
MASTER_SITES=	${MASTER_SITE_GNUPG}
11
MASTER_SITES=	${MASTER_SITE_GNUPG}
13
MASTER_SITE_SUBDIR=	pinentry
12
MASTER_SITE_SUBDIR=	pinentry
14
13
15
MAINTAINER=	lofi@freebsd.org
14
MAINTAINER=	lofi@freebsd.org
16
COMMENT?=	A collection of simple PIN or passphrase entry dialogs
15
COMMENT=	A collection of simple PIN or passphrase entry dialogs
17
16
18
LIB_DEPENDS=	gcrypt.15:${PORTSDIR}/security/libgcrypt \
17
LIB_DEPENDS=	gcrypt.15:${PORTSDIR}/security/libgcrypt \
19
		ksba.17:${PORTSDIR}/security/libksba
18
		ksba.17:${PORTSDIR}/security/libksba
Lines 37-43 Link Here
37
pre-configure:
36
pre-configure:
38
	@${REINPLACE_CMD} -e "s@-lpthread@${PTHREAD_LIBS}@g" \
37
	@${REINPLACE_CMD} -e "s@-lpthread@${PTHREAD_LIBS}@g" \
39
		${WRKSRC}/acinclude.m4 ${WRKSRC}/configure
38
		${WRKSRC}/acinclude.m4 ${WRKSRC}/configure
40
41
.else
39
.else
42
CONFIGURE_ARGS+=--disable-pinentry-qt
40
CONFIGURE_ARGS+=--disable-pinentry-qt
43
PLIST_SUB+=	WITH_QT="@comment "
41
PLIST_SUB+=	WITH_QT="@comment "
Lines 46-52 Link Here
46
.if defined(PINENTRY_GTK)
44
.if defined(PINENTRY_GTK)
47
USE_GNOME+=	gtk12
45
USE_GNOME+=	gtk12
48
PLIST_SUB+=	WITH_GTK=""
46
PLIST_SUB+=	WITH_GTK=""
49
CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include
47
CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
50
.else
48
.else
51
CONFIGURE_ARGS+=--disable-pinentry-gtk
49
CONFIGURE_ARGS+=--disable-pinentry-gtk
52
PLIST_SUB+=	WITH_GTK="@comment "
50
PLIST_SUB+=	WITH_GTK="@comment "
Lines 55-61 Link Here
55
.if defined(PINENTRY_GTK2)
53
.if defined(PINENTRY_GTK2)
56
USE_GNOME+=	gtk20
54
USE_GNOME+=	gtk20
57
PLIST_SUB+=	WITH_GTK2=""
55
PLIST_SUB+=	WITH_GTK2=""
58
CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include
56
CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
59
.else
57
.else
60
CONFIGURE_ARGS+=--disable-pinentry-gtk2
58
CONFIGURE_ARGS+=--disable-pinentry-gtk2
61
PLIST_SUB+=	WITH_GTK2="@comment "
59
PLIST_SUB+=	WITH_GTK2="@comment "
(-)pinentry/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (pinentry-0.7.3.tar.gz) = 59282278405a8264b39ea28678c78cf4
1
MD5 (pinentry-0.7.5.tar.gz) = ca492afbbb59cd19f1c875533f18b269
2
SHA256 (pinentry-0.7.3.tar.gz) = df1d2c47d501031b4c995cee3e464e62578b8959559121a207a8046e2cd9a5bf
2
SHA256 (pinentry-0.7.5.tar.gz) = cb269ac058793b2df343a12a65e3402abc4b68503e105b12e4ca903d8d8e3172
3
SIZE (pinentry-0.7.3.tar.gz) = 417000
3
SIZE (pinentry-0.7.5.tar.gz) = 422801
(-)pinentry/files/patch-curses-utf (+40 lines)
Line 0 Link Here
1
--- m4/curses.m4.orig	2005-09-08 21:25:01.000000000 +0600
2
+++ m4/curses.m4	2008-02-17 22:23:32.000000000 +0500
3
@@ -28,7 +28,7 @@
4
   AC_ARG_ENABLE(ncurses,    [  --disable-ncurses       don't prefer -lncurses over -lcurses],
5
               , enable_ncurses=yes)
6
   if test "$enable_ncurses" = yes; then
7
-    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
8
+    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncursesw")
9
     if test "$LIBNCURSES"; then
10
       # Use ncurses header files instead of the ordinary ones, if possible;
11
       # is there a better way of doing this, that avoids looking in specific
12
--- pinentry/pinentry-curses.c.orig	2007-06-15 17:36:39.000000000 +0600
13
+++ pinentry/pinentry-curses.c		2008-02-17 22:28:40.000000000 +0500
14
@@ -587,6 +587,13 @@
15
   SCREEN *screen = 0;
16
   int done = 0;
17
   char *pin_utf8;
18
+  char *old_ctype = NULL;
19
+
20
+  if (pinentry->lc_ctype)
21
+    {
22
+      old_ctype = strdup (setlocale (LC_CTYPE, NULL));
23
+      setlocale (LC_CTYPE, pinentry->lc_ctype);
24
+    }
25
 
26
   /* Open the desired terminal if necessary.  */
27
   if (tty_name)
28
@@ -739,6 +746,12 @@
29
   if (screen)
30
     delscreen (screen);
31
 
32
+  if (old_ctype)
33
+    {
34
+      setlocale (LC_CTYPE, old_ctype);
35
+      free(old_ctype);
36
+    }
37
+
38
   if (ttyfi)
39
     fclose (ttyfi);
40
   if (ttyfo)
(-)pinentry/files/patch-glib.2.16 (-58 lines)
Lines 1-58 Link Here
1
--- gtk+-2/gtksecentry.c-	2008-03-26 17:28:13.000000000 +0200
2
+++ gtk+-2/gtksecentry.c	2008-03-26 17:32:51.000000000 +0200
3
@@ -270,7 +270,7 @@ gboolean g_use_secure_mem = FALSE;
4
 
5
 
6
 gpointer
7
-g_malloc(gulong size)
8
+g_malloc(gsize size)
9
 {
10
     gpointer p;
11
 
12
@@ -282,13 +282,13 @@ g_malloc(gulong size)
13
     else
14
 	p = (gpointer) malloc(size);
15
     if (!p)
16
-	g_error("could not allocate %ld bytes", size);
17
+	g_error("could not allocate %zd bytes", size);
18
 
19
     return p;
20
 }
21
 
22
 gpointer
23
-g_malloc0(gulong size)
24
+g_malloc0(gsize size)
25
 {
26
     gpointer p;
27
 
28
@@ -302,13 +302,13 @@ g_malloc0(gulong size)
29
     } else
30
 	p = (gpointer) calloc(size, 1);
31
     if (!p)
32
-	g_error("could not allocate %ld bytes", size);
33
+	g_error("could not allocate %zd bytes", size);
34
 
35
     return p;
36
 }
37
 
38
 gpointer
39
-g_realloc(gpointer mem, gulong size)
40
+g_realloc(gpointer mem, gsize size)
41
 {
42
     gpointer p;
43
 
44
@@ -3210,11 +3210,11 @@ static gint
45
 get_cursor_time(GtkSecureEntry * entry)
46
 {
47
     GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry));
48
-    gint time;
49
+    gint _time;
50
 
51
-    g_object_get(settings, "gtk-cursor-blink-time", &time, NULL);
52
+    g_object_get(settings, "gtk-cursor-blink-time", &_time, NULL);
53
 
54
-    return time;
55
+    return _time;
56
 }
57
 
58
 static void
(-)pinentry/files/patch-gtk2-gmem (+145 lines)
Line 0 Link Here
1
--- gtk+-2/gtksecentry.c.orig	2007-11-19 16:20:50.000000000 +0500
2
+++ gtk+-2/gtksecentry.c	2008-04-26 22:52:13.000000000 +0600
3
@@ -256,7 +256,7 @@
4
 
5
 static GtkWidgetClass *parent_class = NULL;
6
 
7
-gboolean g_use_secure_mem = FALSE;
8
+extern gboolean g_use_secure_mem;
9
 
10
 #  define g_sec_new(type, count)	  \
11
       ((type *) g_sec_malloc ((unsigned) sizeof (type) * (count)))
12
@@ -269,85 +269,6 @@
13
 				} while(0)
14
 
15
 
16
-gpointer
17
-g_malloc(gulong size)
18
-{
19
-    gpointer p;
20
-
21
-    if (size == 0)
22
-	return NULL;
23
-
24
-    if (g_use_secure_mem)
25
-	p = (gpointer) secmem_malloc(size);
26
-    else
27
-	p = (gpointer) malloc(size);
28
-    if (!p)
29
-	g_error("could not allocate %ld bytes", size);
30
-
31
-    return p;
32
-}
33
-
34
-gpointer
35
-g_malloc0(gulong size)
36
-{
37
-    gpointer p;
38
-
39
-    if (size == 0)
40
-	return NULL;
41
-
42
-    if (g_use_secure_mem) {
43
-	p = (gpointer) secmem_malloc(size);
44
-	if (p)
45
-	    memset(p, 0, size);
46
-    } else
47
-	p = (gpointer) calloc(size, 1);
48
-    if (!p)
49
-	g_error("could not allocate %ld bytes", size);
50
-
51
-    return p;
52
-}
53
-
54
-gpointer
55
-g_realloc(gpointer mem, gulong size)
56
-{
57
-    gpointer p;
58
-
59
-    if (size == 0) {
60
-	g_free(mem);
61
-
62
-	return NULL;
63
-    }
64
-
65
-    if (!mem) {
66
-	if (g_use_secure_mem)
67
-	    p = (gpointer) secmem_malloc(size);
68
-	else
69
-	    p = (gpointer) malloc(size);
70
-    } else {
71
-	if (g_use_secure_mem) {
72
-	    g_assert(m_is_secure(mem));
73
-	    p = (gpointer) secmem_realloc(mem, size);
74
-	} else
75
-	    p = (gpointer) realloc(mem, size);
76
-    }
77
-
78
-    if (!p)
79
-	g_error("could not reallocate %lu bytes", (gulong) size);
80
-
81
-    return p;
82
-}
83
-
84
-void
85
-g_free(gpointer mem)
86
-{
87
-    if (mem) {
88
-	if (m_is_secure(mem))
89
-	    secmem_free(mem);
90
-	else
91
-	    free(mem);
92
-    }
93
-}
94
-
95
 GType
96
 gtk_secure_entry_get_type(void)
97
 {
98
--- gtk+-2/pinentry-gtk-2.c.orig	2007-11-19 16:44:07.000000000 +0500
99
+++ gtk+-2/pinentry-gtk-2.c		2008-04-26 22:52:13.000000000 +0600
100
@@ -39,6 +39,7 @@
101
 
102
 #include "gtksecentry.h"
103
 #include "pinentry.h"
104
+#include "memory.h"
105
 
106
 #ifdef FALLBACK_CURSES
107
 #include "pinentry-curses.h"
108
@@ -469,12 +470,36 @@
109
 
110
 pinentry_cmd_handler_t pinentry_cmd_handler = gtk_cmd_handler;
111
 
112
+gboolean g_use_secure_mem = FALSE;
113
+
114
+static gpointer
115
+_malloc(gsize size) {
116
+  return g_use_secure_mem ? secmem_malloc(size) : malloc(size);
117
+}
118
+
119
+static gpointer
120
+_realloc(gpointer p, gsize size) {
121
+  return m_is_secure(p) ? secmem_realloc(p, size) : realloc(p, size);
122
+}
123
+
124
+static void
125
+_free(gpointer p) {
126
+  m_is_secure(p) ? secmem_free(p) : free(p);
127
+}
128
 
129
 int
130
 main (int argc, char *argv[])
131
 {
132
   pinentry_init (PGMNAME);
133
-    
134
+
135
+  GMemVTable mem_vtable = {
136
+    _malloc,
137
+    _realloc,
138
+    _free
139
+  };
140
+
141
+  g_mem_set_vtable (&mem_vtable);
142
+  
143
 #ifdef FALLBACK_CURSES
144
   if (pinentry_have_display (argc, argv))
145
     gtk_init (&argc, &argv);
(-)pinentry/files/patch-more_sec_mem (+11 lines)
Line 0 Link Here
1
--- secmem/secmem.c.orig	2007-07-03 05:49:48.000000000 +0600
2
+++ secmem/secmem.c		2008-02-17 22:19:50.000000000 +0500
3
@@ -85,7 +85,7 @@
4
 #  define MAP_ANONYMOUS MAP_ANON
5
 #endif
6
 
7
-#define DEFAULT_POOLSIZE 16384
8
+#define DEFAULT_POOLSIZE 16384*4
9
 
10
 typedef struct memblock_struct MEMBLOCK;
11
 struct memblock_struct {

Return to bug 123116