summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2019-02-13 17:39:36 +0000
committerwiz <wiz@pkgsrc.org>2019-02-13 17:39:36 +0000
commit8f7a0461c13a72e241cc5a3b5ebf43d7982bc3b4 (patch)
tree8480a2bc2dc90ead51d209ebfe4250fe4ce7c84a /security
parent7ab9c791c05c779d46cf894f616914f42f18b0df (diff)
downloadpkgsrc-8f7a0461c13a72e241cc5a3b5ebf43d7982bc3b4.tar.gz
security/pinentry-fltk: import pinentry-fltk-1.1.0
Packaged for wip by Michael Bäuerle. This is a collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol as described by the aegypten project. It provides programs for several graphical toolkits, such as FLTK, GTK+ and QT, as well as for the console, using curses. This package contains the FLTK frontend.
Diffstat (limited to 'security')
-rw-r--r--security/pinentry-fltk/DESCR6
-rw-r--r--security/pinentry-fltk/Makefile22
-rw-r--r--security/pinentry-fltk/PLIST2
-rw-r--r--security/pinentry-fltk/patches/patch-fltk_main.cxx87
4 files changed, 117 insertions, 0 deletions
diff --git a/security/pinentry-fltk/DESCR b/security/pinentry-fltk/DESCR
new file mode 100644
index 00000000000..768642085a3
--- /dev/null
+++ b/security/pinentry-fltk/DESCR
@@ -0,0 +1,6 @@
+This is a collection of simple PIN or passphrase entry dialogs which
+utilize the Assuan protocol as described by the aegypten project.
+It provides programs for several graphical toolkits, such as FLTK,
+GTK+ and QT, as well as for the console, using curses.
+
+This package contains the FLTK frontend.
diff --git a/security/pinentry-fltk/Makefile b/security/pinentry-fltk/Makefile
new file mode 100644
index 00000000000..15b48b9fe92
--- /dev/null
+++ b/security/pinentry-fltk/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile,v 1.1 2019/02/13 17:39:36 wiz Exp $
+
+PKGNAME= ${DISTNAME:S/pinentry-/pinentry-fltk-/}
+COMMENT= Applications for entering PINs or Passphrases, FLTK enabled
+
+.include "../../security/pinentry/Makefile.common"
+
+USE_LANGUAGES+= c c++
+USE_TOOLS+= pkg-config
+
+CONFIGURE_ARGS+= --disable-pinentry-gtk2
+CONFIGURE_ARGS+= --disable-pinentry-qt
+CONFIGURE_ARGS+= --disable-pinentry-curses
+CONFIGURE_ARGS+= --disable-pinentry-emacs
+#CONFIGURE_ARGS+= --disable-fallback-curses
+CONFIGURE_ARGS+= --disable-pinentry-gnome3
+CONFIGURE_ARGS+= --disable-libsecret
+
+INSTALL_DIRS= fltk
+
+.include "../../x11/fltk13/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/security/pinentry-fltk/PLIST b/security/pinentry-fltk/PLIST
new file mode 100644
index 00000000000..57eea7c4298
--- /dev/null
+++ b/security/pinentry-fltk/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2019/02/13 17:39:36 wiz Exp $
+bin/pinentry-fltk
diff --git a/security/pinentry-fltk/patches/patch-fltk_main.cxx b/security/pinentry-fltk/patches/patch-fltk_main.cxx
new file mode 100644
index 00000000000..b68c0b7fd36
--- /dev/null
+++ b/security/pinentry-fltk/patches/patch-fltk_main.cxx
@@ -0,0 +1,87 @@
+$NetBSD: patch-fltk_main.cxx,v 1.1 2019/02/13 17:39:36 wiz Exp $
+
+Handle '_' in labels as keyboard shortcuts (used by GPG2).
+Fix format string handling (Patch from Debian).
+
+--- fltk/main.cxx.orig 2017-12-03 16:13:05.000000000 +0000
++++ fltk/main.cxx
+@@ -78,6 +78,44 @@ static std::string escape_accel_utf8(con
+ return result;
+ }
+
++// For button labels
++// Accelerator '_' (used e.g. by GPG2) is converted to '&' (for FLTK)
++// '&' is escaped as in escape_accel_utf8()
++static std::string convert_accel_utf8(const char *s)
++{
++ static bool last_was_underscore = false;
++ std::string result;
++ if (NULL != s)
++ {
++ result.reserve(strlen(s));
++ for (const char *p = s; *p; ++p)
++ {
++ // & => &&
++ if ('&' == *p)
++ result.push_back(*p);
++ // _ => & (handle '__' as escaped underscore)
++ if ('_' == *p)
++ {
++ if (last_was_underscore)
++ {
++ result.push_back(*p);
++ last_was_underscore = false;
++ }
++ else
++ last_was_underscore = true;
++ }
++ else
++ {
++ if (last_was_underscore)
++ result.push_back('&');
++ result.push_back(*p);
++ last_was_underscore = false;
++ }
++ }
++ }
++ return result;
++}
++
+ class cancel_exception
+ {
+
+@@ -111,8 +149,8 @@ static int fltk_cmd_handler(pinentry_t p
+ // TODO: Add parent window to pinentry-fltk window
+ //if (pe->parent_wid){}
+ std::string title = !is_empty(pe->title)?pe->title:PGMNAME;
+- std::string ok = escape_accel_utf8(pe->ok?pe->ok:(pe->default_ok?pe->default_ok:OK_STRING));
+- std::string cancel = escape_accel_utf8(pe->cancel?pe->cancel:(pe->default_cancel?pe->default_cancel:CANCEL_STRING));
++ std::string ok = convert_accel_utf8(pe->ok?pe->ok:(pe->default_ok?pe->default_ok:OK_STRING));
++ std::string cancel = convert_accel_utf8(pe->cancel?pe->cancel:(pe->default_cancel?pe->default_cancel:CANCEL_STRING));
+
+ if (!!pe->pin) // password (or confirmation)
+ {
+@@ -241,12 +279,12 @@ static int fltk_cmd_handler(pinentry_t p
+ if (pe->one_button)
+ {
+ fl_ok = ok.c_str();
+- fl_message(message);
++ fl_message("%s", message);
+ result = 1; // OK
+ }
+ else if (pe->notok)
+ {
+- switch (fl_choice(message, ok.c_str(), cancel.c_str(), pe->notok))
++ switch (fl_choice("%s", ok.c_str(), cancel.c_str(), pe->notok, message))
+ {
+ case 0: result = 1; break;
+ case 2: result = 0; break;
+@@ -256,7 +294,7 @@ static int fltk_cmd_handler(pinentry_t p
+ }
+ else
+ {
+- switch (fl_choice(message, ok.c_str(), cancel.c_str(), NULL))
++ switch (fl_choice("%s", ok.c_str(), cancel.c_str(), NULL, message))
+ {
+ case 0: result = 1; break;
+ default: