aboutsummaryrefslogtreecommitdiff
path: root/security/pinentry
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-09-23 14:19:30 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-09-23 14:19:30 +0000
commit1ea7524a9eaf36169320ed3a8112902234bd4f32 (patch)
tree667fd1bd5e05fa77eeee156a0be872e388caa905 /security/pinentry
parent8c35dc866367656a66e30396d2bd6743fc855863 (diff)
downloadports-1ea7524a9eaf36169320ed3a8112902234bd4f32.tar.gz
ports-1ea7524a9eaf36169320ed3a8112902234bd4f32.zip
- Update to 0.7.5
PR: ports/123116 Submitted by: Yarodin <yarodin at gmail.com>
Notes
Notes: svn path=/head/; revision=220572
Diffstat (limited to 'security/pinentry')
-rw-r--r--security/pinentry/Makefile8
-rw-r--r--security/pinentry/distinfo6
-rw-r--r--security/pinentry/files/patch-curses-utf40
-rw-r--r--security/pinentry/files/patch-glib.2.1658
-rw-r--r--security/pinentry/files/patch-gtk2-gmem145
-rw-r--r--security/pinentry/files/patch-more_sec_mem11
6 files changed, 202 insertions, 66 deletions
diff --git a/security/pinentry/Makefile b/security/pinentry/Makefile
index ddebce8dcb62..01d1ca2ab70e 100644
--- a/security/pinentry/Makefile
+++ b/security/pinentry/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= pinentry
-PORTVERSION= 0.7.3
-PORTREVISION= 2
+PORTVERSION= 0.7.5
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_GNUPG}
MASTER_SITE_SUBDIR= pinentry
@@ -37,7 +36,6 @@ PLIST_SUB+= WITH_QT=""
pre-configure:
@${REINPLACE_CMD} -e "s@-lpthread@${PTHREAD_LIBS}@g" \
${WRKSRC}/acinclude.m4 ${WRKSRC}/configure
-
.else
CONFIGURE_ARGS+=--disable-pinentry-qt
PLIST_SUB+= WITH_QT="@comment "
@@ -46,7 +44,7 @@ PLIST_SUB+= WITH_QT="@comment "
.if defined(PINENTRY_GTK)
USE_GNOME+= gtk12
PLIST_SUB+= WITH_GTK=""
-CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include
+CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=--disable-pinentry-gtk
PLIST_SUB+= WITH_GTK="@comment "
@@ -55,7 +53,7 @@ PLIST_SUB+= WITH_GTK="@comment "
.if defined(PINENTRY_GTK2)
USE_GNOME+= gtk20
PLIST_SUB+= WITH_GTK2=""
-CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include
+CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=--disable-pinentry-gtk2
PLIST_SUB+= WITH_GTK2="@comment "
diff --git a/security/pinentry/distinfo b/security/pinentry/distinfo
index 58f2d2a1b422..ebb700e2080b 100644
--- a/security/pinentry/distinfo
+++ b/security/pinentry/distinfo
@@ -1,3 +1,3 @@
-MD5 (pinentry-0.7.3.tar.gz) = 59282278405a8264b39ea28678c78cf4
-SHA256 (pinentry-0.7.3.tar.gz) = df1d2c47d501031b4c995cee3e464e62578b8959559121a207a8046e2cd9a5bf
-SIZE (pinentry-0.7.3.tar.gz) = 417000
+MD5 (pinentry-0.7.5.tar.gz) = ca492afbbb59cd19f1c875533f18b269
+SHA256 (pinentry-0.7.5.tar.gz) = cb269ac058793b2df343a12a65e3402abc4b68503e105b12e4ca903d8d8e3172
+SIZE (pinentry-0.7.5.tar.gz) = 422801
diff --git a/security/pinentry/files/patch-curses-utf b/security/pinentry/files/patch-curses-utf
new file mode 100644
index 000000000000..9c11655966af
--- /dev/null
+++ b/security/pinentry/files/patch-curses-utf
@@ -0,0 +1,40 @@
+--- m4/curses.m4.orig 2005-09-08 21:25:01.000000000 +0600
++++ m4/curses.m4 2008-02-17 22:23:32.000000000 +0500
+@@ -28,7 +28,7 @@
+ AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses],
+ , enable_ncurses=yes)
+ if test "$enable_ncurses" = yes; then
+- AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
++ AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncursesw")
+ if test "$LIBNCURSES"; then
+ # Use ncurses header files instead of the ordinary ones, if possible;
+ # is there a better way of doing this, that avoids looking in specific
+--- pinentry/pinentry-curses.c.orig 2007-06-15 17:36:39.000000000 +0600
++++ pinentry/pinentry-curses.c 2008-02-17 22:28:40.000000000 +0500
+@@ -587,6 +587,13 @@
+ SCREEN *screen = 0;
+ int done = 0;
+ char *pin_utf8;
++ char *old_ctype = NULL;
++
++ if (pinentry->lc_ctype)
++ {
++ old_ctype = strdup (setlocale (LC_CTYPE, NULL));
++ setlocale (LC_CTYPE, pinentry->lc_ctype);
++ }
+
+ /* Open the desired terminal if necessary. */
+ if (tty_name)
+@@ -739,6 +746,12 @@
+ if (screen)
+ delscreen (screen);
+
++ if (old_ctype)
++ {
++ setlocale (LC_CTYPE, old_ctype);
++ free(old_ctype);
++ }
++
+ if (ttyfi)
+ fclose (ttyfi);
+ if (ttyfo)
diff --git a/security/pinentry/files/patch-glib.2.16 b/security/pinentry/files/patch-glib.2.16
index ac7b6489b59e..e69de29bb2d1 100644
--- a/security/pinentry/files/patch-glib.2.16
+++ b/security/pinentry/files/patch-glib.2.16
@@ -1,58 +0,0 @@
---- gtk+-2/gtksecentry.c- 2008-03-26 17:28:13.000000000 +0200
-+++ gtk+-2/gtksecentry.c 2008-03-26 17:32:51.000000000 +0200
-@@ -270,7 +270,7 @@ gboolean g_use_secure_mem = FALSE;
-
-
- gpointer
--g_malloc(gulong size)
-+g_malloc(gsize size)
- {
- gpointer p;
-
-@@ -282,13 +282,13 @@ g_malloc(gulong size)
- else
- p = (gpointer) malloc(size);
- if (!p)
-- g_error("could not allocate %ld bytes", size);
-+ g_error("could not allocate %zd bytes", size);
-
- return p;
- }
-
- gpointer
--g_malloc0(gulong size)
-+g_malloc0(gsize size)
- {
- gpointer p;
-
-@@ -302,13 +302,13 @@ g_malloc0(gulong size)
- } else
- p = (gpointer) calloc(size, 1);
- if (!p)
-- g_error("could not allocate %ld bytes", size);
-+ g_error("could not allocate %zd bytes", size);
-
- return p;
- }
-
- gpointer
--g_realloc(gpointer mem, gulong size)
-+g_realloc(gpointer mem, gsize size)
- {
- gpointer p;
-
-@@ -3210,11 +3210,11 @@ static gint
- get_cursor_time(GtkSecureEntry * entry)
- {
- GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry));
-- gint time;
-+ gint _time;
-
-- g_object_get(settings, "gtk-cursor-blink-time", &time, NULL);
-+ g_object_get(settings, "gtk-cursor-blink-time", &_time, NULL);
-
-- return time;
-+ return _time;
- }
-
- static void
diff --git a/security/pinentry/files/patch-gtk2-gmem b/security/pinentry/files/patch-gtk2-gmem
new file mode 100644
index 000000000000..fb640e6ad836
--- /dev/null
+++ b/security/pinentry/files/patch-gtk2-gmem
@@ -0,0 +1,145 @@
+--- gtk+-2/gtksecentry.c.orig 2007-11-19 16:20:50.000000000 +0500
++++ gtk+-2/gtksecentry.c 2008-04-26 22:52:13.000000000 +0600
+@@ -256,7 +256,7 @@
+
+ static GtkWidgetClass *parent_class = NULL;
+
+-gboolean g_use_secure_mem = FALSE;
++extern gboolean g_use_secure_mem;
+
+ # define g_sec_new(type, count) \
+ ((type *) g_sec_malloc ((unsigned) sizeof (type) * (count)))
+@@ -269,85 +269,6 @@
+ } while(0)
+
+
+-gpointer
+-g_malloc(gulong size)
+-{
+- gpointer p;
+-
+- if (size == 0)
+- return NULL;
+-
+- if (g_use_secure_mem)
+- p = (gpointer) secmem_malloc(size);
+- else
+- p = (gpointer) malloc(size);
+- if (!p)
+- g_error("could not allocate %ld bytes", size);
+-
+- return p;
+-}
+-
+-gpointer
+-g_malloc0(gulong size)
+-{
+- gpointer p;
+-
+- if (size == 0)
+- return NULL;
+-
+- if (g_use_secure_mem) {
+- p = (gpointer) secmem_malloc(size);
+- if (p)
+- memset(p, 0, size);
+- } else
+- p = (gpointer) calloc(size, 1);
+- if (!p)
+- g_error("could not allocate %ld bytes", size);
+-
+- return p;
+-}
+-
+-gpointer
+-g_realloc(gpointer mem, gulong size)
+-{
+- gpointer p;
+-
+- if (size == 0) {
+- g_free(mem);
+-
+- return NULL;
+- }
+-
+- if (!mem) {
+- if (g_use_secure_mem)
+- p = (gpointer) secmem_malloc(size);
+- else
+- p = (gpointer) malloc(size);
+- } else {
+- if (g_use_secure_mem) {
+- g_assert(m_is_secure(mem));
+- p = (gpointer) secmem_realloc(mem, size);
+- } else
+- p = (gpointer) realloc(mem, size);
+- }
+-
+- if (!p)
+- g_error("could not reallocate %lu bytes", (gulong) size);
+-
+- return p;
+-}
+-
+-void
+-g_free(gpointer mem)
+-{
+- if (mem) {
+- if (m_is_secure(mem))
+- secmem_free(mem);
+- else
+- free(mem);
+- }
+-}
+-
+ GType
+ gtk_secure_entry_get_type(void)
+ {
+--- gtk+-2/pinentry-gtk-2.c.orig 2007-11-19 16:44:07.000000000 +0500
++++ gtk+-2/pinentry-gtk-2.c 2008-04-26 22:52:13.000000000 +0600
+@@ -39,6 +39,7 @@
+
+ #include "gtksecentry.h"
+ #include "pinentry.h"
++#include "memory.h"
+
+ #ifdef FALLBACK_CURSES
+ #include "pinentry-curses.h"
+@@ -469,12 +470,36 @@
+
+ pinentry_cmd_handler_t pinentry_cmd_handler = gtk_cmd_handler;
+
++gboolean g_use_secure_mem = FALSE;
++
++static gpointer
++_malloc(gsize size) {
++ return g_use_secure_mem ? secmem_malloc(size) : malloc(size);
++}
++
++static gpointer
++_realloc(gpointer p, gsize size) {
++ return m_is_secure(p) ? secmem_realloc(p, size) : realloc(p, size);
++}
++
++static void
++_free(gpointer p) {
++ m_is_secure(p) ? secmem_free(p) : free(p);
++}
+
+ int
+ main (int argc, char *argv[])
+ {
+ pinentry_init (PGMNAME);
+-
++
++ GMemVTable mem_vtable = {
++ _malloc,
++ _realloc,
++ _free
++ };
++
++ g_mem_set_vtable (&mem_vtable);
++
+ #ifdef FALLBACK_CURSES
+ if (pinentry_have_display (argc, argv))
+ gtk_init (&argc, &argv);
diff --git a/security/pinentry/files/patch-more_sec_mem b/security/pinentry/files/patch-more_sec_mem
new file mode 100644
index 000000000000..81fe8bebea74
--- /dev/null
+++ b/security/pinentry/files/patch-more_sec_mem
@@ -0,0 +1,11 @@
+--- secmem/secmem.c.orig 2007-07-03 05:49:48.000000000 +0600
++++ secmem/secmem.c 2008-02-17 22:19:50.000000000 +0500
+@@ -85,7 +85,7 @@
+ # define MAP_ANONYMOUS MAP_ANON
+ #endif
+
+-#define DEFAULT_POOLSIZE 16384
++#define DEFAULT_POOLSIZE 16384*4
+
+ typedef struct memblock_struct MEMBLOCK;
+ struct memblock_struct {