diff -up ./configure.ac.fb-tty ./configure.ac --- ./configure.ac.fb-tty 2018-01-09 13:42:04.938391728 +0300 +++ ./configure.ac 2018-01-09 13:43:28.553382360 +0300 @@ -32,13 +32,9 @@ m4_define(mym4_version, [0.9.1]) # the decimalized short revision number, a beta version string and a # flag indicating a development version (mym4_isgit). Note that the # m4 processing is done by autoconf and not during the configure run. -m4_define([mym4_revision], m4_esyscmd([git branch -v 2>/dev/null \ - | awk '/^\* / {printf "%s",$3}'])) -m4_define([mym4_revision_dec], - m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))])) -m4_define([mym4_betastring], - m4_esyscmd_s([git describe --match 'pinentry-[0-9].[0-9].*[0-9]' \ - --long| awk -F- '$3!=0{print"-beta"$3}'])) +m4_define([mym4_revision], [0.9.1]) +m4_define([mym4_revision_dec], [release]) +m4_define([mym4_betastring], []) m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes])) m4_define([mym4_full_version],[mym4_version[]mym4_betastring]) diff -up ./fltk/main.cxx.fb-tty ./fltk/main.cxx --- ./fltk/main.cxx.fb-tty 2018-01-09 13:38:57.729173759 +0300 +++ ./fltk/main.cxx 2018-01-09 13:44:30.049110933 +0300 @@ -37,9 +37,7 @@ #include #include -#ifdef FALLBACK_CURSES -#include -#endif +#include "pinentry-tty.h" #include #include @@ -291,11 +289,9 @@ int main(int argc, char *argv[]) application = *argv; pinentry_init(PGMNAME); -#ifdef FALLBACK_CURSES if (!pinentry_have_display(argc, argv)) - pinentry_cmd_handler = curses_cmd_handler; + pinentry_cmd_handler = tty_cmd_handler; else -#endif { //FLTK understood only -D (--display) // and should be converted into -di[splay] diff -up ./fltk/Makefile.am.fb-tty ./fltk/Makefile.am --- ./fltk/Makefile.am.fb-tty 2018-01-09 13:36:27.440391627 +0300 +++ ./fltk/Makefile.am 2018-01-09 13:44:36.378185917 +0300 @@ -2,15 +2,7 @@ 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) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) -AM_CPPFLAGS = $(COMMON_CFLAGS) $(FLTKCXXFLAGS) $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) $(libcurses) - -pinentry_fltk_SOURCES = main.cxx pinwindow.cxx passwindow.cxx qualitypasswindow.cxx +pinentry_fltk_SOURCES = main.cxx pinwindow.cxx passwindow.cxx qualitypasswindow.cxx pinentry-tty.c diff -up ./fltk/Makefile.in.fb-tty ./fltk/Makefile.in --- ./fltk/Makefile.in.fb-tty 2018-01-09 13:40:11.801051329 +0300 +++ ./fltk/Makefile.in 2018-01-09 13:43:41.660537647 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,9 +93,7 @@ host_triplet = @host@ bin_PROGRAMS = pinentry-fltk$(EXEEXT) subdir = fltk ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -107,18 +105,14 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_pinentry_fltk_OBJECTS = main.$(OBJEXT) pinwindow.$(OBJEXT) \ - passwindow.$(OBJEXT) qualitypasswindow.$(OBJEXT) + passwindow.$(OBJEXT) qualitypasswindow.$(OBJEXT) \ + pinentry-tty.$(OBJEXT) pinentry_fltk_OBJECTS = $(am_pinentry_fltk_OBJECTS) pinentry_fltk_LDADD = $(LDADD) am__DEPENDENCIES_1 = -@FALLBACK_CURSES_TRUE@am__DEPENDENCIES_2 = \ -@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ -@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) \ -@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) pinentry_fltk_DEPENDENCIES = ../pinentry/libpinentry.a \ ../assuan/libassuan.a ../secmem/libsecmem.a \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -135,6 +129,18 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) @@ -215,20 +221,15 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBCAP = @LIBCAP@ -LIBCURSES = @LIBCURSES@ LIBICONV = @LIBICONV@ -LIBNCURSES = @LIBNCURSES@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBTERMCAP = @LIBTERMCAP@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ -MOC = @MOC@ -NCURSES_INCLUDE = @NCURSES_INCLUDE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -240,6 +241,8 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CORE_CFLAGS = @QT4_CORE_CFLAGS@ QT4_CORE_LIBS = @QT4_CORE_LIBS@ QT4_GUI_CFLAGS = @QT4_GUI_CFLAGS@ @@ -302,17 +305,13 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@FALLBACK_CURSES_FALSE@ncurses_include = -@FALLBACK_CURSES_TRUE@ncurses_include = $(NCURSES_INCLUDE) -@FALLBACK_CURSES_FALSE@libcurses = -@FALLBACK_CURSES_TRUE@libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) -AM_CPPFLAGS = $(COMMON_CFLAGS) $(FLTKCXXFLAGS) $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) $(libcurses) -pinentry_fltk_SOURCES = main.cxx pinwindow.cxx passwindow.cxx qualitypasswindow.cxx +AM_CPPFLAGS = $(COMMON_CFLAGS) $(FLTKCXXFLAGS) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) +pinentry_fltk_SOURCES = main.cxx pinwindow.cxx passwindow.cxx qualitypasswindow.cxx pinentry-tty.c all: all-am .SUFFIXES: -.SUFFIXES: .cxx .o .obj +.SUFFIXES: .c .cxx .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -397,9 +396,24 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwindow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-tty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinwindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qualitypasswindow.Po@am__quote@ +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po diff -up ./fltk/pinentry-tty.c.fb-tty ./fltk/pinentry-tty.c --- ./fltk/pinentry-tty.c.fb-tty 2018-01-09 13:37:14.208946337 +0300 +++ ./fltk/pinentry-tty.c 2018-01-09 13:45:08.970572056 +0300 @@ -1,4 +1,4 @@ -/* pinentry-curses.c - A secure curses dialog for PIN entry, library version +/* pinentry-ttys.c - A secure ttys dialog for PIN entry, library version Copyright (C) 2014 Serge Voilokov This file is part of PINENTRY. @@ -35,7 +35,7 @@ #include #include -#include "pinentry.h" +#include #ifndef HAVE_DOSISH_SYSTEM static int timed_out; @@ -178,21 +178,3 @@ tty_cmd_handler(pinentry_t pinentry) do_touch_file (pinentry); return rc; } - - -pinentry_cmd_handler_t pinentry_cmd_handler = tty_cmd_handler; - - -int -main (int argc, char *argv[]) -{ - pinentry_init ("pinentry-tty"); - - /* Consumes all arguments. */ - pinentry_parse_opts(argc, argv); - - if (pinentry_loop ()) - return 1; - - return 0; -} diff -up ./fltk/pinentry-tty.h.fb-tty ./fltk/pinentry-tty.h --- ./fltk/pinentry-tty.h.fb-tty 2018-01-09 13:38:12.983643449 +0300 +++ ./fltk/pinentry-tty.h 2018-01-09 13:45:18.969690521 +0300 @@ -0,0 +1,36 @@ +/* pinentry-ttys.h - A secure ttys dialog for PIN entry, library version + Copyright (C) 2002 g10 Code GmbH + + This file is part of PINENTRY. + + PINENTRY is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + PINENTRY is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA */ + +#ifndef PINENTRY_TTY_H +#define PINENTRY_TTY_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int tty_cmd_handler (pinentry_t pinentry); + +#ifdef __cplusplus +} +#endif + +#endif /* PINENTRY_TTY_H */