Skip to content

Commit

Permalink
fltk: Add a FLTK-based pinentry.
Browse files Browse the repository at this point in the history
* NEWS: Update.
* Makefile.am: Add new subdirectory.
* configure.ac: Add configuration for FLTK.
* fltk/Makefile.am: New file.
* fltk/encrypt.xpm: Likewise.
* fltk/icon.xpm: Likewise.
* fltk/main.cxx: Likewise.
* fltk/passwindow.cxx: Likewise.
* fltk/passwindow.h: Likewise.
* fltk/pinwindow.cxx: Likewise.
* fltk/pinwindow.h: Likewise.
* fltk/qualitypasswindow.cxx: Likewise.
* fltk/qualitypasswindow.h: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
  • Loading branch information
Anatoly madRat L. Berenblit authored and Justus Winter committed Mar 8, 2017
1 parent cd7b35e commit 6c45eed
Show file tree
Hide file tree
Showing 13 changed files with 1,217 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile.am
Expand Up @@ -70,9 +70,15 @@ else
pinentry_w32 =
endif

if BUILD_PINENTRY_FLTK
pinentry_fltk = fltk
else
pinentry_fltk =
endif

SUBDIRS = m4 secmem pinentry ${pinentry_curses} ${pinentry_tty} \
${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \
${pinentry_qt} ${pinentry_w32} doc
${pinentry_qt} ${pinentry_w32} ${pinentry_fltk} doc


install-exec-local:
Expand Down
1 change: 1 addition & 0 deletions NEWS
@@ -1,6 +1,7 @@
Noteworthy changes in version 1.0.1 (unreleased)
------------------------------------------------

* A FLTK1.3-based pinentry has been contributed.

Noteworthy changes in version 1.0.0 (2016-11-22)
------------------------------------------------
Expand Down
44 changes: 43 additions & 1 deletion configure.ac
Expand Up @@ -588,6 +588,42 @@ pinentry_w32=no
test $have_w32_system = yes && pinentry_w32=yes
AM_CONDITIONAL(BUILD_PINENTRY_W32, test "$pinentry_w32" = "yes")

dnl
dnl Check for FLTK pinentry program.
dnl
AC_ARG_ENABLE(pinentry-fltk,
AC_HELP_STRING([--enable-pinentry-fltk], [build FLTK 1.3 pinentry]),
pinentry_fltk=$enableval, pinentry_fltk=maybe)

dnl check for fltk-config
if test "$pinentry_fltk" != "no"; then
AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
if test x"${FLTK_CONFIG}" = xno ; then
AC_MSG_WARN([fltk-config is not found])
pinentry_fltk=no
fi
fi

dnl check for FLTK libraries and set flags
if test "$pinentry_fltk" != "no"; then
AC_MSG_CHECKING([for FLTK 1.3])
FLTK_VERSION=`${FLTK_CONFIG} --api-version`
if test ${FLTK_VERSION} != "1.3" ; then
AC_MSG_RESULT([no])
AC_MSG_WARN([FLTK 1.3 not found (available $FLTK_VERSION)])
pinentry_fltk=no
else
AC_MSG_RESULT([yes])
FLTKCFLAGS=`${FLTK_CONFIG} --cflags`
FLTKCXXFLAGS=`${FLTK_CONFIG} --cxxflags`
FLTKLIBS=`${FLTK_CONFIG} --ldflags`
AC_SUBST(FLTKCFLAGS)
AC_SUBST(FLTKCXXFLAGS)
AC_SUBST(FLTKLIBS)
pinentry_fltk=yes
fi
fi
AM_CONDITIONAL(BUILD_PINENTRY_FLTK, test "$pinentry_fltk" = "yes")

# Figure out the default pinentry. We are very conservative here.
# Please change the order only after verifying that the preferred
Expand All @@ -611,7 +647,11 @@ else
if test "$pinentry_w32" = "yes"; then
PINENTRY_DEFAULT=pinentry-w32
else
AC_MSG_ERROR([[No pinentry enabled.]])
if test "$pinentry_fltk" = "yes"; then
PINENTRY_DEFAULT=pinentry-fltk
else
AC_MSG_ERROR([[No pinentry enabled.]])
fi
fi
fi
fi
Expand Down Expand Up @@ -690,6 +730,7 @@ gtk+-2/Makefile
gnome3/Makefile
qt/Makefile
w32/Makefile
fltk/Makefile
doc/Makefile
Makefile
])
Expand All @@ -710,6 +751,7 @@ AC_MSG_NOTICE([
GNOME 3 Pinentry .: $pinentry_gnome_3
Qt Pinentry ......: $pinentry_qt $pinentry_qt_lib_version
W32 Pinentry .....: $pinentry_w32
FLTK Pinentry ....: $pinentry_fltk
Fallback to Curses: $fallback_curses
Emacs integration : $inside_emacs
Expand Down
16 changes: 16 additions & 0 deletions fltk/Makefile.am
@@ -0,0 +1,16 @@
# Makefile.am - PIN entry FLTK frontend.

bin_PROGRAMS = pinentry-fltk

if FALLBACK_CURSES
ncurses_include = $(NCURSES_INCLUDE)
libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV)
else
ncurses_include =
libcurses =
endif

AM_CPPFLAGS = $(COMMON_CFLAGS) $(FLTKCXXFLAGS) $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) $(libcurses)

pinentry_fltk_SOURCES = main.cxx pinwindow.cxx passwindow.cxx qualitypasswindow.cxx
83 changes: 83 additions & 0 deletions fltk/encrypt.xpm
@@ -0,0 +1,83 @@
/* XPM */
static const char * const encrypt_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 45 32 1 ",
" c #9B7738",
". c #B08830",
"X c #CA9703",
"o c #C99607",
"O c #CD9A02",
"+ c #D19D03",
"@ c #D4A002",
"# c #D7A305",
"$ c #D8A501",
"% c #DFAB01",
"& c #DCA803",
"* c #E3B103",
"= c #E7B702",
"- c #C39A31",
"; c #D4AC2F",
": c #E6BE26",
"> c #EFC002",
", c #F5CD06",
"< c #FEE21D",
"1 c #FCE01F",
"2 c #F6D424",
"3 c #B49A55",
"4 c #CAAC5F",
"5 c #FCE854",
"6 c #888887",
"7 c #9A9A9A",
"8 c #A7A7A7",
"9 c #B8B8B7",
"0 c #F3F08F",
"q c #C3C3C3",
"w c gray85",
"e c None",
/* pixels */
"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"eeeeeeeeeee889qqqq987eeeeeeeeeee",
"eeeeeeeee89qwwwqqwwww88eeeeeeeee",
"eeeeeeee99qq877777669wq8eeeeeeee",
"eeeeeee99q888888888876ww9eeeeeee",
"eeeeee99q888888887778869q9eeeeee",
"eeeee89q8888eeeeeeee7786wq8eeeee",
"eeeee999888eeeeeeeeee7777wqeeeee",
"eeee899778eeeeeeeeeeee776wq8eeee",
"eeee8q977eeeeeeeeeeeeee779q9eeee",
"eeee8q977eeeeeeeeeeeeee777w9eeee",
"eeee8q867eeeeeeeeeeeeee776wqeeee",
"eeee8q768eeeeeeeeeeeeee766wqeeee",
"eeee8q768eeeeeeeeeeeeee766wqeeee",
"eeee8q778eeeeeeeeeeeeee776wqeeee",
"eeee8q778eeeeeeeeeeeeee776wqeeee",
"eeee8q888eeeeeeeeeeeeee786wqeeee",
"eeee8q888eeeeeeeeeeeeee786wqeeee",
"eeee8q898eeeeeeeeeeeeee796wqeeee",
"eeee8q898eeeeeeeeeeeeee896wqeeee",
"e45444443333 3333444003e",
"e4552::;;--... ...--;;:25003e",
"e4552,>>=&@OXXooXO+@$&*=>,15003e",
"e4552,>>*&#+ooooo++##&*=>,15003e",
"e4552,>>*&#+XXXXXO+@#&*=>,<5003e",
"e4552,>>=%$+OXXOO++##&*=>,15003e",
"e4552,>>=%$OooXXO+@@#&%=,,<5003e",
"e4552,>>=%$@OXXO+@@#&&*=>,15003e",
"e4552,>>*&$+XXXXOO++@#%=>,<5003e",
"e4552,>>=&$+OXXO++@@$&*=,,<5003e",
"e4552,>>=%$+XXXXOO+@#&*=>,<5003e",
"e4552,>>*&#+ooXO++@##&*>,,<5003e",
"e4552,>>=%$@OXXO++@$$%*>,,<5003e",
"e4552,>>=%$+OXXO++@#$&*=,,<5003e",
"e4552,>>=%$@OOOO++@$&%*=>,<5003e",
"e4552,>>=%$+OXXOO+@#&%=>,,<5003e",
"e4552,>>=%$+OXXOO+@##%*=>,<5003e",
"e4552,>>*&#+oooO++@#&&*>,,<5003e",
"e4552,>>=%$@OOOO+@$&%%*>,,<5003e",
"e4552,>>=%$@OOXO+@$&%%*>,,<5003e",
"e4552,>>=%$+OXXO+@$&&%*>,,<5003e",
"e4552,>>=%$@OOO+@@$&%%=>,,<5003e",
"e4552,>>=%$@OOO+@@$&%%=>,,<5003e",
"e4552,>>=%$@OOO+@@$&%%=>,,<5003e",
"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
};
37 changes: 37 additions & 0 deletions fltk/icon.xpm
@@ -0,0 +1,37 @@
/* XPM */
static const char *const icon_xpm[] = {
"31 29 3 1 ",
" c black",
". c yellow",
"X c None",

"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
" XXXXXXXXXXXXXXXXXX",
" ........... XXXXXXXXXXXXXXXXXX",
" ........... XXXXXXXXXXXXXXXXXX",
" ... ... XXXXXXXXXXXXXXXXXX",
" ... XXX ... ",
" ... XXX ... ................. ",
" ... XXX ... ................. ",
" ... XXX ... ... ... ",
" ... ... XXXXXXX ... X ... ",
" ........... XXXXXXX ... X ... ",
" ........... XXXXXXX X ... ",
" XXXXXXXXXXXXX ",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};

0 comments on commit 6c45eed

Please sign in to comment.