pinentry-tqt: updated based on upstream version 1.2.1.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/5/head
Slávek Banko 2 years ago
parent c73404a3ea
commit a5d7db3b2c
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1,117 +0,0 @@
dnl Autoconf macros used by PINENTRY
dnl
dnl Copyright (C) 2002 g10 Code GmbH
dnl
dnl
dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
dnl Check whether a typedef exists and create a #define $2 if it exists
dnl
AC_DEFUN([GNUPG_CHECK_TYPEDEF],
[ AC_MSG_CHECKING(for $1 typedef)
AC_CACHE_VAL(gnupg_cv_typedef_$1,
[AC_TRY_COMPILE([#define _GNU_SOURCE 1
#include <stdlib.h>
#include <sys/types.h>], [
#undef $1
int a = sizeof($1);
], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
AC_MSG_RESULT($gnupg_cv_typedef_$1)
if test "$gnupg_cv_typedef_$1" = yes; then
AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd])
fi
])
######################################################################
# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
# is not called from uid 0 (not tested whether uid 0 works)
# For DECs Tru64 we have also to check whether mlock is in librt
# mlock is there a macro using memlk()
######################################################################
dnl GNUPG_CHECK_MLOCK
dnl
define([GNUPG_CHECK_MLOCK],
[ AC_CHECK_FUNCS(mlock)
if test "$ac_cv_func_mlock" = "no"; then
AC_CHECK_HEADERS(sys/mman.h)
if test "$ac_cv_header_sys_mman_h" = "yes"; then
# Add librt to LIBS:
AC_CHECK_LIB(rt, memlk)
AC_CACHE_CHECK([whether mlock is in sys/mman.h],
gnupg_cv_mlock_is_in_sys_mman,
[AC_TRY_LINK([
#include <assert.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
], [
int i;
/* glibc defines this for functions which it implements
* to always fail with ENOSYS. Some functions are actually
* named something starting with __ and the normal name
* is an alias. */
#if defined (__stub_mlock) || defined (__stub___mlock)
choke me
#else
mlock(&i, 4);
#endif
; return 0;
],
gnupg_cv_mlock_is_in_sys_mman=yes,
gnupg_cv_mlock_is_in_sys_mman=no)])
if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then
AC_DEFINE(HAVE_MLOCK,1,
[Defined if the system supports an mlock() call])
fi
fi
fi
if test "$ac_cv_func_mlock" = "yes"; then
AC_MSG_CHECKING(whether mlock is broken)
AC_CACHE_VAL(gnupg_cv_have_broken_mlock,
AC_TRY_RUN([
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
int main()
{
char *pool;
int err;
long int pgsize = getpagesize();
pool = malloc( 4096 + pgsize );
if( !pool )
return 2;
pool += (pgsize - ((long int)pool % pgsize));
err = mlock( pool, 4096 );
if( !err || errno == EPERM )
return 0; /* okay */
return 1; /* hmmm */
}
],
gnupg_cv_have_broken_mlock="no",
gnupg_cv_have_broken_mlock="yes",
gnupg_cv_have_broken_mlock="assume-no"
)
)
if test "$gnupg_cv_have_broken_mlock" = "yes"; then
AC_DEFINE(HAVE_BROKEN_MLOCK,1,
[Defined if the mlock() call does not work])
AC_MSG_RESULT(yes)
AC_CHECK_FUNCS(plock)
else
if test "$gnupg_cv_have_broken_mlock" = "no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(assuming no)
fi
fi
fi
])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,49 +0,0 @@
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Wed, 13 May 2015 16:09:21 -0400
Subject: avoid self-describing as a beta
Using autoreconf against the source as distributed in tarball form
invariably results in a package that thinks it's a "beta" package,
which produces the "THIS IS A DEVELOPMENT VERSION" warning string.
since we use dh_autoreconf, i need this patch to avoid producing
builds that announce themselves as DEVELOPMENT VERSIONs.
See discussion at:
http://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029065.html
---
autogen.sh | 4 ++--
configure.ac | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 37edfc6..2dff9cd 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -228,8 +228,8 @@ if [ "$myhost" = "find-version" ]; then
rvd=$((0x$(echo ${rev} | head -c 4)))
else
ingit=no
- beta=yes
- tmp="-unknown"
+ beta=no
+ tmp=""
rev="0000000"
rvd="0"
fi
diff --git a/configure.ac b/configure.ac
index c1b66d6..05a902a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,9 +36,7 @@ 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_betastring],[])
m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
m4_define([mym4_full_version],[mym4_version[]mym4_betastring])

@ -1 +0,0 @@
0001-avoid-self-describing-as-a-beta.patch

@ -1,2 +0,0 @@
Tests: simple-tty
Depends: python3, pinentry-tty

@ -1,4 +0,0 @@
@set UPDATED 3 December 2017
@set UPDATED-MONTH December 2017
@set EDITION 1.1.0
@set VERSION 1.1.0

@ -1,4 +0,0 @@
@set UPDATED 3 December 2017
@set UPDATED-MONTH December 2017
@set EDITION 1.1.0
@set VERSION 1.1.0

@ -1,121 +0,0 @@
# gpg-error.m4 - autoconf macro to detect libgpg-error.
# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2014-10-02
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
dnl used for programs requireing real multi thread support.
dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_GPG_ERROR],
[ AC_REQUIRE([AC_CANONICAL_HOST])
gpg_error_config_prefix=""
dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
dnl since that is consistent with how our three siblings use the directory/
dnl package name in --with-$dir_name-prefix=PFX.
AC_ARG_WITH(libgpg-error-prefix,
AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
[prefix where GPG Error is installed (optional)]),
[gpg_error_config_prefix="$withval"])
dnl Accept --with-gpg-error-prefix and make it work the same as
dnl --with-libgpg-error-prefix above, for backwards compatibility,
dnl but do not document this old, inconsistently-named option.
AC_ARG_WITH(gpg-error-prefix,,
[gpg_error_config_prefix="$withval"])
if test x"${GPG_ERROR_CONFIG}" = x ; then
if test x"${gpg_error_config_prefix}" != x ; then
GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/gpg-error-config" ; then
GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi
fi
AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
min_gpg_error_version=ifelse([$1], ,0.0,$1)
AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
ok=no
if test "$GPG_ERROR_CONFIG" != "no" \
&& test -f "$GPG_ERROR_CONFIG" ; then
req_major=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
major=`echo $gpg_error_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $gpg_error_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
if test "$major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -ge "$req_minor"; then
ok=yes
fi
fi
fi
fi
if test $ok = yes; then
GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
AC_MSG_RESULT([yes ($gpg_error_config_version)])
ifelse([$2], , :, [$2])
gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
if test x"$gpg_error_config_host" != xnone ; then
if test x"$gpg_error_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $GPG_ERROR_CONFIG was
*** built for $gpg_error_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-gpg-error-prefix
*** to specify a matching config script or use \$SYSROOT.
***]])
gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
fi
fi
else
GPG_ERROR_CFLAGS=""
GPG_ERROR_LIBS=""
GPG_ERROR_MT_CFLAGS=""
GPG_ERROR_MT_LIBS=""
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
AC_SUBST(GPG_ERROR_CFLAGS)
AC_SUBST(GPG_ERROR_LIBS)
AC_SUBST(GPG_ERROR_MT_CFLAGS)
AC_SUBST(GPG_ERROR_MT_LIBS)
])

@ -1,103 +0,0 @@
# iconv.m4 serial AM4 (gettext-0.11.3)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
])
AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
fi
if test "$am_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
AC_SUBST(LIBICONV)
AC_SUBST(LTLIBICONV)
])
AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
])

@ -15,14 +15,14 @@ List of Copyright holders
=========================
Copyright (C) 1999 Robert Bihlmeyer <robbe@orcus.priv.at>
Copyright (C) 2001-2004, 2007-2008, 2010, 2015-2017 g10 Code GmbH
Copyright (C) 2001-2004, 2007-2008, 2010, 2015-2017, 2021 g10 Code GmbH
Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB)
Copyright (C) 2004 by Albrecht Dreß <albrecht.dress@arcor.de>
Copyright 2007 Ingo Klöcker
Copyright (C) 2007 Ingo Klöcker
Copyright (C) 2014 Serge Voilokov
Copyright (C) 2015 Daiki Ueno
Copyright (C) 2015 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Copyright 2016 Intevation GmbH
Copyright (C) 2016 Intevation GmbH
Copyright (C) 2016 Anatoly madRat L. Berenblit

@ -24,7 +24,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-pinentry-qt --enable-pinentry-emacs
GITLOG_TO_CHANGELOG=gitlog-to-changelog
EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old \
EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old VERSION \
build-aux/gitlog-to-changelog \
build-aux/git-log-fix build-aux/git-log-footer
@ -64,6 +64,12 @@ else
pinentry_qt =
endif
if BUILD_PINENTRY_QT4
pinentry_qt4 = qt4
else
pinentry_qt4 =
endif
if BUILD_PINENTRY_TQT
pinentry_tqt = tqt
else
@ -82,10 +88,22 @@ else
pinentry_fltk =
endif
if BUILD_PINENTRY_EFL
pinentry_efl = efl
else
pinentry_efl =
endif
if BUILD_DOC
doc = doc
else
doc =
endif
SUBDIRS = m4 secmem pinentry ${pinentry_curses} ${pinentry_tty} \
${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \
${pinentry_qt} ${pinentry_tqt} ${pinentry_w32} \
${pinentry_fltk} doc
${pinentry_qt} ${pinentry_qt4} ${pinentry_tqt} ${pinentry_w32} \
${pinentry_fltk} ${pinentry_efl} ${doc}
install-exec-local:
@ -95,11 +113,10 @@ install-exec-local:
done
(cd $(DESTDIR)$(bindir); \
rm -f pinentry; \
$(LN_S) $(PINENTRY_DEFAULT)$(EXEEXT) pinentry)
rm -f pinentry$(EXEEXT); \
$(LN_S) $(PINENTRY_DEFAULT)$(EXEEXT) pinentry$(EXEEXT))
dist-hook: gen-ChangeLog
echo "$(VERSION)" > $(distdir)/VERSION
distcheck-hook:
set -e; ( \

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -33,7 +33,17 @@
# along with this program; if not, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -97,28 +107,16 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in COPYING THANKS TODO build-aux/compile \
build-aux/config.guess build-aux/config.rpath \
build-aux/config.sub depcomp build-aux/depcomp install-sh \
build-aux/install-sh build-aux/mdate-sh missing \
build-aux/missing mkinstalldirs build-aux/texinfo.tex \
$(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.rpath \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/install-sh \
$(top_srcdir)/build-aux/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -159,9 +157,9 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@ -182,7 +180,19 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = m4 secmem pinentry curses tty emacs gtk+-2 gnome3 qt \
tqt w32 fltk doc
qt4 tqt w32 fltk efl doc
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.rpath \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/install-sh \
$(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \
INSTALL NEWS README THANKS TODO build-aux/compile \
build-aux/config.guess build-aux/config.rpath \
build-aux/config.sub build-aux/depcomp build-aux/install-sh \
build-aux/mdate-sh build-aux/missing build-aux/texinfo.tex \
depcomp install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -221,6 +231,8 @@ am__relativize = \
GZIP_ENV = --best
DIST_ARCHIVES = $(distdir).tar.bz2
DIST_TARGETS = dist-bzip2
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@ -248,6 +260,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -257,6 +271,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = gitlog-to-changelog
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -270,11 +285,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -283,6 +299,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -291,6 +309,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -304,16 +324,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -363,6 +390,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -373,7 +401,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = --disable-pinentry-qt --enable-pinentry-emacs
EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old \
EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old VERSION \
build-aux/gitlog-to-changelog \
build-aux/git-log-fix build-aux/git-log-footer
@ -389,16 +417,22 @@ EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old \
@BUILD_PINENTRY_GNOME_3_TRUE@pinentry_gnome_3 = gnome3
@BUILD_PINENTRY_QT_FALSE@pinentry_qt =
@BUILD_PINENTRY_QT_TRUE@pinentry_qt = qt
@BUILD_PINENTRY_QT4_FALSE@pinentry_qt4 =
@BUILD_PINENTRY_QT4_TRUE@pinentry_qt4 = qt4
@BUILD_PINENTRY_TQT_FALSE@pinentry_tqt =
@BUILD_PINENTRY_TQT_TRUE@pinentry_tqt = tqt
@BUILD_PINENTRY_W32_FALSE@pinentry_w32 =
@BUILD_PINENTRY_W32_TRUE@pinentry_w32 = w32
@BUILD_PINENTRY_FLTK_FALSE@pinentry_fltk =
@BUILD_PINENTRY_FLTK_TRUE@pinentry_fltk = fltk
@BUILD_PINENTRY_EFL_FALSE@pinentry_efl =
@BUILD_PINENTRY_EFL_TRUE@pinentry_efl = efl
@BUILD_DOC_FALSE@doc =
@BUILD_DOC_TRUE@doc = doc
SUBDIRS = m4 secmem pinentry ${pinentry_curses} ${pinentry_tty} \
${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \
${pinentry_qt} ${pinentry_tqt} ${pinentry_w32} \
${pinentry_fltk} doc
${pinentry_qt} ${pinentry_qt4} ${pinentry_tqt} ${pinentry_w32} \
${pinentry_fltk} ${pinentry_efl} ${doc}
gen_start_date = 2012-08-08T00:00:00
all: config.h
@ -420,15 +454,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -561,7 +594,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -629,7 +665,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@ -643,18 +679,22 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-zstd: distdir
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -672,7 +712,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -682,26 +722,28 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
@ -862,17 +904,19 @@ uninstall-am:
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-exec-local install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am
dist-zip dist-zstd distcheck distclean distclean-generic \
distclean-hdr distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-exec-local \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
install-exec-local:
@ -882,11 +926,10 @@ install-exec-local:
done
(cd $(DESTDIR)$(bindir); \
rm -f pinentry; \
$(LN_S) $(PINENTRY_DEFAULT)$(EXEEXT) pinentry)
rm -f pinentry$(EXEEXT); \
$(LN_S) $(PINENTRY_DEFAULT)$(EXEEXT) pinentry$(EXEEXT))
dist-hook: gen-ChangeLog
echo "$(VERSION)" > $(distdir)/VERSION
distcheck-hook:
set -e; ( \

@ -1,3 +1,69 @@
Noteworthy changes in version 1.2.1 (2022-08-24)
------------------------------------------------
* qt: Support building with Qt 5.9. [T5592]
* curses: Handle an error at curses initialization. [T5623]
* curses: Specify fg/bg when an extention of Ncurses is not available.
[T5631]
* qt: Fix translation of context menu entries. [T5786]
* qt: Further improve the accessibility. [T5863]
* qt: Fix moving focus to second input field when pressing Enter in
first input field. [T5866]
* qt: Update the cursor position when reformatting the text. [T5972]
* qt: Use foreground raising code also with the confirm prompt.
[T6134]
* Make the legacy qt4 version build again. [T5569]
* Make sure an entered PIN is always cleared from memory. [T5977]
* Build fixes for Windows. [T5893]
Noteworthy changes in version 1.2.0 (2021-08-25)
------------------------------------------------
* qt: Show a warning if Caps Lock is on on Windows, X11 (requires
libX11 and Qt5X11Extras), and Wayland (requires KF5WaylandClient).
[T4950]
* qt: Support password formatting. This makes generated passwords
easier to transcript. [T5517]
* qt: Fix showing of pinentry window on Wayland. [T5528]
* qt: Check passphrase constraints before accepting passphrase if
passphrase constraints are requested to be enforced. [T5532]
* qt: Improve detection of running in a GUI session. [T3659]
* qt: Improve accessibility when entering new password. [T5543]
Release-info: https://dev.gnupg.org/T5566
Noteworthy changes in version 1.1.1 (2021-01-21)
------------------------------------------------
* A EFL-based pinentry has been contributed.
* Disable echoing in backspace key is pressed first
(GTK, Qt, TQt, and ncurses pinentries).
* Support line editing in TTY pinentry.
* Remove support for old GTK+2 (< 2.12.0).
* Various minor fixes.
Noteworthy changes in version 1.1.0 (2017-12-03)
------------------------------------------------

@ -14,6 +14,9 @@ GTK+ V2.0 --enable-pinentry-gtk2 Gimp Toolkit Library, Version 2.0
eg. libgtk-x11-2.0 and libglib-2.0
GNOME --enable-pinentry-gnome GNOME
Qt --enable-pinentry-qt Qt (> 4.4.0)
TQt --enable-pinentry-tqt Trinity Qt
Enlightenment --enable-pinentry-efl EFL (>= 1.18)
FLTK --enable-pinentry-fltk Fast Light Toolkit (>= 1.3)
Curses --enable-pinentry-curses Curses library, for example ncurses
TTY --enable-pinentry-tty Simple TTY version, no dependencies

@ -0,0 +1,109 @@
dnl Autoconf macros used by PINENTRY
dnl
dnl Copyright (C) 2002, 2022 g10 Code GmbH
dnl
dnl
######################################################################
# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
# is not called from uid 0 (not tested whether uid 0 works)
# For DECs Tru64 we have also to check whether mlock is in librt
# mlock is there a macro using memlk()
######################################################################
dnl GNUPG_CHECK_MLOCK
dnl
define(GNUPG_CHECK_MLOCK,
[ AC_CHECK_FUNCS(mlock)
if test "$ac_cv_func_mlock" = "no"; then
AC_CHECK_HEADERS(sys/mman.h)
if test "$ac_cv_header_sys_mman_h" = "yes"; then
# Add librt to LIBS:
AC_CHECK_LIB(rt, memlk)
AC_CACHE_CHECK([whether mlock is in sys/mman.h],
gnupg_cv_mlock_is_in_sys_mman,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <assert.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
]], [[
int i;
/* glibc defines this for functions which it implements
* to always fail with ENOSYS. Some functions are actually
* named something starting with __ and the normal name
* is an alias. */
#if defined (__stub_mlock) || defined (__stub___mlock)
choke me
#else
mlock(&i, 4);
#endif
; return 0;
]])],
gnupg_cv_mlock_is_in_sys_mman=yes,
gnupg_cv_mlock_is_in_sys_mman=no)])
if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then
AC_DEFINE(HAVE_MLOCK,1,
[Defined if the system supports an mlock() call])
fi
fi
fi
if test "$ac_cv_func_mlock" = "yes"; then
AC_CHECK_FUNCS(sysconf getpagesize)
AC_MSG_CHECKING(whether mlock is broken)
AC_CACHE_VAL(gnupg_cv_have_broken_mlock,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
int main()
{
char *pool;
int err;
long int pgsize;
#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
pgsize = sysconf (_SC_PAGESIZE);
#elif defined (HAVE_GETPAGESIZE)
pgsize = getpagesize();
#else
pgsize = -1;
#endif
if (pgsize == -1)
pgsize = 4096;
pool = malloc( 4096 + pgsize );
if( !pool )
return 2;
pool += (pgsize - ((size_t)pool % pgsize));
err = mlock( pool, 4096 );
if( !err || errno == EPERM || errno == EAGAIN)
return 0; /* okay */
return 1; /* hmmm */
}
]])],
gnupg_cv_have_broken_mlock="no",
gnupg_cv_have_broken_mlock="yes",
gnupg_cv_have_broken_mlock="assume-no"
)
)
if test "$gnupg_cv_have_broken_mlock" = "yes"; then
AC_DEFINE(HAVE_BROKEN_MLOCK,1,
[Defined if the mlock() call does not work])
AC_MSG_RESULT(yes)
else
if test "$gnupg_cv_have_broken_mlock" = "no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(assuming no)
fi
fi
fi
])

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# lib-ld.m4 serial 6
dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc.
dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -141,7 +141,7 @@ AC_LIB_PROG_LD_GNU
])
# lib-link.m4 serial 26 (gettext-0.18.2)
dnl Copyright (C) 2001-2014 Free Software Foundation, Inc.
dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -919,7 +919,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
])
# lib-prefix.m4 serial 7 (gettext-0.18)
dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc.
dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -1143,7 +1143,7 @@ sixtyfour bits
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
])
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1155,10 +1155,10 @@ sixtyfour bits
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.14'
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.14.1], [],
m4_if([$1], [1.16.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -1174,14 +1174,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.14.1])dnl
[AM_AUTOMAKE_VERSION([1.16.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1233,7 +1233,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1264,7 +1264,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1455,13 +1455,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@ -1469,49 +1468,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@ -1520,18 +1513,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1618,11 +1610,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@ -1686,7 +1678,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -1696,6 +1688,9 @@ END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
@ -1725,7 +1720,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1736,7 +1731,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -1746,7 +1741,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
# Copyright (C) 2003-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1768,7 +1763,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1803,7 +1798,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1811,49 +1806,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1874,12 +1862,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@ -1890,38 +1873,9 @@ else
fi
])
# -*- Autoconf -*-
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([AM_CONFIG_HEADER],
[AC_DIAGNOSE([obsolete],
['$0': this macro is obsolete.
You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
AC_CONFIG_HEADERS($@)])
AC_DEFUN([AM_PROG_CC_STDC],
[AC_PROG_CC
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
AC_DIAGNOSE([obsolete],
['$0': this macro is obsolete.
You should simply use the 'AC][_PROG_CC' macro instead.
Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
but upon 'ac_cv_prog_cc_stdc'.])])
AC_DEFUN([AM_C_PROTOTYPES],
[AC_FATAL([automatic de-ANSI-fication support has been removed])])
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1950,7 +1904,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1997,7 +1951,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2016,7 +1970,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2097,7 +2051,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2157,7 +2111,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2185,7 +2139,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2204,7 +2158,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2004-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -2341,4 +2295,5 @@ m4_include([m4/iconv.m4])
m4_include([m4/libassuan.m4])
m4_include([m4/pkg.m4])
m4_include([m4/qt.m4])
m4_include([m4/qt4.m4])
m4_include([acinclude.m4])

@ -14,8 +14,6 @@ esac
case "$myhost" in
w32)
configure_opts="
--with-gpg-error-prefix=@SYSROOT@
--with-libassuan-prefix=@SYSROOT@
--with-libiconv-prefix=@SYSROOT@
PKG_CONFIG_LIBDIR=@SYSROOT@/lib/pkgconfig
"

@ -1,6 +1,6 @@
#! /bin/sh
# autogen.sh
# Copyright (C) 2003, 2014 g10 Code GmbH
# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@ -15,7 +15,7 @@
# configure it for the respective package. It is maintained as part of
# GnuPG and source copied by other packages.
#
# Version: 2014-06-06
# Version: 2018-07-10
configure_ac="configure.ac"
@ -74,13 +74,23 @@ PRINT_HOST=no
PRINT_BUILD=no
tmp=$(dirname "$0")
tsdir=$(cd "${tmp}"; pwd)
version_parts=3
if [ -n "${AUTOGEN_SH_SILENT}" ]; then
SILENT=" --silent"
fi
if test x"$1" = x"--help"; then
echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]"
echo "usage: ./autogen.sh [OPTIONS] [ARGS]"
echo " Options:"
echo " --silent Silent operation"
echo " --force Pass --force to autoconf"
echo " --find-version Helper for configure.ac"
echo " --git-build Run all commands to build from a Git"
echo " --print-host Print only the host triplet"
echo " --print-build Print only the build platform triplet"
echo " --build-TYPE Configure to cross build for TYPE"
echo ""
echo " ARGS are passed to configure in --build-TYPE mode."
echo " Configuration for this script is expected in autogen.rc"
exit 0
fi
if test x"$1" = x"--silent"; then
@ -149,6 +159,10 @@ case "$1" in
SILENT=" --silent"
shift
;;
--git-build)
myhost="git-build"
shift
;;
--build-w32)
myhost="w32"
shift
@ -177,6 +191,25 @@ esac
die_p
# **** GIT BUILD ****
# This is a helper to build from git.
if [ "$myhost" = "git-build" ]; then
tmp="$(pwd)"
cd "$tsdir" || fatal "error cd-ing to $tsdir"
./autogen.sh || fatal "error running ./autogen.sh"
cd "$tmp" || fatal "error cd-ing back to $tmp"
die_p
"$tsdir"/configure || fatal "error running $tsdir/configure"
die_p
make || fatal "error running make"
die_p
make check || fatal "error running make check"
die_p
exit 0
fi
# **** end GIT BUILD ****
# Source our configuration
if [ -f "${tsdir}/autogen.rc" ]; then
. "${tsdir}/autogen.rc"
@ -200,32 +233,36 @@ if [ "$myhost" = "find-version" ]; then
minor="$3"
micro="$4"
case "$version_parts" in
2)
matchstr1="$package-$major.[0-9]*"
matchstr2="$package-$major-base"
vers="$major.$minor"
;;
*)
matchstr1="$package-$major.$minor.[0-9]*"
matchstr2="$package-$major.$minor-base"
vers="$major.$minor.$micro"
;;
esac
if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then
echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2
exit 1
fi
if [ -z "$micro" ]; then
matchstr1="$package-$major.[0-9]*"
matchstr2="$package-$major-base"
vers="$major.$minor"
else
matchstr1="$package-$major.$minor.[0-9]*"
matchstr2="$package-$major.$minor-base"
vers="$major.$minor.$micro"
fi
beta=no
if [ -d .git ]; then
if [ -e .git ]; then
ingit=yes
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
tmp=$(echo "$tmp" | sed s/^"$package"//)
if [ -n "$tmp" ]; then
tmp=$(echo "$tmp"|awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
tmp=$(echo "$tmp" | sed s/^"$package"// \
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
else
tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
| awk -F- '$4!=0{print"-beta"$4}')
fi
[ -n "$tmp" ] && beta=yes
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
rvd=$((0x$(echo ${rev} | head -c 4)))
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
else
ingit=no
beta=yes
@ -311,6 +348,7 @@ if [ "$myhost" = "w32" ]; then
$tsdir/configure --enable-maintainer-mode ${SILENT} \
--prefix=${w32root} \
--host=${host} --build=${build} SYSROOT=${w32root} \
PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \
${configure_opts} ${extraoptions} "$@"
rc=$?
exit $rc
@ -416,8 +454,11 @@ fi
# Check the git setup.
if [ -d .git ]; then
CP="cp -a"
[ -z "${SILENT}" ] && CP="$CP -v"
CP="cp -p"
# If we have a GNU cp we can add -v
if cp --version >/dev/null 2>/dev/null; then
[ -z "${SILENT}" ] && CP="$CP -v"
fi
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
[ -z "${SILENT}" ] && cat <<EOF
*** Activating trailing whitespace git pre-commit hook. ***
@ -446,6 +487,10 @@ EOF
EOF
$CP build-aux/git-hooks/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
if [ x"${display_name}" != x ]; then
git config format.subjectPrefix "PATCH ${display_name}"
git config sendemail.to "${patches_to}"
fi
fi
fi

File diff suppressed because it is too large Load Diff

@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2013 Free Software Foundation, Inc.
# Copyright 1996-2020 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@ -367,11 +367,7 @@ else
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
@ -548,13 +544,11 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'

File diff suppressed because it is too large Load Diff

@ -31,8 +31,8 @@
/* Defined if the mlock() call does not work */
#undef HAVE_BROKEN_MLOCK
/* Defined if a `byte' is typedef'd */
#undef HAVE_BYTE_TYPEDEF
/* Define to 1 if the system has the type `byte'. */
#undef HAVE_BYTE
/* Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2)
with special properties like no file modes */
@ -41,7 +41,10 @@
/* Defined if the OS supports drive letters. */
#undef HAVE_DRIVE_LETTERS
/* Define if you have the iconv() function. */
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define to 1 if you have the <inttypes.h> header file. */
@ -71,12 +74,12 @@
/* Define if you have working ncursesw */
#undef HAVE_NCURSESW
/* Define to 1 if you have the `plock' function. */
#undef HAVE_PLOCK
/* Define to 1 if you have the `seteuid' function. */
#undef HAVE_SETEUID
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@ -92,6 +95,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
@ -104,8 +110,11 @@
/* Define to 1 if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Defined if a `ulong' is typedef'd */
#undef HAVE_ULONG_TYPEDEF
/* Define to 1 if the system has the type `u64'. */
#undef HAVE_U64
/* Define to 1 if the system has the type `ulong'. */
#undef HAVE_ULONG
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@ -122,6 +131,9 @@
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* The pinentries can optionally use x11. */
#undef HAVE_X11
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
@ -158,15 +170,21 @@
/* The qt version of Pinentry is to be build */
#undef PINENTRY_QT
/* The qt4 version of Pinentry is to be build */
#undef PINENTRY_QT4
/* pinentry-qt should use KF5WaylandClient. */
#undef PINENTRY_QT_WAYLAND
/* pinentry-qt should use x11. */
#undef PINENTRY_QT_X11
/* The TTY version of Pinentry is to be build */
#undef PINENTRY_TTY
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* The capabilities support library is installed */
#undef USE_CAPABILITIES
/* Set this to limit filenames to the 8.3 format */
#undef USE_ONLY_8DOT3

@ -19,37 +19,38 @@
# SPDX-License-Identifier: GPL-2.0+
# (Process this file with autoconf to produce a configure script.)
AC_PREREQ(2.69)
AC_PREREQ([2.69])
min_automake_version="1.14"
# To build a release you need to create a tag with the version number
# (git tag -s pinentry-n.m.k) and run "./autogen.sh --force". Please
# bump the version number immediately after the release, do another
# commit, and a push so that the git magic is able to work.
m4_define(mym4_version, [1.1.0])
# bump the version number immediately after the release and do another
# commit and push so that the git magic is able to work.
m4_define([mym4_package],[pinentry])
m4_define([mym4_major], [1])
m4_define([mym4_minor], [2])
m4_define([mym4_micro], [1])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
# flag indicating a development version (mym4_isgit). Note that the
# flag indicating a development version (mym4_isbeta). 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_isgit],m4_if(mym4_betastring,[],[no],[yes]))
m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
AC_INIT([pinentry],[mym4_full_version], [https://bugs.gnupg.org])
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
mym4_package mym4_major mym4_minor mym4_micro),[:]))
m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
m4_define([mym4_version], m4_argn(4, mym4_verslist))
m4_define([mym4_revision], m4_argn(7, mym4_verslist))
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
m4_esyscmd([echo ]mym4_version[>VERSION])
AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR(pinentry/pinentry.h)
AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
AM_MAINTAINER_MODE
@ -217,11 +218,10 @@ fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h wchar.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(seteuid stpcpy mmap)
AC_CHECK_FUNCS(seteuid stpcpy mmap stat)
GNUPG_CHECK_MLOCK
dnl Checks for standard types.
@ -272,30 +272,16 @@ COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS"
dnl Checks for libsecmem.
GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
dnl Check for libcap
AC_ARG_WITH([libcap], AC_HELP_STRING([--without-libcap],
[Disable support for capabilities library]))
if test "x$with_libcap" != "xno"; then
AC_PATH_PROG(SETCAP, setcap, :, "$PATH:/sbin:/usr/sbin")
AC_CHECK_LIB(cap, cap_set_proc, [
AC_DEFINE(USE_CAPABILITIES,1,[The capabilities support library is installed])
LIBCAP=-lcap
])
fi
AC_SUBST(LIBCAP)
AC_CHECK_TYPES([byte, ulong, u64])
dnl
dnl Check for curses pinentry program.
dnl
AC_ARG_ENABLE(pinentry-curses,
AC_HELP_STRING([--enable-pinentry-curses], [build curses pinentry]),
AS_HELP_STRING([--enable-pinentry-curses],[build curses pinentry]),
pinentry_curses=$enableval, pinentry_curses=maybe)
AC_ARG_ENABLE(fallback-curses,
AC_HELP_STRING([--enable-fallback-curses], [include curses fallback]),
AS_HELP_STRING([--enable-fallback-curses],[include curses fallback]),
fallback_curses=$enableval, fallback_curses=maybe)
dnl
@ -340,7 +326,7 @@ dnl
dnl Check for tty pinentry program.
dnl
AC_ARG_ENABLE(pinentry-tty,
AC_HELP_STRING([--enable-pinentry-tty], [build tty pinentry]),
AS_HELP_STRING([--enable-pinentry-tty],[build tty pinentry]),
pinentry_tty=$enableval, pinentry_tty=maybe)
AM_CONDITIONAL(BUILD_PINENTRY_TTY, test "$pinentry_tty" = "yes")
@ -369,21 +355,18 @@ dnl
dnl Check for emacs pinentry program.
dnl
AC_ARG_ENABLE(pinentry-emacs,
AC_HELP_STRING([--enable-pinentry-emacs], [build emacs pinentry]),
AS_HELP_STRING([--enable-pinentry-emacs],[build emacs pinentry]),
pinentry_emacs=$enableval, pinentry_emacs=no)
AC_ARG_ENABLE(inside-emacs,
AC_HELP_STRING([--enable-inside-emacs], [include emacs hack]),
AS_HELP_STRING([--enable-inside-emacs],[include emacs hack]),
inside_emacs=$enableval, inside_emacs=maybe)
if test "$pinentry_emacs" != "no" -o "$inside_emacs" != "no"; then
AC_MSG_CHECKING([if Unix domain socket is supported])
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/socket.h>
#include <sys/un.h>
],
[int s = socket (AF_UNIX, SOCK_STREAM, 0);],
[_unixsock_works=yes],
[_unixsock_works=no])
]], [[int s = socket (AF_UNIX, SOCK_STREAM, 0);]])],[_unixsock_works=yes],[_unixsock_works=no])
AC_MSG_RESULT($_unixsock_works)
if test "$_unixsock_works" = "yes"; then
if test "$pinentry_emacs" != "no"; then
@ -418,22 +401,51 @@ fi
dnl
dnl Check for EFL pinentry programs.
dnl
AC_ARG_ENABLE(pinentry-efl,
AS_HELP_STRING([--enable-pinentry-efl],[build EFL pinentry]),
pinentry_efl=$enableval, pinentry_efl=maybe)
if test "$pinentry_efl" != "no"; then
PKG_CHECK_MODULES(
EFL,
[elementary >= 1.18,ecore-x],
[
pinentry_efl=yes
],
[
if test "$pinentry_efl" = "yes"; then
AC_MSG_ERROR([[
***
*** efl (elementary >= 1.18, ecore-x) is required for pinentry-efl.
***]])
else
AC_MSG_WARN([pkg-config could not find the modules elementary or ecore-x])
fi
pinentry_efl=no
]
)
fi
AM_CONDITIONAL(BUILD_PINENTRY_EFL, test "$pinentry_efl" = "yes")
dnl
dnl Check for GTK+-2 / GNOME3 pinentry programs.
dnl
AC_ARG_ENABLE(pinentry-gtk2,
AC_HELP_STRING([--enable-pinentry-gtk2], [build GTK+-2 pinentry]),
AS_HELP_STRING([--enable-pinentry-gtk2],[build GTK+-2 pinentry]),
pinentry_gtk_2=$enableval, pinentry_gtk_2=maybe)
AC_ARG_ENABLE(pinentry-gnome3,
AC_HELP_STRING([--enable-pinentry-gnome3], [build GNOME 3 pinentry]),
AS_HELP_STRING([--enable-pinentry-gnome3],[build GNOME 3 pinentry]),
pinentry_gnome_3=$enableval, pinentry_gnome_3=maybe)
dnl check if the module gtk+-2.0 exists
if test "$pinentry_gtk_2" != "no"; then
PKG_CHECK_MODULES(
GTK2,
[gtk+-2.0 >= 2.4.0],
[gtk+-2.0 >= 2.12.0],
[
test "$pinentry_gtk_2" != "no" && pinentry_gtk_2=yes
test "$pinentry_gnome_3" != "no" && pinentry_gnome_3=yes
@ -467,8 +479,8 @@ dnl
dnl Check for libsecret.
dnl
AC_ARG_ENABLE(libsecret,
AC_HELP_STRING([--enable-libsecret],
[optionally cache passphrases using libsecret]),
AS_HELP_STRING([--enable-libsecret],
[optionally cache passphrases using libsecret]),
libsecret=$enableval, libsecret=maybe)
dnl check if the module libsecret exists
@ -493,24 +505,61 @@ if test "$libsecret" = "yes"; then
fi
dnl
dnl Check for Qt pinentry program.
dnl Check for libX11 library
dnl
have_x11=no
if test "$have_w32_system" != "yes"; then
PKG_CHECK_MODULES(
LIBX11,
[x11],
[have_x11=yes],
[
AC_MSG_WARN([pkg-config could not find the module x11])
have_x11=no
]
)
if test "$have_x11" = "yes"; then
AC_DEFINE(HAVE_X11, 1,
[The pinentries can optionally use x11.])
fi
fi
dnl
dnl Check for KF5WaylandClient library
dnl
have_kf5waylandclient=no
if test "$have_w32_system" != "yes"; then
PKG_CHECK_MODULES(
KF5WAYLANDCLIENT,
[KF5WaylandClient >= 5.60],
[have_kf5waylandclient=yes],
[
AC_MSG_WARN([pkg-config could not find the module KF5WaylandClient])
have_kf5waylandclient=no
]
)
fi
dnl
dnl Check for Qt5 pinentry program.
dnl
AC_ARG_ENABLE(pinentry-qt,
AC_HELP_STRING([--enable-pinentry-qt], [build qt pinentry]),
AS_HELP_STRING([--enable-pinentry-qt],[build Qt5 pinentry]),
pinentry_qt=$enableval, pinentry_qt=maybe)
dnl
dnl Checks for qt libraries. Deal correctly with $pinentry_qt = maybe.
dnl Tries to find Qt5, falls back on Qt4
dnl Tries to find Qt5
dnl
if test "$pinentry_qt" != "no"; then
FIND_QT
if test "$have_qt4_libs" != "yes" -a "$have_qt5_libs" != "yes"; then
if test "$have_qt5_libs" != "yes"; then
if test "$pinentry_qt" = "yes"; then
AC_MSG_ERROR([[
***
*** Qt4 (QtCore, QtGui) or Qt5 (Qt5Core, Qt5Gui, Qt5Widgets) is required.
*** Qt5 (Qt5Core, Qt5Gui, Qt5Widgets) is required.
***]])
else
pinentry_qt=no
@ -520,6 +569,7 @@ fi
AC_SUBST(PINENTRY_QT_CFLAGS)
AC_SUBST(PINENTRY_QT_LIBS)
AC_SUBST(PINENTRY_QT_LDFLAGS)
AC_SUBST(MOC)
dnl If we have come so far, qt pinentry can be build.
@ -529,18 +579,65 @@ fi
AM_CONDITIONAL(BUILD_PINENTRY_QT, test "$pinentry_qt" = "yes")
if test "$pinentry_qt" = "yes"; then
AC_DEFINE(PINENTRY_QT, 1, [The qt version of Pinentry is to be build])
if test "$have_qt4_libs" = "yes"; then
pinentry_qt_lib_version="(Qt4)"
else
pinentry_qt_lib_version="(Qt5)"
fi
if test "$have_qt5_x11extras" = "yes"; then
AC_DEFINE(PINENTRY_QT_X11, 1, [pinentry-qt should use x11.])
fi
if test "$have_kf5waylandclient" = "yes"; then
PINENTRY_QT_CFLAGS="$KF5WAYLANDCLIENT_CFLAGS $PINENTRY_QT_CFLAGS -fpic"
PINENTRY_QT_LIBS="$KF5WAYLANDCLIENT_LIBS $PINENTRY_QT_LIBS"
AC_DEFINE(PINENTRY_QT_WAYLAND, 1, [pinentry-qt should use KF5WaylandClient.])
else
if test "$have_w32_system" != "yes"; then
AC_MSG_WARN([pinentry-qt will be built without Caps Lock warning on Wayland])
fi
fi
dnl
dnl Check for Qt4 pinentry program.
dnl
AC_ARG_ENABLE(pinentry-qt4,
AS_HELP_STRING([--enable-pinentry-qt4],[build Qt4 pinentry]),
pinentry_qt4=$enableval, pinentry_qt4=maybe)
dnl
dnl Checks for Qt4 libraries. Deal correctly with $pinentry_qt4 = maybe.
dnl Tries to find Qt4
dnl
if test "$pinentry_qt4" != "no"; then
FIND_QT4
if test "$have_qt4_libs" != "yes"; then
if test "$pinentry_qt4" = "yes"; then
AC_MSG_ERROR([[
***
*** Qt4 (QtCore, QtGui) is required.
***]])
else
pinentry_qt4=no
fi
fi
fi
AC_SUBST(PINENTRY_QT4_CFLAGS)
AC_SUBST(PINENTRY_QT4_LIBS)
AC_SUBST(PINENTRY_QT4_LDFLAGS)
AC_SUBST(MOC4)
dnl If we have come so far, qt4 pinentry can be build.
if test "$pinentry_qt4" != "no"; then
pinentry_qt4=yes
fi
AM_CONDITIONAL(BUILD_PINENTRY_QT4, test "$pinentry_qt4" = "yes")
if test "$pinentry_qt4" = "yes"; then
AC_DEFINE(PINENTRY_QT4, 1, [The qt4 version of Pinentry is to be build])
fi
dnl
dnl Check for TQt pinentry program.
dnl
AC_ARG_ENABLE(pinentry-tqt,
AC_HELP_STRING([--enable-pinentry-tqt], [build tqt pinentry]),
AS_HELP_STRING([--enable-pinentry-tqt],[build tqt pinentry]),
pinentry_tqt=$enableval, pinentry_tqt=no)
if test "$pinentry_tqt" != "no"; then
@ -549,7 +646,8 @@ if test "$pinentry_tqt" != "no"; then
AC_MSG_ERROR([[
***
*** Building both Qt and TQt pinentries is not supported.
*** Use --disable-pinentry-qt if you want the TQt pinentry.
*** Use --disable-pinentry-qt and --disable-pinentry-qt4
*** if you want the TQt pinentry.
***]])
fi
@ -584,7 +682,7 @@ dnl
dnl Check for FLTK pinentry program.
dnl
AC_ARG_ENABLE(pinentry-fltk,
AC_HELP_STRING([--enable-pinentry-fltk], [build FLTK 1.3 pinentry]),
AS_HELP_STRING([--enable-pinentry-fltk],[build FLTK 1.3 pinentry]),
pinentry_fltk=$enableval, pinentry_fltk=maybe)
dnl check for fltk-config
@ -645,7 +743,15 @@ else
if test "$pinentry_tqt" = "yes"; then
PINENTRY_DEFAULT=pinentry-tqt
else
AC_MSG_ERROR([[No pinentry enabled.]])
if test "$pinentry_efl" = "yes"; then
PINENTRY_DEFAULT=pinentry-efl
else
if test "$pinentry_qt4" = "yes"; then
PINENTRY_DEFAULT=pinentry-qt4
else
AC_MSG_ERROR([[No pinentry enabled.]])
fi
fi
fi
fi
fi
@ -714,6 +820,12 @@ AH_BOTTOM([
#endif /*GNUPG_CONFIG_H_INCLUDED*/
])
build_doc=yes
AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc],
[do not build the documentation]),
build_doc=$enableval, build_doc=yes)
AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
AC_CONFIG_FILES([
m4/Makefile
@ -721,10 +833,13 @@ secmem/Makefile
pinentry/Makefile
curses/Makefile
tty/Makefile
efl/Makefile
emacs/Makefile
gtk+-2/Makefile
gnome3/Makefile
qt/Makefile
qt/icons/Makefile
qt4/Makefile
tqt/Makefile
w32/Makefile
fltk/Makefile
@ -744,9 +859,11 @@ AC_MSG_NOTICE([
Curses Pinentry ..: $pinentry_curses
TTY Pinentry .....: $pinentry_tty
Emacs Pinentry ...: $pinentry_emacs
EFL Pinentry .....: $pinentry_efl
GTK+-2 Pinentry ..: $pinentry_gtk_2
GNOME 3 Pinentry .: $pinentry_gnome_3
Qt Pinentry ......: $pinentry_qt $pinentry_qt_lib_version
Qt5 Pinentry .....: $pinentry_qt
Qt4 Pinentry .....: $pinentry_qt4
TQt Pinentry .....: $pinentry_tqt
W32 Pinentry .....: $pinentry_w32
FLTK Pinentry ....: $pinentry_fltk

@ -23,6 +23,6 @@ bin_PROGRAMS = pinentry-curses
AM_CPPFLAGS = $(COMMON_CFLAGS) $(NCURSES_INCLUDE) -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../pinentry/libpinentry-curses.a \
../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(LIBCURSES) $(LIBICONV)
../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCURSES) $(LIBICONV)
pinentry_curses_SOURCES = pinentry-curses.c

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-curses$(EXEEXT)
subdir = curses
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -122,7 +131,7 @@ am__DEPENDENCIES_1 =
pinentry_curses_DEPENDENCIES = ../pinentry/libpinentry.a \
../pinentry/libpinentry-curses.a ../secmem/libsecmem.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(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
@ -137,7 +146,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-curses.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -177,6 +187,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -201,6 +213,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -210,6 +224,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -223,11 +238,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -236,6 +252,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -244,6 +262,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -257,16 +277,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -316,6 +343,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -326,7 +354,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(COMMON_CFLAGS) $(NCURSES_INCLUDE) -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../pinentry/libpinentry-curses.a \
../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(LIBCURSES) $(LIBICONV)
../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCURSES) $(LIBICONV)
pinentry_curses_SOURCES = pinentry-curses.c
all: all-am
@ -345,14 +373,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu curses/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu curses/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -416,7 +443,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-curses.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-curses.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -484,7 +517,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -556,7 +592,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-curses.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -602,7 +638,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-curses.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -622,7 +658,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -636,6 +672,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -1,8 +1,54 @@
pinentry-tqt (1.1.0-4~0debian11.0.0+0) unstable; urgency=medium
pinentry-tqt (1.2.1-1~0) unstable; urgency=medium
* Build pinentry only as pinentry-tqt for use with TDE.
-- Slávek Banko <slavek.banko@axis.cz> Sun, 08 Nov 2020 16:37:59 +0100
-- Slávek Banko <slavek.banko@axis.cz> Thu, 27 Oct 2022 14:17:15 +0200
pinentry (1.2.1-1) unstable; urgency=medium
* new upstream release
* ensure that qt4 remains disabled
* remove patches/0003-qt-fix-floating-dialog-under-sway.patch
* pinentry-gtk2: drop stale NEWS entry (see #1021502)
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Tue, 18 Oct 2022 10:52:33 -0400
pinentry (1.2.0-2) unstable; urgency=medium
* Fix --lc-ctype in manpages (Closes: #979412)
* wrap-and-sort -ast
* qt: fix floating dialog under sway (Closes: #1013318)
* Standards-Version: bump to 4.6.1 (no changes needed).
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Fri, 24 Jun 2022 22:38:56 -0400
pinentry (1.2.0-1) unstable; urgency=medium
* New upstream release to unstable
* d/gbp.conf: use DEP-14 branch naming (return to unstable)
* standards version: bump to 4.6.0 (no changes needed)
* ensure qt5 works on wayland
* refresh version info patch
* Drop fix for rpath, fixed upstream
* drop tweaks for EFL configuration check
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Thu, 28 Apr 2022 08:33:01 -0400
pinentry (1.1.1-1) experimental; urgency=medium
* new upstream release 1.1.1
* dh 13 already does --fail-missing by default
* drop --as-needed linking flag, bullseye does this by default
* move to debian/sid branch for packaging
* update upstream signing keys
* drop patches already upstream
* standards-version: bump to 4.5.1 (no changes needed)
* refresh patches
* avoid rpath for pinentry-qt
* clean up use of pkg-config for EFL pinentry
* avoid trying to build pinentry-efl
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Wed, 17 Feb 2021 15:43:06 -0500
pinentry (1.1.0-4) unstable; urgency=medium

@ -15,7 +15,7 @@ Build-Depends:
pkg-config,
libtqt3-mt-dev, tqt3-apps-dev,
texinfo,
Standards-Version: 4.5.0
Standards-Version: 4.6.1
Homepage: https://www.gnupg.org/related_software/pinentry/
Vcs-Git: https://salsa.debian.org/debian/pinentry.git
Vcs-Browser: https://salsa.debian.org/debian/pinentry

@ -4,7 +4,7 @@ Upstream-Contact: gnupg-devel@gnupg.org
Source: https://gnupg.org/ftp/gcrypt/pinentry/
Files: *
Copyright: 2002-2015, g10 Code GmbH
Copyright: 2002-2021, g10 Code GmbH
License: GPL-2+
Files: fltk/*
@ -93,7 +93,7 @@ Copyright: 2002 Klarälvdalens Datakonsult AB (KDAB)
License: GPL-2+
Files: debian/*
Copyright: 2004-2015 Peter Eisentraut <petere@debian.org>
Copyright: 2004-2022 Peter Eisentraut <petere@debian.org>
Marcus Brinkmann
Michael Brame
Daniel Kahn Gillmor <dkg@fifthhorseman.net>

@ -1,7 +1,7 @@
[DEFAULT]
pristine-tar = True
upstream-vcs-tag = pinentry-%(version)s
debian-branch = debian/master
debian-branch = debian/unstable
[import-orig]
filter = [

@ -0,0 +1,51 @@
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Wed, 13 May 2015 16:09:21 -0400
Subject: avoid self-describing as a beta
Using autoreconf against the source as distributed in tarball form
invariably results in a package that thinks it's a "beta" package,
which produces the "THIS IS A DEVELOPMENT VERSION" warning string.
since we use dh_autoreconf, i need this patch to avoid producing
builds that announce themselves as DEVELOPMENT VERSIONs.
See discussion at:
http://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029065.html
---
autogen.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 9b36158..f381d48 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -249,7 +249,7 @@ if [ "$myhost" = "find-version" ]; then
fi
beta=no
- if [ -e .git ]; then
+ if false; then
ingit=yes
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
tmp=$(echo "$tmp" | sed s/^"$package"//)
@@ -265,8 +265,8 @@ if [ "$myhost" = "find-version" ]; then
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
else
ingit=no
- beta=yes
- tmp="-unknown"
+ beta=no
+ tmp=""
rev="0000000"
rvd="0"
fi
@@ -453,7 +453,7 @@ EOF
fi
# Check the git setup.
-if [ -d .git ]; then
+if false; then
CP="cp -p"
# If we have a GNU cp we can add -v
if cp --version >/dev/null 2>/dev/null; then

@ -0,0 +1,62 @@
From: Vincent Bernat <bernat@debian.org>
Date: Mon, 6 Feb 2017 02:38:59 -0500
Subject: gtk2: When X11 input grabbing fails, try again over ~0.4 seconds.
* gtk+-2/pinentry-gtk-2.c (grab_keyboard): Delay 1 ms before retrying
keyboard grab, limit to about 0.2 seconds.
(grab_pointer): Delay 1 ms before retrying pointer_grab, limit to
about 0.2 seconds.
--
These changes were proposed by Vincent Bernat in
https://bugs.debian.org/851707#124
Debian-bug-id: 851707
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
gtk+-2/pinentry-gtk-2.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 6d626cc..f329910 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -161,7 +161,7 @@ static int
grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
{
GdkGrabStatus err;
- int tries = 0, max_tries = 4096;
+ int tries = 0, max_tries = 2048;
(void)data;
if (! pinentry->grab)
@@ -170,7 +170,8 @@ grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
do
err = gdk_keyboard_grab (gtk_widget_get_window (win),
FALSE, gdk_event_get_time (event));
- while (tries++ < max_tries && err == GDK_GRAB_NOT_VIEWABLE);
+ while (tries++ < max_tries && err == GDK_GRAB_NOT_VIEWABLE
+ && (usleep(100), TRUE));
if (err)
{
@@ -194,7 +195,7 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data)
{
GdkGrabStatus err;
GdkCursor *cursor;
- int tries = 0, max_tries = 4096;
+ int tries = 0, max_tries = 2048;
(void)data;
/* Change the cursor for the duration of the grab to indicate that
@@ -216,7 +217,8 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data)
cursor,
gdk_event_get_time (event));
while (tries++ < max_tries && (err == GDK_GRAB_NOT_VIEWABLE
- || err == GDK_GRAB_ALREADY_GRABBED));
+ || err == GDK_GRAB_ALREADY_GRABBED)
+ && (usleep (100), TRUE));
if (err)
{

@ -0,0 +1,2 @@
0001-avoid-self-describing-as-a-beta.patch
0002-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch

@ -2,7 +2,7 @@
QT_SELECT = qt5
export QT_SELECT
SHARED_CONFIGS = --disable-rpath --without-libcap --disable-pinentry-emacs --disable-inside-emacs --enable-fallback-curses
SHARED_CONFIGS = --disable-rpath --without-libcap --disable-pinentry-emacs --disable-inside-emacs --enable-fallback-curses --disable-pinentry-efl
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
%:
@ -14,6 +14,7 @@ override_dh_auto_configure:
--disable-pinentry-tty \
--disable-pinentry-curses \
--disable-pinentry-qt \
--disable-pinentry-qt4 \
--disable-pinentry-fltk \
--disable-pinentry-gtk2 \
--disable-pinentry-gnome3 \
@ -21,11 +22,7 @@ override_dh_auto_configure:
override_dh_auto_build:
dh_auto_build --builddirectory=build-no-libsecret
override_dh_missing:
dh_missing --fail-missing
dh_auto_build
override_dh_installdocs:
dh_installdocs -A NEWS AUTHORS
LDFLAGS += -Wl,--as-needed

@ -0,0 +1,4 @@
Tests: simple-tty
Depends:
pinentry-tty,
python3,

@ -0,0 +1,103 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFMjh+8BEADUIP+QH8EirR4MvDr/Veg9fELo7vLWGXXt3yjVW1rARX6pyJy9
OR46NpwH65p7R2X6Gqgm1NBEmY6weoloRZodV5MrvoLurR0NPjX9bOatsjCH8o4I
nB4W1mdVzrP1FTauG2OfBCUm1FRnKGCdndCAG8AiE6gTtr8SdvVa/2aPhsOGUEjd
f1To8X6OPyRMeNgAkPyQhHDOWgEAxzIz5z8MEnoyt5Gl1d6G5qciKxWGx/0V4x9E
6UGbuAsuepKlusKCz8JlEe+nOTRfrivO8+kOQ106z/WJgauIRwjd3x0WjpvYFGyQ
BfztPiCLobjvWaFW2I0Mh5DlG5q9hrWvw5RzOFD/Qct+oGRnvpY6iUzGZaM8jZcB
X5Knhr6yvUNr8BtON/LJ0Y2wae+sWwGotTZOlUsOyjmgnx326CkgeAQ9Moonjvqw
73TqgOMpmtTwWkWrZylGkGgD0CoJVg5R9NNKWIthTSpuRm1TKle69IoguWLSvtin
upWl6mN7EmXCkatjJEmR+wCAczkquWk3Qo966w6r/WLKbDkd8RrPCh5WjvpqnLKA
C9Zuk4ssw1i1Pwv+FhCZbvJ/UgkBq1UjoBEzbSpq1W3ul+W2x0DGRmENY6aRvJqi
8aNBX6vzD17epe9qkRbriGA8nK9j18ZnfHLGlPGDwkgOpRF8gHmRCkSi/QARAQAB
tC9EYW1pZW4gR291dHRlLUdhdHRhdCA8ZGdvdXR0ZWdhdHRhdEBpbmNlbnAub3Jn
PokCVAQTAQgAPgIbAwIeAQIXgAIZAQcLBwgJCgMCBhUICgsJAgUWAgMBABYhBE+i
CCNi/nOtA7iIMKjccGfiX7q7BQJcvj4oAAoJEKjccGfiX7q7NZAQAKl2rh+SsUpV
tFBrpdgNSUwSIiXF3bKMGKi363BEHe1/LYlKKKmFNHBJ3Xfu/7xLwAftg8skZS4d
5Bujzb6uolBUqIfp7iNk8xX0x+5D+0et8hGa7hHtaL21WUm2TKmLPsFS2HCDJsLW
SUBh5zWqVHOPvmNl10hWr5MV+MJA6yl0TP4hEpudvrtMOCe9ohKVuul3P5xxeYEq
9tfvtnFSk84N8/pRs0pB7+hjGm0DvKfwdqWZ78Z+wyB6WLy/7OGxv86ojqWJA9NV
YrwZAzqmw4o0ZhFiIFidqp07YT+jGvUYcDVSEW2Tkg4KIkbEO5+Bhv55xSj1zfdS
kQIJeCELfop/zPFXUCHZ5TOUOBI1zMV803eIbMX8HwfoGwyOe5kKv4GJj6WxvIeB
iD1cTRGgMOCkQrLIdyyuiYVCX6ntdiGQAsc7XJNGM/K4V2BTiUja0ZrNBujuOijD
OQYSrYY9FujmUCu8TSl7E/AHu9OKXTCTaQWQjBUp20ZWmuVrpdl3onsrPp7chICt
P+PIgPtcAci7gSVFt3QKCxA5LydqKxs162swS7OW6PADA7k35WhptSHMRM+1nDQ2
h/milyTPBtRYlKZABj58ZAad3WJWLf6CpiDwKngntPYiSc8OwHRLZQSVDNYLDiC9
P7Atp1PEXDt97MMjNfeVYGzJSgVblxvUtC1EYW1pZW4gR291dHRlLUdhdHRhdCA8
ZGdvdXR0ZWdhdHRhdEBmc2ZlLm9yZz6JAoMEEwEIAG00Gmh0dHA6Ly93d3cuaW5j
ZW5wLm9yZy9vcGVucGdwLWtleXNpZ25pbmctcG9saWN5LnR4dAIbAwULCQgHAgYV
CAkKCwIEFgIDAQIeAQIXgBYhBE+iCCNi/nOtA7iIMKjccGfiX7q7BQJcvj4xAAoJ
EKjccGfiX7q723QQALv29z/hJgrawAbcu2xZ568Ncy+oNUbdOurumnlVdgBoQx2b
i7zUswEGZfXcLteS4KN+M9u3M/Ph7pp47mluQJj4lK/W7w9qm3AsVwQiPFMTgp+f
0jFN0jUll2OXyJC0gxJUoYGIxehylyReV5XkdWeFGkKX0au+nE1IvZDI2D+pAPHL
Pq/3LzY5UK7m6w51983heD2m2qtXucydL9kIQjA5Dkao9MwaaBs3a4TluGj6eMOP
tw7JpbGRFmvOP7AM9JvN7GQZ5x95qV03hiRWx50gfuSkynVdu2QTTOQiY1mkMswz
8ZRjoxxMS9Ybc66zzh4pKwOg1cQiSrfKrHytQczMuX6CG4VnqSzI9VVyF49ZThNq
hiZSLFbZivBLmqwutgP8IU2RcepDQgdiyd3J/aVkbuaCMlrdnC9qwwVB8wdLCQTo
+cY9IqhrMV5J3vRksGNHs0YzlBCrqmjqtxlXsP1GWgHZKEIc147E+LWMApbn1xP5
WJuFQ4E2esvgdaL6+CAjomW0EIuno23cO6ycokc29pE7TxpyHPgrpc6Szwbdrn7O
cthUHP8N4QEzLfzfbM5g09nNQyEwzcVcOS40VQn79EmnSbyBHJXWZo8K5AS7lN5c
aqa2jnomFAbbCG8mk27O99WWsrMovFfPf0OTcguyy/mvZixJdlXH5qwuh9OxtCVE
YW1pZW4gR291dHRlLUdhdHRhdCA8ZGdnQGluY2VucC5vcmc+iQKABBMBCABqMRpo
dHRwczovL2luY2VucC5vcmcvb3BlbnBncC1rZXlzaWduaW5nLXBvbGljeS50eHQC
GwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQRPoggjYv5zrQO4iDCo3HBn4l+6
uwUCXL4+MQAKCRCo3HBn4l+6uwoGD/4mOKfPL6sDoujPnWv610BsJhxDW1mttBK7
YiNPdEXDjVAUXawgD48igCVHYFrKKLkXINHFgusgSJtJB1KeHqlxFg4r39gIU783
3tdDXMPyU8su/ZF5su2W3J3fP5reww/yyG4Bmmc1fHlwNr9tCVqixnqv3KpNJoK3
BsrtpJOR7rU6SvihKAM8pGWfkBjyn2UVqpoG2sCRhuHIwGx/0Tw2/zwA4zEO++WB
oJFaXW/FWxAEYwMO1EdeuJH3xLK65CtA33A4K6rDgEvR+6ZojRXxsfJfwSTchyuq
tFe4VlPsSduW6DO376rTOizjavANedjRrti5K8Xicvvx07w0zkUKYYHM9WYrTOOk
cLZNuIL430VMEHN47ajLSxib2MIPzjNAJF1luXDKkRiHnwPSDRZAiOEmi9HI8DyT
xfKHNkNJOtZSuBHqqkPNYrvXvjkLrlzMckplbnzrCbfLi3Zew8D9qC7DDwtYO/Z1
tpHWeeF7mJJbN/VnDKf6+Aon/OBNCjGAVXz/T55PpKNBTv/ezeolPcIn1njZjbQl
W1KHrfa7YJYHRsPhn8qxYaqNrDFWIkRJAHyMgFFYNQRowqmblT+lIwuD1v/ZWDXz
oUVkt2tC4UagtQO/r/IuJVNbdZtyfSzGV+Lkb4bo2gs3i4qLieHVcPBdVXaRF6YS
lM/q8JLxA7kBDQRTI4j+AQgA6GEmtBA2fHPaVeK5V2+Nq2wWX179WZDyKtB9PDiy
FYv1ao3IXtYpfBfnIxDenJHZ8TJlWLD9NCCq6+aeh6V1dzo4OnwJVf7OxVTuGcvJ
81SAxS2fAn9vMTv7/AjyJq7baXl+zP4V6b7yFKgr1tPSqMcMM7u7RZN1nHJsY1I1
Qo5Nv/7iCs/USc1/pzurJiIMQtD11noC0L49kxV8r3BsCBjXhZN8HGwbt02WX0ae
UJ7pm0xjrr9QJr9/6rLy2RWw2qWceMUsAeV/IYuD/h1r7SYGl8rFxC2BRsJqaUfU
+XkyvlXekZzhTjIjCCGxEYX5uN1wXdVaki9c41f1iuGoBwARAQABiQNVBBgBAgAg
AhsCFiEET6III2L+c60DuIgwqNxwZ+JfursFAly+Pk4BKcBdIAQZAQIABgUCUyOI
/gAKCRCqQ3PmyCx4rV29CACX5k+60iH6j+aKD325pOSBadOomJYvQybd81vjorDV
JusBX7zuFhyN98fhHkdTS5rWip82jtK/hWtqV5xEi1TuaPd7096g7pwl8gN51Fcp
0iqyy2ge51PB+WiqXiqcaRNZYBMMc6+/uE3lknLrXuVcxARwLWB/UviPmLgm0UMZ
aaSddh9itb3TiyJ63ykxeejqjpoi6dbmj7NP3nuxPAyQXbIGT2jH7JGzLKy6tIWB
yulbPAbtI7ZtGXvBqhZ5qWIYU5fUmENpqZJLlgzZz0fjrExwn64q2rb1t3Oe2iay
eMdxhHBT5s/vGmcorCy1c6Tf0iGODJc/ELfRETU0WXqrCRCo3HBn4l+6u5CMD/4t
5I209CXriZ8H0ExNDhqQw7FD/Xyt3oBPqWmdaktu1fqueCxAqWUYay+XjiTwURIF
dTYGl3REmI9wO13CPtQbDSxcZdEdZlAPxPDEefcAwd2gdPxkRtg5iv82JW0YL9Vi
ZF7zCjA+Ob/fV3dGlSABTR+B7W34HXo7N1D+gBXIQcm6ApawTCGhk/GPz88bF4+w
Y+zTL8H1cqz6GdfQsBeAKULisOA58aQluLd+lS6i4B6FnKyTbyqsvVBv5VC8RAbe
QaSSxmx1JCMbFEMudjkyW8X3w9OPHiIxQ2xoT1jcWshY1IlIL77dd3NtH4q+1zKO
oXEfDibEF8ua3Ji/qa8AjbqQB0jN/o/WnUJo6U16A2wQDyBPOP/Xg7cfu9MRaMos
y43V3CI/RiXyIKF0IVWGuAyK8peap8sMozwaNaYV8fNMLZrV0gjqohCDx0/NOddO
QxxvlxDKKtO8oMQZ17dHVdWeLb228aZrYaKubBg1EG3mJoNOYiHXmuwh4I4n+QXi
jC5d9MSNqA0Dx7fRwd/H2Xqfe9b56rhcxyoXDXL0KawBLB7BEHgD8hhBObWcV4SX
27CUliI5bAn6jTXMflbax7JeCUM7ftvuHbLScQz+qY7V/HKEAWcMa5aSBe9XGRrn
M3gZOVwKd3sMndhDdNSurBwXhKPR9hewfxKwFKaMgLgzBFsW830WCSsGAQQB2kcP
AQEHQPN1KutRNEw5ruEupwj5X47kn+dBPssCpVlxRfq+ix8BiQLfBBgBCABSFiEE
T6III2L+c60DuIgwqNxwZ+JfursFAlsW830xGmh0dHBzOi8vaW5jZW5wLm9yZy9v
cGVucGdwLWtleXNpZ25pbmctcG9saWN5LnR4dAIbAgCBCRCo3HBn4l+6u3YgBBkW
CAAdFiEEgMwbjQTCYt3+4ZgMb38PkdE4/HsFAlsW830ACgkQb38PkdE4/Hvh8QEA
6wYmL9DVE++/LXXS/rFC/PqEvR1Xg/INIEqFX4n6A5cA/3Z+OCyTRXlNL5/0VGOf
6fL9D7PIeSxuZMpR2f9m5dcE3egQAISwpiN5d9GjTyOAOcz06TGacLWgSnHXfZbH
7cbBZtde7iYbrkN1O1+hRksoj/VnGL3+fOwI2qhO7Xx4JN0dUddB36ga1ZOGyxS8
n19KUO285uuSs/a+hQIqI2VC9V2plgPCg1afFEpwn7VjJa0BH63mjjoCVv+hzDFs
FcIr+c10C9rKL2MpoiywDGoW2lRj7DOOPiS1+KC+JApEcia7WlW5mvk7WfFmP8F4
CR/NpMyc29+GWcr3rBFRQqftIyDUhYV5+RZhgvRzhGztxQ//2euLUI/puZxmffs4
+kbp06Z6naMkjgGCSUNJGlhp3mlzsBMLK97/rMP4SZ4kumrO8ldx2Otv85B+onMU
KyzSkOWUiF88w/ihcUxxmWUkZEOn5T/EC4JTQZpghiwezoDCf5JOBGFp1ahzqZCL
lzLNEWdPK6Z/tOtzpGS9XNr8S9iOtjAfThb8Uu4pYs2pkjzdrJnHsUp8S6QhH9a4
1CnDaDgw3qvasBfhi+Sl+nSiOJYo0cJrmBBtiMDj8c46JSnxg+9N3sahbak4OpXO
cPEex59sFWknX5fKt7OX0ksJxceEWzNxMwiMZLdn6OzFk25stRzqQTnplfWY+UEn
mIUH+Z72NjFdY6JVTksGeCXlSDxz1em8pBl68U97dY6jPC7tpPnc3HFJp53p8/7J
zYsuZj9nmDMEX0PliRYJKwYBBAHaRw8BAQdAz75Hlekc16JhhfI0MKdEVxLdkxhc
MCO0ZG6WMBAmNpe0H1dlcm5lciBLb2NoIChkaXN0IHNpZ25pbmcgMjAyMCmImgQT
FgoAQhYhBG2qbmSnbShAVxtJAlKIl7gmQDraBQJfQ+w1AhsDBQkShccRBQsJCAcC
AyICAQYVCgkICwIEFgIDAQIeBwIXgAAKCRBSiJe4JkA62nmuAP9uL/HOdB0gvwWr
H+FpURJLs4bnaZaPIk9ARrU0EXRgJgD/YCGfHQXpIPT0ZaXuwJexK04Z+qMFR/bM
1q1Leo5CjgY=
=278x
-----END PGP PUBLIC KEY BLOCK-----

@ -22,7 +22,7 @@
or smaller, so that the generated ChangeLog lines, each with its
leading TAB, will not exceed 80 columns.
For more infomration please check the HACHING file from the GnuPG
For more information please check the HACKING file from the GnuPG
project.
* String translation

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -32,7 +32,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -96,18 +106,16 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(pinentry_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \
$(srcdir)/version.texi $(srcdir)/stamp-vti \
$(top_srcdir)/build-aux/texinfo.tex mdate-sh texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
$(srcdir)/stamp-vti $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -201,6 +209,9 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(pinentry_TEXINFOS) $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/mdate-sh \
$(top_srcdir)/build-aux/texinfo.tex mdate-sh texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -225,6 +236,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -234,6 +247,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -247,11 +261,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -260,6 +275,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -268,6 +285,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -281,16 +300,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -340,6 +366,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -368,14 +395,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -441,15 +467,16 @@ $(srcdir)/stamp-vti: pinentry.texi $(top_srcdir)/configure
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > vti.tmp
@cmp -s vti.tmp $(srcdir)/version.texi \
|| (echo "Updating $(srcdir)/version.texi"; \
cp vti.tmp $(srcdir)/version.texi)
-@rm -f vti.tmp
echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
(cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
|| (echo "Updating $(srcdir)/version.texi" && \
cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
-rm -f vti.tmp
-rm -f vti.tmp* $(srcdir)/version.texi.tmp*
maintainer-clean-vti:
@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
@ -553,7 +580,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -800,6 +830,8 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-pdf-am uninstall-ps-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -1,4 +1,4 @@
This is pinentry.info, produced by makeinfo version 6.3 from
This is pinentry.info, produced by makeinfo version 6.5 from
pinentry.texi.
INFO-DIR-SECTION GNU Utilities
@ -8,8 +8,8 @@ END-INFO-DIR-ENTRY
This file documents the use and the internals of the PINENTRY.
This is edition 1.1.0, last updated 3 December 2017, of 'The
'PINEntry' Manual', for version 1.1.0.
This is edition 1.2.1, last updated 25 August 2021, of 'The
'PINEntry' Manual', for version 1.2.1.
Published by g10 Code GmbH
Hüttenstr. 61
@ -124,15 +124,15 @@ File: pinentry.info, Node: Front ends, Next: Protocol, Prev: Using pinentry,
************
There are several different flavors of PINENTRY. Concretely, there are
Gtk+2, Qt 4, Gnome 3, Emacs, curses and tty variants. These different
implementations provide higher levels of integration with a specific
environment. For instance, the Gnome 3 PINENTRY uses Gnome 3 widgets to
display the prompts. For Gnome 3 users, this higher level of
integration provides a more consistent aesthetic. However, this comes
at a cost. Because this PINENTRY uses so many components, there is a
larger chance of a failure. In particular, there is a larger chance
that the passphrase is saved in memory and that memory is exposed to an
attacker (consider the OpenSSL Heartbeat vulnerability).
Gtk+2, Qt 4/5, TQt, EFL, FLTK, Gnome 3, Emacs, curses and tty variants.
These different implementations provide higher levels of integration
with a specific environment. For instance, the Gnome 3 PINENTRY uses
Gnome 3 widgets to display the prompts. For Gnome 3 users, this higher
level of integration provides a more consistent aesthetic. However,
this comes at a cost. Because this PINENTRY uses so many components,
there is a larger chance of a failure. In particular, there is a larger
chance that the passphrase is saved in memory and that memory is exposed
to an attacker (consider the OpenSSL Heartbeat vulnerability).
To understand how many components touch the passphrase, consider
again the Gnome 3 implementation. When a user presses a button on the
@ -288,6 +288,57 @@ encoded as '%25', etc.).
With STRING being a percent escaped string shown as the tooltip.
'Enable enforcement of passphrase constraints'
This will make the pinentry check whether the new passphrase
entered by the user satisfies the passphrase constraints before
passing the passphrase to gpg-agent and closing the pinentry. This
gives the user the chance to modify the passphrase until the
constraints are satisfied without retyping the passphrase.
C: OPTION constraints-enforce
S: OK
To inform the user about the constraints a short hint and a longer
hint can be set using
C: OPTION constraints-hint-short=At least 8 characters
S: OK
C: OPTION constraints-hint-long=The passphrase must ...
S: OK
Additionally, a title for the dialog showing details in case of
unsatisfied constraints can be set using
C: OPTION constraints-error-title=Passphrase Not Allowed
S: OK
All strings have to be percent escaped.
'Enable an action for generating a passphrase'
Adds an action for generating a random passphrase to the GETPIN
window. The action is only available when asking for a new
passphrase, i.e. if SETREPEAT has been called.
C: SETGENPIN Suggest
S: OK
If you want to provide a tooltip for the action, you may use
C: SETGENPIN_TT Suggest a random passphrase
S: OK
'Enable passphrase formatting'
Passphrase formatting will group the characters of the passphrase
into groups of five characters separated by non-breaking spaces or
a similar separator. This is useful in combination with passphrase
generation to make the generated passphrase easier readable.
C: OPTION formatted-passphrase
S: OK
Note: If passphrase formatting is enabled, then, depending on the
concrete pinentry, all occurrences of the character used as
separator may be stripped from the entered passphrase.
To provide a hint for the user that is shown if passphrase
formatting is enabled use
C: OPTION formatted-passphrase-hint=Blanks are not part of the passphrase.
S: OK
'Ask for a PIN'
The meat of this tool is to ask for a passphrase of PIN, it is done
with this command:
@ -366,7 +417,7 @@ encoded as '%25', etc.).
C: getpin
S: S PASSWORD_FROM_CACHE
S: D 1234
C: OK
S: OK
Note: if 'allow-external-password-cache' is not specified, an
external password cache must not be used: this can lead to subtle
@ -536,6 +587,49 @@ relevant elements that describe the layout:
'quality_bar_tt'
A tooltip for the quality bar.
'constraints_enforce'
If this is not 0, then passphrase constraints are enforced by
gpg-agent. In this case pinentry can use the
'pinentry_inq_checkpin' function for checking whether the new
passphrase satisfies the constraints before passing it to
gpg-agent.
'constraints_hint_short'
A short translated hint for the user with the constraints for new
passphrases to be displayed near the passphrase input field.
'constraints_hint_short'
A longer translated hint for the user with the constraints for new
passphrases to be displayed for example as tooltip.
'constraints_error_title'
A short translated title for an error dialog informing the user
about unsatisfied passphrase constraints.
'genpin_label'
If this is set, a generate action should be shown. The value of
this field is a label for the action.
Note: Call the 'pinentry_inq_genpin' function to request a randomly
generated passphrase.
'genpin_tt'
The tooltip for the generate action.
'formatted_passphrase'
If this is not 0, then passphrase formatting should be enabled. If
it is enabled, then the unmasked passphrase should be grouped into
groups of five characters separated by non-breaking spaces or a
similar separator.
To simplify the implementation all occurrences of the character
used as separator can be stripped from the entered passphrase, if
formatting is enabled.
'formatted_passphrase_hint'
A hint to be shown if passphrase formatting is enabled. It should
be shown near the passphrase input field.
'default_pwmngr'
If 'may_cache_password' and 'keyinfo' are set and the user
consents, then the PINENTRY may cache the password with an external
@ -556,6 +650,9 @@ relevant elements that describe the layout:
Tooltip for an action that would hide the password revealed by the
action labeld with 'default-tt-visi'
'default-capshint'
A hint to be shown if Caps Lock is on.
When the handler is done, it should store the passphrase in 'pin', if
appropriate. This variable is allocated in secure memory. Use
'pinentry_setbufferlen' to size the buffer.
@ -980,13 +1077,13 @@ Index

Tag Table:
Node: Top816
Node: Using pinentry2241
Node: Front ends4092
Node: Protocol7644
Node: Implementation Details16103
Node: Copying23985
Node: Option Index43164
Node: Index44246
Node: Top815
Node: Using pinentry2240
Node: Front ends4091
Node: Protocol7660
Node: Implementation Details18285
Node: Copying27843
Node: Option Index47022
Node: Index48104

End Tag Table

@ -100,7 +100,7 @@ This manual documents how to use the @pinentry{} and its protocol.
The @pinentry{} is a small GUI application used to enter PINs or
passphrases. It is usually invoked by @sc{gpg-agent}
(@pxref{Invoking GPG-AGENT, ,Invoking the gpg-agent, gnupg,
The `GNU Privacy Guard' Manual}, for details).
The `GNU Privacy Guard' Manual}, for details).
@pinentry{} comes in several flavors to fit the look and feel of the
used GUI toolkit: A @sc{GTK+} based one named @code{pinentry-gtk}; a
@ -152,7 +152,7 @@ Here is a list of options supported by all flavors of pinentry:
@table @gnupgtabopt
@item --version
@opindex version
Print the program version and licensing information.
Print the program version and licensing information.
@item --help
@opindex help
@ -198,10 +198,10 @@ indefinitely, set this to 0, which is the default.
@itemx --ttytype @var{string}
@itemx --lc-ctype @var{string}
@itemx --lc-messages @var{string}
@opindex display
@opindex ttyname
@opindex ttytype
@opindex lc-ctype
@opindex display
@opindex ttyname
@opindex ttytype
@opindex lc-ctype
@opindex lc-messa
These options are used to pass localization information to
@pinentry{}. They are required because @pinentry{} is usually called
@ -214,16 +214,16 @@ options using Assuan protocol options.
@chapter Front Ends
There are several different flavors of @pinentry{}. Concretely, there
are Gtk+2, Qt@tie{}4, Gnome@tie{}3, Emacs, curses and tty variants.
These different implementations provide higher levels of integration
with a specific environment. For instance, the Gnome@tie{}3
@pinentry{} uses Gnome@tie{}3 widgets to display the prompts. For
Gnome@tie{}3 users, this higher level of integration provides a more
consistent aesthetic. However, this comes at a cost. Because this
@pinentry{} uses so many components, there is a larger chance of a
failure. In particular, there is a larger chance that the passphrase
is saved in memory and that memory is exposed to an attacker (consider
the OpenSSL Heartbeat vulnerability).
are Gtk+2, Qt@tie{}4/5, TQt, EFL, FLTK, Gnome@tie{}3, Emacs, curses and
tty variants. These different implementations provide higher levels
of integration with a specific environment. For instance, the
Gnome@tie{}3 @pinentry{} uses Gnome@tie{}3 widgets to display the
prompts. For Gnome@tie{}3 users, this higher level of integration
provides a more consistent aesthetic. However, this comes at a cost.
Because this @pinentry{} uses so many components, there is a larger
chance of a failure. In particular, there is a larger chance that the
passphrase is saved in memory and that memory is exposed to an
attacker (consider the OpenSSL Heartbeat vulnerability).
To understand how many components touch the passphrase, consider again
the Gnome@tie{}3 implementation. When a user presses a button on the
@ -274,7 +274,7 @@ available. If this is not the case, then they fallback to the curses
front end. This can also be disabled by passing
@code{--disable-fallback-curses} to @code{configure} at build time.
@c
@c
@c Assuan Protocol
@c
@node Protocol
@ -408,6 +408,74 @@ If you want to show a tooltip for the quality bar, you may use
With STRING being a percent escaped string shown as the tooltip.
@item Enable enforcement of passphrase constraints
This will make the pinentry check whether the new passphrase entered by
the user satisfies the passphrase constraints before passing the passphrase
to gpg-agent and closing the pinentry. This gives the user the chance to
modify the passphrase until the constraints are satisfied without retyping
the passphrase.
@example
C: OPTION constraints-enforce
S: OK
@end example
To inform the user about the constraints a short hint and a longer hint
can be set using
@example
C: OPTION constraints-hint-short=At least 8 characters
S: OK
C: OPTION constraints-hint-long=The passphrase must ...
S: OK
@end example
Additionally, a title for the dialog showing details in case of unsatisfied
constraints can be set using
@example
C: OPTION constraints-error-title=Passphrase Not Allowed
S: OK
@end example
All strings have to be percent escaped.
@item Enable an action for generating a passphrase
Adds an action for generating a random passphrase to the GETPIN window.
The action is only available when asking for a new passphrase, i.e. if
SETREPEAT has been called.
@example
C: SETGENPIN Suggest
S: OK
@end example
If you want to provide a tooltip for the action, you may use
@example
C: SETGENPIN_TT Suggest a random passphrase
S: OK
@end example
@item Enable passphrase formatting
Passphrase formatting will group the characters of the passphrase into
groups of five characters separated by non-breaking spaces or a similar
separator. This is useful in combination with passphrase generation to make
the generated passphrase easier readable.
@example
C: OPTION formatted-passphrase
S: OK
@end example
Note: If passphrase formatting is enabled, then, depending on the concrete
pinentry, all occurrences of the character used as separator may be stripped
from the entered passphrase.
To provide a hint for the user that is shown if passphrase formatting is
enabled use
@example
C: OPTION formatted-passphrase-hint=Blanks are not part of the passphrase.
S: OK
@end example
@item Ask for a PIN
The meat of this tool is to ask for a passphrase of PIN, it is done with
this command:
@ -499,7 +567,7 @@ the passphrase retry counter.
C: getpin
S: S PASSWORD_FROM_CACHE
S: D 1234
C: OK
S: OK
@end example
Note: if @code{allow-external-password-cache} is not specified, an
@ -679,6 +747,47 @@ password quality widget correspondingly.
@item @code{quality_bar_tt}
A tooltip for the quality bar.
@item @code{constraints_enforce}
If this is not 0, then passphrase constraints are enforced by gpg-agent.
In this case pinentry can use the @code{pinentry_inq_checkpin} function
for checking whether the new passphrase satisfies the constraints before
passing it to gpg-agent.
@item @code{constraints_hint_short}
A short translated hint for the user with the constraints for new
passphrases to be displayed near the passphrase input field.
@item @code{constraints_hint_short}
A longer translated hint for the user with the constraints for new
passphrases to be displayed for example as tooltip.
@item @code{constraints_error_title}
A short translated title for an error dialog informing the user about
unsatisfied passphrase constraints.
@item @code{genpin_label}
If this is set, a generate action should be shown. The value of this
field is a label for the action.
Note: Call the @code{pinentry_inq_genpin} function to request a randomly
generated passphrase.
@item @code{genpin_tt}
The tooltip for the generate action.
@item @code{formatted_passphrase}
If this is not 0, then passphrase formatting should be enabled. If it is
enabled, then the unmasked passphrase should be grouped into groups of five
characters separated by non-breaking spaces or a similar separator.
To simplify the implementation all occurrences of the character used as
separator can be stripped from the entered passphrase, if formatting is
enabled.
@item @code{formatted_passphrase_hint}
A hint to be shown if passphrase formatting is enabled. It should be shown
near the passphrase input field.
@item @code{default_pwmngr}
If @code{may_cache_password} and @code{keyinfo} are set and the user
consents, then the @pinentry{} may cache the password with an external
@ -699,6 +808,9 @@ Tooltip for an action that would reveal the entered password.
Tooltip for an action that would hide the password revealed
by the action labeld with @code{default-tt-visi}
@item @code{default-capshint}
A hint to be shown if Caps Lock is on.
@end table
When the handler is done, it should store the passphrase in
@ -751,5 +863,3 @@ was pressed.
@c ---------------------------------------------------------------------
@bye

@ -0,0 +1,4 @@
@set UPDATED 25 August 2021
@set UPDATED-MONTH August 2021
@set EDITION 1.2.1
@set VERSION 1.2.1

@ -0,0 +1,4 @@
@set UPDATED 25 August 2021
@set UPDATED-MONTH August 2021
@set EDITION 1.2.1
@set VERSION 1.2.1

@ -0,0 +1,38 @@
# Makefile.am - PIN entry EFL frontend.
# Copyright (C) 2017 Obsidian-Studios, Inc.
# Author William L. Thomson Jr. <wlt@o-sinc.com>
#
# 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
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = pinentry-efl
if FALLBACK_CURSES
ncurses_include = $(NCURSES_INCLUDE)
libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV)
else
ncurses_include =
libcurses =
endif
AM_CPPFLAGS = $(COMMON_CFLAGS) $(EFL_CFLAGS) $(ncurses_include) \
-I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(EFL_LIBS) $(libcurses)
pinentry_efl_SOURCES = pinentry-efl.c

@ -0,0 +1,690 @@
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am - PIN entry EFL frontend.
# Copyright (C) 2017 Obsidian-Studios, Inc.
# Author William L. Thomson Jr. <wlt@o-sinc.com>
#
# 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
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-efl$(EXEEXT)
subdir = efl
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_pinentry_efl_OBJECTS = pinentry-efl.$(OBJEXT)
pinentry_efl_OBJECTS = $(am_pinentry_efl_OBJECTS)
pinentry_efl_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_efl_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-efl.Po
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 =
SOURCES = $(pinentry_efl_SOURCES)
DIST_SOURCES = $(pinentry_efl_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_CFLAGS = @COMMON_CFLAGS@
COMMON_LIBS = @COMMON_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
FLTKCXXFLAGS = @FLTKCXXFLAGS@
FLTKLIBS = @FLTKLIBS@
FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
GPG_ERROR_MT_CFLAGS = @GPG_ERROR_MT_CFLAGS@
GPG_ERROR_MT_LIBS = @GPG_ERROR_MT_LIBS@
GREP = @GREP@
GTK2_CFLAGS = @GTK2_CFLAGS@
GTK2_LIBS = @GTK2_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TQT_MOC = @TQT_MOC@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
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) $(EFL_CFLAGS) $(ncurses_include) \
-I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(EFL_LIBS) $(libcurses)
pinentry_efl_SOURCES = pinentry-efl.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu efl/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu efl/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
pinentry-efl$(EXEEXT): $(pinentry_efl_OBJECTS) $(pinentry_efl_DEPENDENCIES) $(EXTRA_pinentry_efl_DEPENDENCIES)
@rm -f pinentry-efl$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(pinentry_efl_OBJECTS) $(pinentry_efl_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-efl.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.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) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/pinentry-efl.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/pinentry-efl.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -0,0 +1,621 @@
/* pinentry-efl.c
Copyright (C) 2017 Obsidian-Studios, Inc.
Author William L. Thomson Jr. <wlt@o-sinc.com>
Based on pinentry-gtk2.c
Copyright (C) 1999 Robert Bihlmeyer <robbe@orcus.priv.at>
Copyright (C) 2001, 2002, 2007, 2015 g10 Code GmbH
Copyright (C) 2004 by Albrecht Dreß <albrecht.dress@arcor.de>
pinentry-efl is a pinentry application for the EFL widget set.
It tries to follow the Gnome Human Interface Guide as close as
possible.
This program 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.
This program 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Elementary.h>
#include <Ecore_X.h>
#include <gpg-error.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
#pragma GCC diagnostic pop
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#include "getopt.h"
#endif /* HAVE_GETOPT_H */
#include "pinentry.h"
#ifdef FALLBACK_CURSES
#include "pinentry-curses.h"
#endif
#define PGMNAME "pinentry-efl"
#ifndef VERSION
#define VERSION
#endif
#define ENTRY_HIDE "Hide entry"
#define ENTRY_SHOW "Show entry"
typedef enum { CONFIRM_CANCEL, CONFIRM_OK, CONFIRM_NOTOK } confirm_value_t;
static const int WIDTH = 480;
static const int BUTTON_HEIGHT = 27;
static const int BUTTON_WIDTH = 70;
static const int BUTTON_ICON_SIZE = 13;
static const int PADDING = 5;
static Eina_Bool got_input;
static Ecore_Timer *timer;
static Evas_Object *check_label;
static Evas_Object *error_label;
static Evas_Object *entry;
static Evas_Object *repeat_entry;
static Evas_Object *qualitybar;
static Evas_Object *win;
static char **pargv;
static int grab_failed;
static int passphrase_ok;
static int confirm_mode;
static int pargc;
static confirm_value_t confirm_value;
static pinentry_t pinentry;
pinentry_cmd_handler_t pinentry_cmd_handler;
static void
quit (void)
{
evas_object_del(win);
elm_exit();
ecore_main_loop_quit ();
}
static void
delete_event (void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event EINA_UNUSED)
{
pinentry->close_button = 1;
quit ();
}
static void
changed_text_handler (void *data EINA_UNUSED,
Evas_Object *obj,
void *event EINA_UNUSED)
{
const char *s;
int length;
int percent;
got_input = EINA_TRUE;
if (pinentry->repeat_passphrase && repeat_entry)
{
elm_object_text_set (repeat_entry, "");
elm_object_text_set (error_label, "");
}
if (!qualitybar || !pinentry->quality_bar)
return;
s = elm_object_text_get (obj);
if (!s)
s = "";
length = strlen (s);
percent = length? pinentry_inq_quality (pinentry, s, length) : 0;
evas_object_color_set(qualitybar,
255 - ( 2.55 * percent ),
2.55 * percent, 0, 255);
elm_progressbar_value_set (qualitybar, (double) percent / 100.0);
}
static void
on_check (void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
{
if(elm_check_state_get(obj))
{
elm_entry_password_set(entry, EINA_FALSE);
elm_object_text_set(check_label,ENTRY_HIDE);
}
else
{
elm_entry_password_set(entry, EINA_TRUE);
elm_object_text_set(check_label,ENTRY_SHOW);
}
evas_object_size_hint_min_set(check_label,
ELM_SCALE_SIZE(BUTTON_WIDTH),
ELM_SCALE_SIZE(BUTTON_HEIGHT));
evas_object_size_hint_align_set(check_label, 0, 1);
}
static void
on_click (void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
if (confirm_mode)
{
confirm_value = (confirm_value_t) data;
quit ();
return;
}
if (data)
{
const char *s;
const char *s2;
s = elm_entry_entry_get (entry);
if (!s)
s = "";
if (pinentry->repeat_passphrase && repeat_entry)
{
s2 = elm_entry_entry_get (repeat_entry);
if (!s2)
s2 = "";
if (strcmp (s, s2))
{
elm_object_text_set(error_label,
pinentry->repeat_error_string?
pinentry->repeat_error_string:
"not correctly repeated");
elm_object_focus_set(entry,EINA_TRUE);
return;
}
pinentry->repeat_okay = 1;
}
passphrase_ok = 1;
pinentry_setbufferlen (pinentry, strlen (s) + 1);
if (pinentry->pin)
strncpy (pinentry->pin, s, strlen(s) + 1);
}
quit ();
}
static void
enter_callback (void *data, Evas_Object * obj, void *event_info EINA_UNUSED)
{
if (data)
elm_object_focus_set (data, 1);
else
on_click ((void *) CONFIRM_OK, obj, NULL);
}
static Eina_Bool
timeout_cb (const void * data)
{
pinentry_t pe = (pinentry_t)data;
if (!got_input)
{
ecore_main_loop_quit();
if (pe)
pe->specific_err = gpg_error (GPG_ERR_TIMEOUT);
}
timer = NULL;
return ECORE_CALLBACK_DONE;
}
static void
create_window (void)
{
char *txt;
Evas_Object *icon;
Evas_Object *obj;
Evas_Object *table;
int btn_txt_len = 0;
int row = 0;
int ok_len = 0;
win = elm_win_util_dialog_add(NULL,"pinentry","enter pin");
elm_win_autodel_set(win, EINA_TRUE);
elm_win_center(win,EINA_TRUE,EINA_TRUE);
evas_object_smart_callback_add(win, "delete,request", delete_event, NULL);
table = elm_table_add(win);
elm_table_padding_set(table,ELM_SCALE_SIZE(PADDING),0);
evas_object_size_hint_padding_set (table,
ELM_SCALE_SIZE(PADDING),
ELM_SCALE_SIZE(PADDING),
ELM_SCALE_SIZE(PADDING),
ELM_SCALE_SIZE(PADDING));
evas_object_show(table);
if (pinentry->title)
{
txt = elm_entry_utf8_to_markup(pinentry->title);
elm_win_title_set ( win, txt );
free (txt);
}
/* Description Label */
if (pinentry->description)
{
char* aligned;
int len;
obj = elm_label_add(table);
elm_label_line_wrap_set (obj, ELM_WRAP_WORD);
txt = elm_entry_utf8_to_markup(pinentry->description);
len = strlen(txt)+20; // 20 chars for align tag
aligned = calloc(len+1,sizeof(char));
if(aligned)
{
snprintf(aligned,len, "<align=left>%s</align>",txt);
elm_object_text_set(obj,aligned);
free (aligned);
} else
elm_object_text_set(obj,txt);
free (txt);
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0);
elm_table_pack(table, obj, 1, row, 5, 1);
evas_object_show(obj);
row++;
}
if (!confirm_mode && (pinentry->error || pinentry->repeat_passphrase))
{
/* Error Label */
if (pinentry->error)
txt = elm_entry_utf8_to_markup(pinentry->error);
else
txt = "";
obj = elm_label_add(table);
evas_object_color_set(obj, 255, 0, 0, 255);
elm_object_text_set(obj,txt);
elm_object_style_set(obj,"slide_bounce");
elm_label_slide_duration_set(obj, 10);
elm_label_slide_mode_set(obj, ELM_LABEL_SLIDE_MODE_ALWAYS);
elm_label_slide_go(obj);
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0);
elm_table_pack(table, obj, 1, row, 5, 1);
evas_object_show(obj);
if (pinentry->error)
free (txt);
row++;
}
qualitybar = NULL;
if (!confirm_mode)
{
if (pinentry->prompt)
{
/* Entry/Prompt Label */
obj = elm_label_add(table);
txt = elm_entry_utf8_to_markup(pinentry->prompt);
elm_object_text_set(obj,txt);
free (txt);
evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL);
elm_table_pack(table, obj, 1, row, 1, 1);
evas_object_show(obj);
}
entry = elm_entry_add(table);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_scroller_policy_set(entry,
ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_OFF);
elm_entry_password_set(entry, EINA_TRUE);
elm_entry_single_line_set(entry, EINA_TRUE);
evas_object_size_hint_weight_set(entry, 0, 0);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0);
elm_table_pack(table, entry, 2, row, 4, 1);
evas_object_smart_callback_add(entry,
"changed",
changed_text_handler,
NULL);
evas_object_show(entry);
row++;
/* Check box */
obj = elm_check_add(table);
evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL);
elm_table_pack(table, obj, 1, row, 1, 1);
evas_object_smart_callback_add(obj, "changed", on_check, NULL);
evas_object_show(obj);
/* Check Label */
check_label = elm_label_add(table);
on_check((void *)NULL, obj, (void *)NULL);
elm_table_pack(table, check_label, 2, row, 4, 1);
evas_object_show(check_label);
row++;
if (pinentry->quality_bar)
{
/* Quality Bar Label */
obj = elm_label_add(table);
txt = elm_entry_utf8_to_markup(pinentry->quality_bar);
elm_object_text_set(obj,txt);
free (txt);
evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL);
elm_table_pack(table, obj, 1, row, 1, 1);
evas_object_show(obj);
qualitybar = elm_progressbar_add(table);
evas_object_color_set(qualitybar, 255, 0, 0, 255);
evas_object_show(qualitybar);
if (pinentry->quality_bar_tt)
elm_object_tooltip_text_set (qualitybar,
pinentry->quality_bar_tt);
evas_object_size_hint_weight_set(qualitybar, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(qualitybar, EVAS_HINT_FILL, 0);
elm_table_pack(table, qualitybar, 2, row, 4, 1);
row++;
}
if (pinentry->repeat_passphrase)
{
/* Repeat Label */
obj = elm_label_add(table);
txt = elm_entry_utf8_to_markup(pinentry->repeat_passphrase);
elm_object_text_set(obj,txt);
free (txt);
evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL);
elm_table_pack(table, obj, 1, row, 1, 1);
evas_object_show(obj);
repeat_entry = elm_entry_add(table);
elm_entry_scrollable_set(repeat_entry, EINA_TRUE);
elm_scroller_policy_set(repeat_entry,
ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_OFF);
elm_entry_password_set(repeat_entry, EINA_TRUE);
elm_entry_single_line_set(repeat_entry, EINA_TRUE);
evas_object_size_hint_weight_set(repeat_entry, 0, 0);
evas_object_size_hint_align_set(repeat_entry, EVAS_HINT_FILL, 0);
elm_table_pack(table, repeat_entry, 2, row, 4, 1);
evas_object_smart_callback_add (repeat_entry, "activated",
enter_callback, NULL);
evas_object_show(repeat_entry);
evas_object_smart_callback_add (entry,
"activated",
enter_callback,
repeat_entry);
evas_object_smart_callback_add(repeat_entry,
"activated",
on_click,
(void *) CONFIRM_OK);
row++;
}
else
evas_object_smart_callback_add(entry,
"activated",
on_click,
(void *) CONFIRM_OK);
}
/* Cancel Button */
if (!pinentry->one_button)
{
obj = elm_button_add(table);
icon = elm_icon_add (table);
evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
if (elm_icon_standard_set (icon, "dialog-cancel") ||
elm_icon_standard_set (icon, "window-close"))
{
evas_object_size_hint_min_set(icon,
ELM_SCALE_SIZE(BUTTON_ICON_SIZE),
ELM_SCALE_SIZE(BUTTON_ICON_SIZE));
elm_object_part_content_set(obj, "icon", icon);
evas_object_show (icon);
}
else
evas_object_del(icon);
if (pinentry->cancel || pinentry->default_cancel)
{
if(pinentry->cancel)
txt = elm_entry_utf8_to_markup(pinentry->cancel);
else
txt = elm_entry_utf8_to_markup(pinentry->default_cancel);
if(txt[0]=='_')
elm_object_text_set(obj,txt+1);
else
elm_object_text_set(obj,txt);
btn_txt_len = ELM_SCALE_SIZE(strlen(txt) * (PADDING * 1.5));
free (txt);
}
else
elm_object_text_set(obj, "Cancel"); //STOCK_CANCEL
evas_object_size_hint_align_set(obj, 0, 0);
if(btn_txt_len>ELM_SCALE_SIZE(BUTTON_WIDTH))
evas_object_size_hint_min_set(obj,
btn_txt_len,
ELM_SCALE_SIZE(BUTTON_HEIGHT));
else
evas_object_size_hint_min_set(obj,
ELM_SCALE_SIZE(BUTTON_WIDTH),
ELM_SCALE_SIZE(BUTTON_HEIGHT));
elm_table_pack(table, obj, 4, row, 1, 1);
evas_object_smart_callback_add(obj,
"clicked",
on_click,
(void *) CONFIRM_CANCEL);
evas_object_show(obj);
}
/* OK Button */
obj = elm_button_add(table);
icon = elm_icon_add (table);
evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
if (elm_icon_standard_set (icon, "dialog-ok") ||
elm_icon_standard_set (icon, "list-add"))
{
evas_object_size_hint_min_set(icon,
ELM_SCALE_SIZE(BUTTON_ICON_SIZE),
ELM_SCALE_SIZE(BUTTON_ICON_SIZE));
elm_object_part_content_set(obj, "icon", icon);
evas_object_show (icon);
}
else
evas_object_del(icon);
if (pinentry->ok || pinentry->default_ok)
{
if(pinentry->ok)
txt = elm_entry_utf8_to_markup(pinentry->ok);
else
txt = elm_entry_utf8_to_markup(pinentry->default_ok);
if(txt[0]=='_')
elm_object_text_set(obj,txt+1);
else
elm_object_text_set(obj,txt);
ok_len = ELM_SCALE_SIZE(strlen(txt) * (PADDING * 1.5));
if(ok_len>btn_txt_len)
btn_txt_len = ok_len;
free (txt);
}
else
elm_object_text_set(obj,"OK"); //STOCK_OK
evas_object_size_hint_align_set(obj, 0, 0);
if(btn_txt_len>ELM_SCALE_SIZE(BUTTON_WIDTH))
evas_object_size_hint_min_set(obj,
btn_txt_len,
ELM_SCALE_SIZE(BUTTON_HEIGHT));
else
evas_object_size_hint_min_set(obj,
ELM_SCALE_SIZE(BUTTON_WIDTH),
ELM_SCALE_SIZE(BUTTON_HEIGHT));
elm_table_pack(table, obj, 5, row, 1, 1);
evas_object_smart_callback_add(obj, "clicked", on_click, (void *) CONFIRM_OK);
evas_object_show(obj);
/* Key/Lock Icon */
obj = elm_icon_add (win);
evas_object_size_hint_aspect_set (obj, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
if (elm_icon_standard_set (obj, "dialog-password"))
{
double ic_size = WIDTH/5;
if(row==0)
ic_size = ic_size/3.5;
else if(row<4)
ic_size = ic_size - ic_size/row;
evas_object_size_hint_min_set(obj,
ELM_SCALE_SIZE(ic_size),
ELM_SCALE_SIZE(ic_size));
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0.5);
elm_table_pack(table, obj, 0, 0, 1, row? row:1);
evas_object_show (obj);
}
else
evas_object_del(obj);
/* Box for padding */
obj = elm_box_add (win);
elm_box_pack_end (obj, table);
evas_object_show (obj);
elm_win_resize_object_add(win,obj);
if(entry)
elm_object_focus_set (entry, EINA_TRUE);
evas_object_show(win);
elm_win_activate(win);
if (pinentry->timeout > 0)
timer = ecore_timer_add (pinentry->timeout,
(Ecore_Task_Cb)timeout_cb,
pinentry);
}
static int
efl_cmd_handler (pinentry_t pe)
{
int want_pass = !!pe->pin;
got_input = EINA_FALSE;
pinentry = pe;
confirm_value = CONFIRM_CANCEL;
passphrase_ok = 0;
confirm_mode = want_pass ? 0 : 1;
/* init ecore-x explicitly using DISPLAY since this can launch
* from console
*/
if (pe->display)
ecore_x_init (pe->display);
elm_init (pargc, pargv);
create_window ();
ecore_main_loop_begin ();
if (timer)
{
ecore_timer_del (timer);
timer = NULL;
}
if (confirm_value == CONFIRM_CANCEL || grab_failed)
pe->canceled = 1;
pinentry = NULL;
if (want_pass)
{
if (passphrase_ok && pe->pin)
return strlen (pe->pin);
else
return -1;
}
else
return (confirm_value == CONFIRM_OK) ? 1 : 0;
}
int
main (int argc, char *argv[])
{
pinentry_init (PGMNAME);
#ifdef FALLBACK_CURSES
if (pinentry_have_display (argc, argv))
{
#endif
pinentry_cmd_handler = efl_cmd_handler;
pargc = argc;
pargv = argv;
#ifdef FALLBACK_CURSES
}
else
{
pinentry_cmd_handler = curses_cmd_handler;
}
#endif
pinentry_parse_opts (argc, argv);
if (pinentry_loop ())
return 1;
return 0;
}

@ -23,6 +23,6 @@ bin_PROGRAMS = pinentry-emacs
AM_CPPFLAGS = $(COMMON_CFLAGS) $(NEMACS_INCLUDE) -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(LIBEMACS) $(LIBICONV)
$(COMMON_LIBS) $(LIBEMACS) $(LIBICONV)
pinentry_emacs_SOURCES = pinentry-emacs.c

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-emacs$(EXEEXT)
subdir = emacs
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -121,7 +130,7 @@ pinentry_emacs_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
pinentry_emacs_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(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
@ -136,7 +145,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-emacs.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -176,6 +186,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -200,6 +212,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -209,6 +223,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -222,11 +237,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -235,6 +251,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -243,6 +261,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -256,16 +276,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -315,6 +342,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -325,7 +353,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(COMMON_CFLAGS) $(NEMACS_INCLUDE) -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(LIBEMACS) $(LIBICONV)
$(COMMON_LIBS) $(LIBEMACS) $(LIBICONV)
pinentry_emacs_SOURCES = pinentry-emacs.c
all: all-am
@ -344,14 +372,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu emacs/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu emacs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -415,7 +442,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-emacs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-emacs.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -483,7 +516,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -555,7 +591,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-emacs.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -601,7 +637,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-emacs.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -621,7 +657,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -635,6 +671,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -37,11 +37,11 @@ main (int argc, char *argv[])
{
pinentry_init ("pinentry-emacs");
pinentry_parse_opts (argc, argv);
if (!pinentry_emacs_init ())
return 1;
pinentry_parse_opts (argc, argv);
if (pinentry_loop ())
return 1;

@ -13,7 +13,7 @@ endif
AM_CPPFLAGS = $(COMMON_CFLAGS) $(FLTKCXXFLAGS) $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
AM_CXXFLAGS = -std=c++11
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) $(libcurses)
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a $(COMMON_LIBS) $(FLTKLIBS) $(libcurses)
pinentry_fltk_SOURCES = main.cxx pinwindow.cxx pinwindow.h \
passwindow.cxx passwindow.h \

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -18,7 +18,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -83,16 +93,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-fltk$(EXEEXT)
subdir = fltk
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -110,8 +119,7 @@ am__DEPENDENCIES_1 =
@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1)
pinentry_fltk_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -126,7 +134,9 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/main.Po ./$(DEPDIR)/passwindow.Po \
./$(DEPDIR)/pinwindow.Po ./$(DEPDIR)/qualitypasswindow.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -179,6 +189,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -203,6 +215,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -212,6 +226,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -225,11 +240,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -238,6 +254,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -246,6 +264,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -259,16 +279,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -318,6 +345,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -332,7 +360,7 @@ top_srcdir = @top_srcdir@
@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
AM_CXXFLAGS = -std=c++11
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(FLTKLIBS) $(libcurses)
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a $(COMMON_LIBS) $(FLTKLIBS) $(libcurses)
pinentry_fltk_SOURCES = main.cxx pinwindow.cxx pinwindow.h \
passwindow.cxx passwindow.h \
qualitypasswindow.cxx qualitypasswindow.h
@ -354,14 +382,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu fltk/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu fltk/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -425,10 +452,16 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@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)/pinwindow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qualitypasswindow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwindow.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinwindow.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qualitypasswindow.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cxx.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -496,7 +529,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -568,7 +604,10 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/passwindow.Po
-rm -f ./$(DEPDIR)/pinwindow.Po
-rm -f ./$(DEPDIR)/qualitypasswindow.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -614,7 +653,10 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/passwindow.Po
-rm -f ./$(DEPDIR)/pinwindow.Po
-rm -f ./$(DEPDIR)/qualitypasswindow.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -634,7 +676,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -648,6 +690,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -78,6 +78,44 @@ static std::string escape_accel_utf8(const char *s)
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 pe)
// 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 pe)
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 pe)
}
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:

@ -32,6 +32,6 @@ endif
AM_CPPFLAGS = $(COMMON_CFLAGS) $(GNOME3_CFLAGS) \
$(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(GNOME3_LIBS) $(libcurses)
$(COMMON_LIBS) $(GNOME3_LIBS) $(libcurses)
pinentry_gnome3_SOURCES = pinentry-gnome3.c

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-gnome3$(EXEEXT)
subdir = gnome3
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -125,8 +134,7 @@ am__DEPENDENCIES_1 =
@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1)
pinentry_gnome3_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -141,7 +149,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-gnome3.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -181,6 +190,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -205,6 +216,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -214,6 +227,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -227,11 +241,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -240,6 +255,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -248,6 +265,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -261,16 +280,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -320,6 +346,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -336,7 +363,7 @@ AM_CPPFLAGS = $(COMMON_CFLAGS) $(GNOME3_CFLAGS) \
$(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(GNOME3_LIBS) $(libcurses)
$(COMMON_LIBS) $(GNOME3_LIBS) $(libcurses)
pinentry_gnome3_SOURCES = pinentry-gnome3.c
all: all-am
@ -355,14 +382,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gnome3/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu gnome3/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -426,7 +452,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gnome3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gnome3.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -494,7 +526,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -566,7 +601,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-gnome3.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -612,7 +647,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-gnome3.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -632,7 +667,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -646,6 +681,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -214,7 +214,6 @@ create_prompt (pinentry_t pe, int confirm)
ui/frob-system-prompt.c for example conversion using %lu */
snprintf (window_id, sizeof (window_id), "%lu",
(long unsigned int)pe->parent_wid);
window_id[sizeof (window_id) - 1] = '\0';
gcr_prompt_set_caller_window (prompt, window_id);
#ifdef HAVE_LIBSECRET
@ -446,15 +445,15 @@ pe_gnome_screen_locked (void)
NULL,
((const GVariantType *) "(b)"),
G_DBUS_CALL_FLAGS_NO_AUTO_START,
0,
-1,
NULL,
&error);
g_object_unref(dbus);
if (!reply)
{
/* G_IO_ERROR_TIMED_OUT is the expected response when there is
/* G_IO_ERROR_IS_DIRECTORY is the expected response when there is
* no gnome screensaver at all, don't be noisy in that case: */
if (!(error && error->code == G_IO_ERROR_TIMED_OUT))
if (!(error && error->code == G_IO_ERROR_IS_DIRECTORY))
fprintf (stderr, "Failed to get d-bus reply for org.gnome.ScreenSaver.GetActive (%d): %s\n",
error ? error->code : -1,
error ? error->message : "<no GError>");

@ -32,6 +32,6 @@ endif
AM_CPPFLAGS = $(COMMON_CFLAGS) $(GTK2_CFLAGS) $(ncurses_include) \
-I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(GTK2_LIBS) $(libcurses)
$(COMMON_LIBS) $(GTK2_LIBS) $(libcurses)
pinentry_gtk_2_SOURCES = pinentry-gtk-2.c

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-gtk-2$(EXEEXT)
subdir = gtk+-2
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -125,8 +134,7 @@ am__DEPENDENCIES_1 =
@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1)
pinentry_gtk_2_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -141,7 +149,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-gtk-2.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -181,6 +190,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -205,6 +216,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -214,6 +227,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -227,11 +241,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -240,6 +255,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -248,6 +265,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -261,16 +280,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -320,6 +346,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -336,7 +363,7 @@ AM_CPPFLAGS = $(COMMON_CFLAGS) $(GTK2_CFLAGS) $(ncurses_include) \
-I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(GTK2_LIBS) $(libcurses)
$(COMMON_LIBS) $(GTK2_LIBS) $(libcurses)
pinentry_gtk_2_SOURCES = pinentry-gtk-2.c
all: all-am
@ -355,14 +382,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gtk+-2/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu gtk+-2/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -426,7 +452,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gtk-2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gtk-2.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -494,7 +526,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -566,7 +601,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-gtk-2.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -612,7 +647,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-gtk-2.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -632,7 +667,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -646,6 +681,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -71,9 +71,6 @@ static GtkWidget *entry;
static GtkWidget *repeat_entry;
static GtkWidget *error_label;
static GtkWidget *qualitybar;
#if !GTK_CHECK_VERSION (2, 12, 0)
static GtkTooltips *tooltips;
#endif
static gboolean got_input;
static guint timeout_source;
static int confirm_mode;
@ -402,14 +399,12 @@ changed_text_handler (GtkWidget *widget)
else if (percent < 0)
{
snprintf (textbuf, sizeof textbuf, "(%d%%)", -percent);
textbuf[sizeof textbuf -1] = 0;
color.red = 0xffff;
percent = -percent;
}
else
{
snprintf (textbuf, sizeof textbuf, "%d%%", percent);
textbuf[sizeof textbuf -1] = 0;
color.green = 0xffff;
}
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar),
@ -419,6 +414,23 @@ changed_text_handler (GtkWidget *widget)
}
/* Called upon a press on Backspace in the entry widget.
Used to completely disable echoing if we got no prior input. */
static void
backspace_handler (GtkWidget *widget, gpointer data)
{
(void)widget;
(void)data;
if (!got_input)
{
gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0);
if (repeat_entry)
gtk_entry_set_invisible_char (GTK_ENTRY (repeat_entry), 0);
}
}
#ifdef HAVE_LIBSECRET
static void
may_save_passphrase_toggled (GtkWidget *widget, gpointer data)
@ -568,10 +580,6 @@ create_window (pinentry_t ctx)
repeat_entry = NULL;
#if !GTK_CHECK_VERSION (2, 12, 0)
tooltips = gtk_tooltips_new ();
#endif
/* FIXME: check the grabbing code against the one we used with the
old gpg-agent */
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@ -713,6 +721,14 @@ create_window (pinentry_t ctx)
gtk_widget_set_size_request (entry, 200, -1);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (changed_text_handler), entry);
/* Enable disabling echo if we're not asking for a PIN. */
if (pinentry->prompt && !strstr (pinentry->prompt, "PIN"))
{
g_signal_connect (G_OBJECT (entry), "backspace",
G_CALLBACK (backspace_handler), entry);
}
hbox = gtk_hbox_new (FALSE, HIG_TINY);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
/* There was a wish in issue #2139 that this button should not
@ -739,13 +755,8 @@ create_window (pinentry_t ctx)
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar), 0.0);
if (pinentry->quality_bar_tt && !pinentry->grab)
{
#if !GTK_CHECK_VERSION (2, 12, 0)
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), qualitybar,
pinentry->quality_bar_tt, "");
#else
gtk_widget_set_tooltip_text (qualitybar,
pinentry->quality_bar_tt);
#endif
}
gtk_table_attach (GTK_TABLE (table), qualitybar, 1, 2, nrow, nrow+1,
GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
@ -879,7 +890,7 @@ create_window (pinentry_t ctx)
gtk_container_add (GTK_CONTAINER(bbox), w);
if (!confirm_mode)
{
GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
gtk_widget_set_can_default (w, TRUE);
gtk_widget_grab_default (w);
}

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -78,15 +88,15 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = m4
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -111,6 +121,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in ChangeLog
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -135,6 +146,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -144,6 +157,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -157,11 +171,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -170,6 +185,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -178,6 +195,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -191,16 +210,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -250,6 +276,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -276,14 +303,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu m4/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -301,7 +327,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -444,6 +473,8 @@ uninstall-am:
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -43,14 +43,12 @@ AC_DEFUN([IU_LIB_NCURSES], [
# Use ncurses header files instead of the ordinary ones, if possible;
# is there a better way of doing this, that avoids looking in specific
# directories?
AC_ARG_WITH(ncurses-include-dir,
[ --with-ncurses-include-dir=DIR
Set directory containing the include files for
AC_ARG_WITH([ncurses-include-dir],
AS_HELP_STRING([--with-ncurses-include-dir=DIR],
[Set directory containing the include files for
use with -lncurses, when it isn't installed as
the default curses library. If DIR is "none",
then no special ncurses include files are used.
--without-ncurses-include-dir
Equivalent to --with-ncurses-include-dir=none])dnl
then no special ncurses include files are used.]))
if test "${with_ncurses_include_dir+set}" = set; then
AC_MSG_CHECKING(for ncurses include dir)
case "$with_ncurses_include_dir" in
@ -112,9 +110,9 @@ AC_DEFUN([IU_LIB_TERMCAP], [
fi
AC_SUBST(LIBTERMCAP)])dnl
dnl IU_LIB_CURSES -- checke for curses, and associated libraries
dnl IU_LIB_CURSES -- check for curses, and associated libraries
dnl
dnl Checks for varions libraries implementing the curses interface, and if
dnl Checks for various libraries implementing the curses interface, and if
dnl found, defines LIBCURSES to be the appropriate linker specification,
dnl *including* any termcap libraries if needed (some versions of curses
dnl don't need termcap).
@ -132,9 +130,7 @@ AC_DEFUN([IU_LIB_CURSES], [
AC_CACHE_CHECK(whether curses needs $LIBTERMCAP,
inetutils_cv_curses_needs_termcap,
LIBS="$LIBCURSES"
AC_TRY_LINK([#include <curses.h>], [initscr ();],
[inetutils_cv_curses_needs_termcap=no],
[inetutils_cv_curses_needs_termcap=yes]))
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[initscr ();]])],[inetutils_cv_curses_needs_termcap=no],[inetutils_cv_curses_needs_termcap=yes]))
if test $inetutils_cv_curses_needs_termcap = yes; then
LIBCURSES="$LIBCURSES $LIBTERMCAP"
fi

@ -0,0 +1,208 @@
# gpg-error.m4 - autoconf macro to detect libgpg-error.
# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021
# g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2022-02-15
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
dnl used for programs requireing real multi thread support.
dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_GPG_ERROR],
[ AC_REQUIRE([AC_CANONICAL_HOST])
gpg_error_config_prefix=""
dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
dnl since that is consistent with how our three siblings use the directory/
dnl package name in --with-$dir_name-prefix=PFX.
AC_ARG_WITH(libgpg-error-prefix,
AS_HELP_STRING([--with-libgpg-error-prefix=PFX],
[prefix where GPG Error is installed (optional)]),
[gpg_error_config_prefix="$withval"])
dnl Accept --with-gpg-error-prefix and make it work the same as
dnl --with-libgpg-error-prefix above, for backwards compatibility,
dnl but do not document this old, inconsistently-named option.
AC_ARG_WITH(gpg-error-prefix,,
[gpg_error_config_prefix="$withval"])
if test x"${GPG_ERROR_CONFIG}" = x ; then
if test x"${gpg_error_config_prefix}" != x ; then
GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/gpg-error-config" ; then
GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi
fi
AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
min_gpg_error_version=ifelse([$1], ,1.33,$1)
ok=no
AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, [$prefix/bin:$PATH])
if test "$GPGRT_CONFIG" != "no"; then
# Determine gpgrt_libdir
#
# Get the prefix of gpgrt-config assuming it's something like:
# <PREFIX>/bin/gpgrt-config
gpgrt_prefix=${GPGRT_CONFIG%/*/*}
possible_libdir1=${gpgrt_prefix}/lib
# Determine by using system libdir-format with CC, it's like:
# Normal style: /usr/lib
# GNU cross style: /usr/<triplet>/lib
# Debian style: /usr/lib/<multiarch-name>
# Fedora/openSUSE style: /usr/lib, /usr/lib32 or /usr/lib64
# It is assumed that CC is specified to the one of host on cross build.
if libdir_candidates=$(${CC:-cc} -print-search-dirs | \
sed -n -e "/^libraries/{s/libraries: =//;s/:/\\
/g;p;}"); then
# From the output of -print-search-dirs, select valid pkgconfig dirs.
libdir_candidates=$(for dir in $libdir_candidates; do
if p=$(cd $dir 2>/dev/null && pwd); then
test -d "$p/pkgconfig" && echo $p;
fi
done)
for possible_libdir0 in $libdir_candidates; do
# possible_libdir0:
# Fallback candidate, the one of system-installed (by $CC)
# (/usr/<triplet>/lib, /usr/lib/<multiarch-name> or /usr/lib32)
# possible_libdir1:
# Another candidate, user-locally-installed
# (<gpgrt_prefix>/lib)
# possible_libdir2
# Most preferred
# (<gpgrt_prefix>/<triplet>/lib,
# <gpgrt_prefix>/lib/<multiarch-name> or <gpgrt_prefix>/lib32)
if test "${possible_libdir0##*/}" = "lib"; then
possible_prefix0=${possible_libdir0%/lib}
possible_prefix0_triplet=${possible_prefix0##*/}
if test -z "$possible_prefix0_triplet"; then
continue
fi
possible_libdir2=${gpgrt_prefix}/$possible_prefix0_triplet/lib
else
possible_prefix0=${possible_libdir0%%/lib*}
possible_libdir2=${gpgrt_prefix}${possible_libdir0#$possible_prefix0}
fi
if test -f ${possible_libdir2}/pkgconfig/gpg-error.pc; then
gpgrt_libdir=${possible_libdir2}
elif test -f ${possible_libdir1}/pkgconfig/gpg-error.pc; then
gpgrt_libdir=${possible_libdir1}
elif test -f ${possible_libdir0}/pkgconfig/gpg-error.pc; then
gpgrt_libdir=${possible_libdir0}
fi
if test -n "$gpgrt_libdir"; then break; fi
done
else
# When we cannot determine system libdir-format, use this:
gpgrt_libdir=${possible_libdir1}
fi
else
unset GPGRT_CONFIG
fi
if test -n "$gpgrt_libdir"; then
GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
else
unset GPGRT_CONFIG
fi
elif test "$GPG_ERROR_CONFIG" != "no"; then
gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
unset GPGRT_CONFIG
fi
if test "$GPG_ERROR_CONFIG" != "no"; then
req_major=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
major=`echo $gpg_error_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $gpg_error_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
if test "$major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -ge "$req_minor"; then
ok=yes
fi
fi
fi
fi
AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
if test $ok = yes; then
GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags`
GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs`
if test -z "$GPGRT_CONFIG"; then
GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null`
GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null`
else
GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null`
GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null`
GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
fi
AC_MSG_RESULT([yes ($gpg_error_config_version)])
ifelse([$2], , :, [$2])
if test -z "$GPGRT_CONFIG"; then
gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none`
else
gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none`
fi
if test x"$gpg_error_config_host" != xnone ; then
if test x"$gpg_error_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script "$GPG_ERROR_CONFIG" was
*** built for $gpg_error_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libgpg-error-prefix
*** to specify a matching config script or use \$SYSROOT.
***]])
gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
fi
fi
else
GPG_ERROR_CFLAGS=""
GPG_ERROR_LIBS=""
GPG_ERROR_MT_CFLAGS=""
GPG_ERROR_MT_LIBS=""
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
AC_SUBST(GPG_ERROR_CFLAGS)
AC_SUBST(GPG_ERROR_LIBS)
AC_SUBST(GPG_ERROR_MT_CFLAGS)
AC_SUBST(GPG_ERROR_MT_LIBS)
])

@ -0,0 +1,288 @@
# iconv.m4 serial 21
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2019 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
])
AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <iconv.h>
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <iconv.h>
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes])
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
dnl Solaris 10.
am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
am_cv_func_iconv_works=no
for ac_iconv_const in '' 'const'; do
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <iconv.h>
#include <string.h>
#ifndef ICONV_CONST
# define ICONV_CONST $ac_iconv_const
#endif
]],
[[int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
char buf[10];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_utf8_to_88591,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 1;
iconv_close (cd_utf8_to_88591);
}
}
/* Test against Solaris 10 bug: Failures are not distinguishable from
successful returns. */
{
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
if (cd_ascii_to_88591 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\263";
char buf[10];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_ascii_to_88591,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 2;
iconv_close (cd_ascii_to_88591);
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
{
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\304";
static char buf[2] = { (char)0xDE, (char)0xAD };
ICONV_CONST char *inptr = input;
size_t inbytesleft = 1;
char *outptr = buf;
size_t outbytesleft = 1;
size_t res = iconv (cd_88591_to_utf8,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
result |= 4;
iconv_close (cd_88591_to_utf8);
}
}
#if 0 /* This bug could be worked around by the caller. */
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
{
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
char buf[50];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_88591_to_utf8,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
result |= 8;
iconv_close (cd_88591_to_utf8);
}
}
#endif
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
provided. */
{
/* Try standardized names. */
iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
/* Try IRIX, OSF/1 names. */
iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
/* Try AIX names. */
iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
/* Try HP-UX names. */
iconv_t cd4 = iconv_open ("utf8", "eucJP");
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
result |= 16;
if (cd1 != (iconv_t)(-1))
iconv_close (cd1);
if (cd2 != (iconv_t)(-1))
iconv_close (cd2);
if (cd3 != (iconv_t)(-1))
iconv_close (cd3);
if (cd4 != (iconv_t)(-1))
iconv_close (cd4);
}
return result;
]])],
[am_cv_func_iconv_works=yes], ,
[case "$host_os" in
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
*) am_cv_func_iconv_works="guessing yes" ;;
esac])
test "$am_cv_func_iconv_works" = no || break
done
LIBS="$am_save_LIBS"
])
case "$am_cv_func_iconv_works" in
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
*) am_func_iconv=yes ;;
esac
else
am_func_iconv=no am_cv_lib_iconv=no
fi
if test "$am_func_iconv" = yes; then
AC_DEFINE([HAVE_ICONV], [1],
[Define if you have the iconv() function and it works.])
fi
if test "$am_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
AC_SUBST([LIBICONV])
AC_SUBST([LTLIBICONV])
])
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
dnl avoid warnings like
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[m4_ifdef([gl_00GNULIB],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[[AC_DEFUN(
[$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL([am_cv_proto_iconv], [
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
]],
[[]])],
[am_cv_proto_iconv_arg1=""],
[am_cv_proto_iconv_arg1="const"])
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([
$am_cv_proto_iconv])
else
dnl When compiling GNU libiconv on a system that does not have iconv yet,
dnl pick the POSIX compliant declaration without 'const'.
am_cv_proto_iconv_arg1=""
fi
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test -n "$am_cv_proto_iconv_arg1"; then
ICONV_CONST="const"
fi
])
])

@ -8,6 +8,8 @@ dnl
dnl This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl SPDX-License-Identifier: FSFULLR
# Last-changed: 2020-11-17
dnl
dnl Common code used for libassuan detection [internal]
@ -16,30 +18,26 @@ dnl
AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
[ AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(libassuan-prefix,
AC_HELP_STRING([--with-libassuan-prefix=PFX],
AS_HELP_STRING([--with-libassuan-prefix=PFX],
[prefix where LIBASSUAN is installed (optional)]),
libassuan_config_prefix="$withval", libassuan_config_prefix="")
if test x$libassuan_config_prefix != x ; then
libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
if test x${LIBASSUAN_CONFIG+set} != xset ; then
LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
fi
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/libassuan-config" ; then
LIBASSUAN_CONFIG="${SYSROOT}/bin/libassuan-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi
AC_PATH_TOOL(LIBASSUAN_CONFIG, libassuan-config, no)
use_gpgrt_config=""
if test x"${LIBASSUAN_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
if $GPGRT_CONFIG libassuan --exists; then
LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan"
AC_MSG_NOTICE([Use gpgrt-config as libassuan-config])
use_gpgrt_config=yes
fi
fi
if test -z "$use_gpgrt_config"; then
AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
fi
tmp=ifelse([$1], ,1:0.9.2,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
@ -52,8 +50,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
ok=no
if test "$LIBASSUAN_CONFIG" != "no" \
&& test -f "$LIBASSUAN_CONFIG" ; then
if test "$LIBASSUAN_CONFIG" != "no"; then
req_major=`echo $min_libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_libassuan_version | \
@ -61,7 +58,11 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
req_micro=`echo $min_libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
libassuan_config_version=`$LIBASSUAN_CONFIG --version`
if test -z "$use_gpgrt_config"; then
libassuan_config_version=`$LIBASSUAN_CONFIG --version`
else
libassuan_config_version=`$LIBASSUAN_CONFIG --modversion`
fi
major=`echo $libassuan_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libassuan_config_version | \
@ -94,7 +95,11 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
if test $ok = yes; then
if test "$req_libassuan_api" -gt 0 ; then
tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
if test -z "$use_gpgrt_config"; then
tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
else
tmp=`$LIBASSUAN_CONFIG --variable=api_version 2>/dev/null || echo 0`
fi
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBASSUAN API version])
if test "$req_libassuan_api" -eq "$tmp" ; then
@ -109,16 +114,20 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
if test $ok = yes; then
if test x"$host" != x ; then
libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
if test -z "$use_gpgrt_config"; then
libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
else
libassuan_config_host=`$LIBASSUAN_CONFIG --variable=host 2>/dev/null || echo none`
fi
if test x"$libassuan_config_host" != xnone ; then
if test x"$libassuan_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $LIBASSUAN_CONFIG was
*** The config script "$LIBASSUAN_CONFIG" was
*** built for $libassuan_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libassuan-prefix
*** to specify a matching config script or use \$SYSROOT.
*** to specify a matching config script.
***]])
fi
fi
@ -150,8 +159,8 @@ dnl
AC_DEFUN([AM_PATH_LIBASSUAN],
[ _AM_PATH_LIBASSUAN_COMMON($1)
if test $ok = yes; then
LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG --cflags`
LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG --libs`
ifelse([$2], , :, [$2])
else
LIBASSUAN_CFLAGS=""

@ -17,19 +17,18 @@ dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
dnl Autoconf macro to find either Qt4 or Qt5
dnl Autoconf macro to find Qt5
dnl
dnl sets PINENTRY_QT_LIBS and PINENTRY_QT_CFLAGS
dnl
dnl if QT5 was found have_qt5_libs is set to yes
dnl if QT4 was found have_qt4_libs is set to yes
dnl if Qt5 was found have_qt5_libs is set to yes
dnl
dnl The moc lookup code is based on libpoppler (rev. d821207)
AC_DEFUN([FIND_QT],
[
AC_ARG_ENABLE(pinentry-qt5,
AC_HELP_STRING([--disable-pinentry-qt5],
AS_HELP_STRING([--disable-pinentry-qt5],
[Don't use qt5 even if it is available.]),
enable_pinentry_qt5=$enableval,
enable_pinentry_qt5="try")
@ -57,6 +56,28 @@ AC_DEFUN([FIND_QT],
PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -std=c++11"
fi
qtlibdir=`"$PKG_CONFIG" --variable libdir Qt5Core`
if test -n "$qtlibdir"; then
if test "$enable_rpath" != "no"; then
PINENTRY_QT_LDFLAGS="$PINENTRY_QT_LDFLAGS -Wl,-rpath \"$qtlibdir\""
fi
fi
if test "$have_x11" = "yes"; then
PKG_CHECK_MODULES(
PINENTRY_QT_X11_EXTRAS,
Qt5X11Extras >= 5.1.0,
[have_qt5_x11extras="yes"],
[
AC_MSG_WARN([pinentry-qt will be built without Caps Lock warning on X11])
have_qt5_x11extras="no"
])
if test "$have_qt5_x11extras" = "yes"; then
PINENTRY_QT_CFLAGS="$LIBX11_CFLAGS $PINENTRY_QT_CFLAGS $PINENTRY_QT_X11_EXTRAS_CFLAGS"
PINENTRY_QT_LIBS="$LIBX11_LIBS $PINENTRY_QT_LIBS $PINENTRY_QT_X11_EXTRAS_LIBS"
fi
fi
AC_CHECK_TOOL(MOC, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC -v 2>&1`
@ -82,31 +103,32 @@ AC_DEFUN([FIND_QT],
MOC=$MOC2
fi
fi
fi
if test "$have_qt5_libs" != "yes"; then
PKG_CHECK_MODULES(PINENTRY_QT,
QtCore >= 4.6.0 QtGui >= 4.6.0,
[have_qt4_libs="yes"],
[have_qt4_libs="no"])
if test "$have_qt4_libs" = "yes"; then
AC_CHECK_TOOL(MOC, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
AC_MSG_RESULT([no])
# moc was not the qt4 one, try with moc-qt4
AC_CHECK_TOOL(MOC2, moc-qt4)
mocversion=`$MOC2 -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
# no valid moc found
have_qt4_libs="no";
MOC="not found"
AC_CHECK_TOOL(RCC, rcc)
AC_MSG_CHECKING([rcc version])
rccversion=`$RCC -v 2>&1`
rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"`
if test x"$rccversiongrep" != x"$rccversion"; then
AC_MSG_RESULT([no])
# rcc was not the qt5 one, try with rcc-qt5
AC_CHECK_TOOL(RCC2, rcc-qt5)
rccversion=`$RCC2 -v 2>&1`
rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc-qt5 5|rcc 5"`
if test x"$rccversiongrep" != x"$rccversion"; then
AC_CHECK_TOOL(QTCHOOSER, qtchooser)
qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2`
rccversion=`$qt5tooldir/rcc -v 2>&1`
rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"`
if test x"$rccversiongrep" != x"$rccversion"; then
# no valid rcc found
have_qt5_libs="no";
else
MOC=$MOC2
RCC=$qt5tooldir/rcc
fi
else
RCC=$RCC2
fi
fi
fi
])

@ -0,0 +1,58 @@
dnl qt4.m4
dnl Copyright (C) 2015 Intevation GmbH
dnl
dnl This file is part of PINENTRY.
dnl
dnl PINENTRY is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl PINENTRY is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
dnl Autoconf macro to find either Qt4
dnl
dnl sets PINENTRY_QT4_LIBS and PINENTRY_QT4_CFLAGS
dnl
dnl if Qt4 was found have_qt4_libs is set to yes
dnl
dnl The moc lookup code is based on libpoppler (rev. d821207)
AC_DEFUN([FIND_QT4],
[
have_qt4_libs="no";
if test "$enable_pinentry_qt4" != "no"; then
PKG_CHECK_MODULES(PINENTRY_QT4,
QtCore >= 4.6.0 QtGui >= 4.6.0,
[have_qt4_libs="yes"],
[have_qt4_libs="no"])
fi
if test "$have_qt4_libs" = "yes"; then
AC_CHECK_TOOL(MOC4, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC4 -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
AC_MSG_RESULT([no])
# moc was not the qt4 one, try with moc-qt4
AC_CHECK_TOOL(MOC42, moc-qt4)
mocversion=`$MOC42 -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
# no valid moc found
have_qt4_libs="no";
MOC4="not found"
else
MOC4=$MOC42
fi
fi
fi
])

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -98,16 +108,15 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = pinentry
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -148,7 +157,11 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/argparse.Po \
./$(DEPDIR)/libpinentry_curses_a-pinentry-curses.Po \
./$(DEPDIR)/password-cache.Po ./$(DEPDIR)/pinentry-emacs.Po \
./$(DEPDIR)/pinentry.Po
am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -193,6 +206,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -217,6 +232,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -226,6 +243,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -239,11 +257,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -252,6 +271,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -260,6 +281,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -273,16 +296,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -332,6 +362,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -369,14 +400,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pinentry/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu pinentry/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -407,11 +437,17 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argparse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpinentry_curses_a-pinentry-curses.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/password-cache.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-emacs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argparse.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpinentry_curses_a-pinentry-curses.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/password-cache.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-emacs.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -493,7 +529,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -562,7 +601,11 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/argparse.Po
-rm -f ./$(DEPDIR)/libpinentry_curses_a-pinentry-curses.Po
-rm -f ./$(DEPDIR)/password-cache.Po
-rm -f ./$(DEPDIR)/pinentry-emacs.Po
-rm -f ./$(DEPDIR)/pinentry.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -608,7 +651,11 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/argparse.Po
-rm -f ./$(DEPDIR)/libpinentry_curses_a-pinentry-curses.Po
-rm -f ./$(DEPDIR)/password-cache.Po
-rm -f ./$(DEPDIR)/pinentry-emacs.Po
-rm -f ./$(DEPDIR)/pinentry.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -628,18 +675,20 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.

@ -29,7 +29,29 @@
#include <stdlib.h>
#include <locale.h>
#include <iconv.h>
#include <langinfo.h>
#if defined(HAVE_LANGINFO_H)
# include <langinfo.h>
#elif defined(HAVE_W32_SYSTEM)
# include <stdio.h>
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
/* A simple replacement for nl_langinfo that only understands
CODESET. */
# define CODESET 1
char *
nl_langinfo (int ignore)
{
static char codepage[20];
UINT cp = GetACP ();
(void)ignore;
sprintf (codepage, "CP%u", cp);
return codepage;
}
#endif
#include <limits.h>
#include <string.h>
#include <errno.h>
@ -94,6 +116,8 @@ struct dialog
int pin_max;
/* Length of PIN. */
int pin_len;
int got_input;
int no_echo;
int ok_y;
int ok_x;
@ -108,11 +132,154 @@ struct dialog
pinentry_t pinentry;
};
typedef struct dialog *dialog_t;
/* Flag to remember whether a warning has been printed. */
static int lc_ctype_unknown_warning;
static char *
pinentry_utf8_to_local (const char *lc_ctype, const char *text)
{
iconv_t cd;
const char *input = text;
size_t input_len = strlen (text) + 1;
char *output;
size_t output_len;
char *output_buf;
size_t processed;
char *old_ctype;
char *target_encoding;
const char *pgmname = pinentry_get_pgmname ();
/* If no locale setting could be determined, simply copy the
string. */
if (!lc_ctype)
{
if (! lc_ctype_unknown_warning)
{
fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
pgmname);
lc_ctype_unknown_warning = 1;
}
return strdup (text);
}
old_ctype = strdup (setlocale (LC_CTYPE, NULL));
if (!old_ctype)
return NULL;
setlocale (LC_CTYPE, lc_ctype);
target_encoding = nl_langinfo (CODESET);
if (!target_encoding)
target_encoding = "?";
setlocale (LC_CTYPE, old_ctype);
free (old_ctype);
/* This is overkill, but simplifies the iconv invocation greatly. */
output_len = input_len * MB_LEN_MAX;
output_buf = output = malloc (output_len);
if (!output)
return NULL;
cd = iconv_open (target_encoding, "UTF-8");
if (cd == (iconv_t) -1)
{
fprintf (stderr, "%s: can't convert from UTF-8 to %s: %s\n",
pgmname, target_encoding, strerror (errno));
free (output_buf);
return NULL;
}
processed = iconv (cd, (ICONV_CONST char **)&input, &input_len,
&output, &output_len);
iconv_close (cd);
if (processed == (size_t) -1 || input_len)
{
fprintf (stderr, "%s: error converting from UTF-8 to %s: %s\n",
pgmname, target_encoding, strerror (errno));
free (output_buf);
return NULL;
}
return output_buf;
}
/* Convert TEXT which is encoded according to LC_CTYPE to UTF-8. With
SECURE set to true, use secure memory for the returned buffer.
Return NULL on error. */
static char *
pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure)
{
char *old_ctype;
char *source_encoding;
iconv_t cd;
const char *input = text;
size_t input_len = strlen (text) + 1;
char *output;
size_t output_len;
char *output_buf;
size_t processed;
const char *pgmname = pinentry_get_pgmname ();
/* If no locale setting could be determined, simply copy the
string. */
if (!lc_ctype)
{
if (! lc_ctype_unknown_warning)
{
fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
pgmname);
lc_ctype_unknown_warning = 1;
}
output_buf = secure? secmem_malloc (input_len) : malloc (input_len);
if (output_buf)
strcpy (output_buf, input);
return output_buf;
}
old_ctype = strdup (setlocale (LC_CTYPE, NULL));
if (!old_ctype)
return NULL;
setlocale (LC_CTYPE, lc_ctype);
source_encoding = nl_langinfo (CODESET);
setlocale (LC_CTYPE, old_ctype);
free (old_ctype);
/* This is overkill, but simplifies the iconv invocation greatly. */
output_len = input_len * MB_LEN_MAX;
output_buf = output = secure? secmem_malloc (output_len):malloc (output_len);
if (!output)
return NULL;
cd = iconv_open ("UTF-8", source_encoding);
if (cd == (iconv_t) -1)
{
fprintf (stderr, "%s: can't convert from %s to UTF-8: %s\n",
pgmname, source_encoding? source_encoding : "?",
strerror (errno));
if (secure)
secmem_free (output_buf);
else
free (output_buf);
return NULL;
}
processed = iconv (cd, (ICONV_CONST char **)&input, &input_len,
&output, &output_len);
iconv_close (cd);
if (processed == (size_t) -1 || input_len)
{
fprintf (stderr, "%s: error converting from %s to UTF-8: %s\n",
pgmname, source_encoding? source_encoding : "?",
strerror (errno));
if (secure)
secmem_free (output_buf);
else
free (output_buf);
return NULL;
}
return output_buf;
}
#ifdef HAVE_NCURSESW
typedef wchar_t CH;
#define STRLEN(x) wcslen (x)
#define STRWIDTH(x) wcswidth (x, wcslen (x))
#define ADDCH(x) addnwstr (&x, 1);
#define CHWIDTH(x) wcwidth (x)
#define NULLCH L'\0'
@ -121,6 +288,7 @@ typedef wchar_t CH;
#else
typedef char CH;
#define STRLEN(x) strlen (x)
#define STRWIDTH(x) strlen (x)
#define ADDCH(x) addch ((unsigned char) x)
#define CHWIDTH(x) 1
#define NULLCH '\0'
@ -128,13 +296,14 @@ typedef char CH;
#define SPCH ' '
#endif
/* Return the next line up to MAXLEN columns wide in START and LEN.
/* Return the next line up to MAXWIDTH columns wide in START and LEN.
Return value is the width needed for the line.
The first invocation should have 0 as *LEN. If the line ends with
a \n, it is a normal line that will be continued. If it is a '\0'
the end of the text is reached after this line. In all other cases
there is a forced line break. A full line is returned and will be
continued in the next line. */
static void
static int
collect_line (int maxwidth, CH **start_p, int *len_p)
{
int last_space = 0;
@ -153,11 +322,11 @@ collect_line (int maxwidth, CH **start_p, int *len_p)
while (width < maxwidth - 1 && *end != NULLCH && *end != NLCH)
{
len++;
end++;
if (*end == SPCH)
last_space = len;
width += CHWIDTH (*end);
len++;
end++;
}
if (*end != NULLCH && *end != NLCH && last_space != 0)
@ -169,6 +338,7 @@ collect_line (int maxwidth, CH **start_p, int *len_p)
(*start_p)[len] = NLCH;
}
*len_p = len + 1;
return width;
}
#ifdef HAVE_NCURSESW
@ -309,6 +479,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
} \
dialog->which = pinentry_utf8_to_local (pinentry->lc_ctype, \
new ? new : default); \
free (new); \
if (!dialog->which) \
{ \
err = 1; \
@ -340,9 +511,10 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
do
{
collect_line (size_x - 4, &start, &len);
if (len > description_x)
description_x = len;
int width = collect_line (size_x - 4, &start, &len);
if (width > description_x)
description_x = width;
y++;
}
while (start[len - 1]);
@ -412,7 +584,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
new_x = MIN_PINENTRY_LENGTH;
if (prompt)
{
new_x += STRLEN (prompt) + 1; /* One space after prompt. */
new_x += STRWIDTH (prompt) + 1; /* One space after prompt. */
}
if (new_x > size_x - 4)
new_x = size_x - 4;
@ -541,11 +713,12 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
if (prompt)
{
CH *p = prompt;
i = STRLEN (prompt);
i = STRWIDTH (prompt);
if (i > x - 4 - MIN_PINENTRY_LENGTH)
i = x - 4 - MIN_PINENTRY_LENGTH;
dialog->pin_x += i + 1;
dialog->pin_size -= i + 1;
i = STRLEN (prompt);
while (i-- > 0)
{
ADDCH (*(p++));
@ -596,6 +769,9 @@ dialog_create (pinentry_t pinentry, dialog_t dialog)
addstr (dialog->ok);
}
dialog->got_input = 0;
dialog->no_echo = 0;
out:
if (description)
free (description);
@ -730,6 +906,12 @@ dialog_input (dialog_t diag, int alt, int chr)
diag->pin_loc = diag->pin_len;
}
}
else if (!diag->got_input)
{
diag->no_echo = 1;
move (diag->pin_y, diag->pin_x);
addstr ("[no echo]");
}
break;
case 'l' - 'a' + 1: /* control-l */
@ -801,19 +983,24 @@ dialog_input (dialog_t diag, int alt, int chr)
break;
}
if (old_loc < diag->pin_loc)
{
move (diag->pin_y, diag->pin_x + old_loc);
while (old_loc++ < diag->pin_loc)
addch ('*');
}
else if (old_loc > diag->pin_loc)
diag->got_input = 1;
if (!diag->no_echo)
{
if (old_loc < diag->pin_loc)
{
move (diag->pin_y, diag->pin_x + old_loc);
while (old_loc++ < diag->pin_loc)
addch ('*');
}
else if (old_loc > diag->pin_loc)
{
move (diag->pin_y, diag->pin_x + diag->pin_loc);
while (old_loc-- > diag->pin_loc)
addch ('_');
}
move (diag->pin_y, diag->pin_x + diag->pin_loc);
while (old_loc-- > diag->pin_loc)
addch ('_');
}
move (diag->pin_y, diag->pin_x + diag->pin_loc);
}
static int
@ -851,6 +1038,9 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type)
{
pinentry->specific_err = gpg_error_from_syserror ();
pinentry->specific_err_loc = "open_tty_for_read";
#ifdef HAVE_NCURSESW
free (old_ctype);
#endif
return confirm_mode? 0 : -1;
}
ttyfo = fopen (tty_name, "w");
@ -861,9 +1051,23 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type)
errno = err;
pinentry->specific_err = gpg_error_from_syserror ();
pinentry->specific_err_loc = "open_tty_for_write";
#ifdef HAVE_NCURSESW
free (old_ctype);
#endif
return confirm_mode? 0 : -1;
}
screen = newterm (tty_type, ttyfo, ttyfi);
if (!screen)
{
pinentry->specific_err = gpg_error (GPG_ERR_WINDOW_TOO_SMALL);
pinentry->specific_err_loc = "curses_init";
fclose (ttyfo);
fclose (ttyfi);
#ifdef HAVE_NCURSESW
free (old_ctype);
#endif
return confirm_mode? 0 : -1;
}
set_term (screen);
}
else
@ -875,6 +1079,9 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type)
errno = ENOTTY;
pinentry->specific_err = gpg_error_from_syserror ();
pinentry->specific_err_loc = "isatty";
#ifdef HAVE_NCURSESW
free (old_ctype);
#endif
return confirm_mode? 0 : -1;
}
init_screen = 1;
@ -900,8 +1107,17 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type)
if (has_colors ())
{
start_color ();
/* Ncurses has use_default_colors, an extentions to the curses
library, which allows use of -1 to select default color. */
#ifdef NCURSES_VERSION
use_default_colors ();
#else
/* With no extention, we need to specify color explicitly. */
if (pinentry->color_fg == PINENTRY_COLOR_DEFAULT)
pinentry->color_fg = PINENTRY_COLOR_WHITE;
if (pinentry->color_bg == PINENTRY_COLOR_DEFAULT)
pinentry->color_bg = PINENTRY_COLOR_BLACK;
#endif
if (pinentry->color_so == PINENTRY_COLOR_DEFAULT)
@ -1188,7 +1404,7 @@ curses_cmd_handler (pinentry_t pinentry)
}
#endif
rc = dialog_run (pinentry, pinentry->ttyname, pinentry->ttytype);
rc = dialog_run (pinentry, pinentry->ttyname, pinentry->ttytype_l);
do_touch_file (pinentry);
return rc;
}

@ -498,7 +498,7 @@ set_labels (pinentry_t pe)
set_label (pe, "SETOK", pe->default_ok);
if (pe->cancel)
set_label (pe, "SETCANCEL", pe->cancel);
else if (pe->default_ok)
else if (pe->default_cancel)
set_label (pe, "SETCANCEL", pe->default_cancel);
if (pe->notok)
set_label (pe, "SETNOTOK", pe->notok);
@ -680,6 +680,22 @@ pinentry_enable_emacs_cmd_handler (void)
pinentry_cmd_handler = initial_emacs_cmd_handler;
}
/* Returns true if the Emacs pinentry is enabled. The value is 1
* before the first connection with Emacs has been done and 2 if the
* connection to Emacs has been establish. Returns false if the Emacs
* pinentry is not enabled. */
int
pinentry_emacs_status (void)
{
if (pinentry_cmd_handler == initial_emacs_cmd_handler)
return 1;
else if (pinentry_cmd_handler == emacs_cmd_handler)
return 2;
else
return 0;
}
int
pinentry_emacs_init (void)
{

@ -32,6 +32,9 @@ extern "C" {
receiving an Assuan request "OPTION allow-emacs-prompt". */
void pinentry_enable_emacs_cmd_handler (void);
/* Return info on whether emacs support is enabled. */
int pinentry_emacs_status (void);
/* Initialize the Emacs interface, return true if success. */
int pinentry_emacs_init (void);

@ -1,5 +1,5 @@
/* pinentry.c - The PIN entry support library
* Copyright (C) 2002, 2003, 2007, 2008, 2010, 2015, 2016 g10 Code GmbH
* Copyright (C) 2002, 2003, 2007, 2008, 2010, 2015, 2016, 2021 g10 Code GmbH
*
* This file is part of PINENTRY.
*
@ -27,6 +27,8 @@
#endif
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <assert.h>
#ifndef HAVE_W32_SYSTEM
@ -35,20 +37,11 @@
#ifndef HAVE_W32CE_SYSTEM
# include <locale.h>
#endif
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif
#include <limits.h>
#ifdef HAVE_W32CE_SYSTEM
# include <windows.h>
#endif
#undef WITH_UTF8_CONVERSION
#if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK
# include <iconv.h>
# define WITH_UTF8_CONVERSION 1
#endif
#include <assuan.h>
#include "memory.h"
@ -79,17 +72,11 @@ static const char *flavor_flag;
/* Because gtk_init removes the --display arg from the command lines
* and our command line parser is called after gtk_init (so that it
* does not see gtk specific options) we don't have a way to get hold
* of the --display option. Our solution is to remember --disable in
* of the --display option. Our solution is to remember --display in
* the call to pinentry_have_display and set it then in our
* parser. */
static char *remember_display;
/* Flag to remember whether a warning has been printed. */
#ifdef WITH_UTF8_CONVERSION
static int lc_ctype_unknown_warning;
#endif
static void
pinentry_reset (int use_defaults)
{
@ -97,7 +84,7 @@ pinentry_reset (int use_defaults)
Don't reset them. */
int grab = pinentry.grab;
char *ttyname = pinentry.ttyname;
char *ttytype = pinentry.ttytype;
char *ttytype = pinentry.ttytype_l;
char *ttyalert = pinentry.ttyalert;
char *lc_ctype = pinentry.lc_ctype;
char *lc_messages = pinentry.lc_messages;
@ -109,10 +96,15 @@ pinentry_reset (int use_defaults)
char *default_cf_visi = pinentry.default_cf_visi;
char *default_tt_visi = pinentry.default_tt_visi;
char *default_tt_hide = pinentry.default_tt_hide;
char *default_capshint = pinentry.default_capshint;
char *touch_file = pinentry.touch_file;
unsigned long owner_pid = pinentry.owner_pid;
int owner_uid = pinentry.owner_uid;
char *owner_host = pinentry.owner_host;
int constraints_enforce = pinentry.constraints_enforce;
char *constraints_hint_short = pinentry.constraints_hint_short;
char *constraints_hint_long = pinentry.constraints_hint_long;
char *constraints_error_title = pinentry.constraints_error_title;
/* These options are set from the command line. Don't reset
them. */
@ -135,7 +127,7 @@ pinentry_reset (int use_defaults)
if (use_defaults)
{
free (pinentry.ttyname);
free (pinentry.ttytype);
free (pinentry.ttytype_l);
free (pinentry.ttyalert);
free (pinentry.lc_ctype);
free (pinentry.lc_messages);
@ -146,9 +138,13 @@ pinentry_reset (int use_defaults)
free (pinentry.default_cf_visi);
free (pinentry.default_tt_visi);
free (pinentry.default_tt_hide);
free (pinentry.default_capshint);
free (pinentry.touch_file);
free (pinentry.owner_host);
free (pinentry.display);
free (pinentry.constraints_hint_short);
free (pinentry.constraints_hint_long);
free (pinentry.constraints_error_title);
}
free (pinentry.title);
@ -163,6 +159,7 @@ pinentry_reset (int use_defaults)
free (pinentry.repeat_error_string);
free (pinentry.quality_bar);
free (pinentry.quality_bar_tt);
free (pinentry.formatted_passphrase_hint);
free (pinentry.keyinfo);
free (pinentry.specific_err_info);
@ -194,7 +191,7 @@ pinentry_reset (int use_defaults)
{
pinentry.grab = grab;
pinentry.ttyname = ttyname;
pinentry.ttytype = ttytype;
pinentry.ttytype_l = ttytype;
pinentry.ttyalert = ttyalert;
pinentry.lc_ctype = lc_ctype;
pinentry.lc_messages = lc_messages;
@ -206,10 +203,15 @@ pinentry_reset (int use_defaults)
pinentry.default_cf_visi = default_cf_visi;
pinentry.default_tt_visi = default_tt_visi;
pinentry.default_tt_hide = default_tt_hide;
pinentry.default_capshint = default_capshint;
pinentry.touch_file = touch_file;
pinentry.owner_pid = owner_pid;
pinentry.owner_uid = owner_uid;
pinentry.owner_host = owner_host;
pinentry.constraints_enforce = constraints_enforce;
pinentry.constraints_hint_short = constraints_hint_short;
pinentry.constraints_hint_long = constraints_hint_long;
pinentry.constraints_error_title = constraints_error_title;
pinentry.debug = debug;
pinentry.display = display;
@ -238,150 +240,6 @@ pinentry_assuan_reset_handler (assuan_context_t ctx, char *line)
#ifdef WITH_UTF8_CONVERSION
char *
pinentry_utf8_to_local (const char *lc_ctype, const char *text)
{
iconv_t cd;
const char *input = text;
size_t input_len = strlen (text) + 1;
char *output;
size_t output_len;
char *output_buf;
size_t processed;
char *old_ctype;
char *target_encoding;
/* If no locale setting could be determined, simply copy the
string. */
if (!lc_ctype)
{
if (! lc_ctype_unknown_warning)
{
fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
this_pgmname);
lc_ctype_unknown_warning = 1;
}
return strdup (text);
}
old_ctype = strdup (setlocale (LC_CTYPE, NULL));
if (!old_ctype)
return NULL;
setlocale (LC_CTYPE, lc_ctype);
target_encoding = nl_langinfo (CODESET);
if (!target_encoding)
target_encoding = "?";
setlocale (LC_CTYPE, old_ctype);
free (old_ctype);
/* This is overkill, but simplifies the iconv invocation greatly. */
output_len = input_len * MB_LEN_MAX;
output_buf = output = malloc (output_len);
if (!output)
return NULL;
cd = iconv_open (target_encoding, "UTF-8");
if (cd == (iconv_t) -1)
{
fprintf (stderr, "%s: can't convert from UTF-8 to %s: %s\n",
this_pgmname, target_encoding, strerror (errno));
free (output_buf);
return NULL;
}
processed = iconv (cd, (ICONV_CONST char **)&input, &input_len,
&output, &output_len);
iconv_close (cd);
if (processed == (size_t) -1 || input_len)
{
fprintf (stderr, "%s: error converting from UTF-8 to %s: %s\n",
this_pgmname, target_encoding, strerror (errno));
free (output_buf);
return NULL;
}
return output_buf;
}
#endif /*WITH_UTF8_CONVERSION*/
/* Convert TEXT which is encoded according to LC_CTYPE to UTF-8. With
SECURE set to true, use secure memory for the returned buffer.
Return NULL on error. */
#ifdef WITH_UTF8_CONVERSION
char *
pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure)
{
char *old_ctype;
char *source_encoding;
iconv_t cd;
const char *input = text;
size_t input_len = strlen (text) + 1;
char *output;
size_t output_len;
char *output_buf;
size_t processed;
/* If no locale setting could be determined, simply copy the
string. */
if (!lc_ctype)
{
if (! lc_ctype_unknown_warning)
{
fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n",
this_pgmname);
lc_ctype_unknown_warning = 1;
}
output_buf = secure? secmem_malloc (input_len) : malloc (input_len);
if (output_buf)
strcpy (output_buf, input);
return output_buf;
}
old_ctype = strdup (setlocale (LC_CTYPE, NULL));
if (!old_ctype)
return NULL;
setlocale (LC_CTYPE, lc_ctype);
source_encoding = nl_langinfo (CODESET);
setlocale (LC_CTYPE, old_ctype);
free (old_ctype);
/* This is overkill, but simplifies the iconv invocation greatly. */
output_len = input_len * MB_LEN_MAX;
output_buf = output = secure? secmem_malloc (output_len):malloc (output_len);
if (!output)
return NULL;
cd = iconv_open ("UTF-8", source_encoding);
if (cd == (iconv_t) -1)
{
fprintf (stderr, "%s: can't convert from %s to UTF-8: %s\n",
this_pgmname, source_encoding? source_encoding : "?",
strerror (errno));
if (secure)
secmem_free (output_buf);
else
free (output_buf);
return NULL;
}
processed = iconv (cd, (ICONV_CONST char **)&input, &input_len,
&output, &output_len);
iconv_close (cd);
if (processed == (size_t) -1 || input_len)
{
fprintf (stderr, "%s: error converting from %s to UTF-8: %s\n",
this_pgmname, source_encoding? source_encoding : "?",
strerror (errno));
if (secure)
secmem_free (output_buf);
else
free (output_buf);
return NULL;
}
return output_buf;
}
#endif /*WITH_UTF8_CONVERSION*/
/* Copy TEXT or TEXTLEN to BUFFER and escape as required. Return a
pointer to the end of the new buffer. Note that BUFFER must be
large enough to keep the entire text; allocataing it 3 times of
@ -409,6 +267,32 @@ copy_and_escape (char *buffer, const void *text, size_t textlen)
}
/* Perform percent unescaping in STRING and return the new valid length
of the string. A terminating Nul character is inserted at the end of
the unescaped string.
*/
static size_t
do_unescape_inplace (char *s)
{
unsigned char *p, *p0;
p = p0 = s;
while (*s)
{
if (*s == '%' && s[1] && s[2])
{
s++;
*p++ = xtoi_2 (s);
s += 2;
}
else
*p++ = *s++;
}
*p = 0;
return (p - p0);
}
/* Return a malloced copy of the commandline for PID. If this is not
* possible NULL is returned. */
@ -421,7 +305,6 @@ get_cmdline (unsigned long pid)
size_t i, n;
snprintf (buffer, sizeof buffer, "/proc/%lu/cmdline", pid);
buffer[sizeof buffer - 1] = 0;
fp = fopen (buffer, "rb");
if (!fp)
@ -467,7 +350,6 @@ get_pid_name_for_uid (unsigned long pid, int uid)
char *uidstr;
snprintf (buffer, sizeof buffer, "/proc/%lu/status", pid);
buffer[sizeof buffer - 1] = 0;
fp = fopen (buffer, "rb");
if (!fp)
@ -482,6 +364,7 @@ get_pid_name_for_uid (unsigned long pid, int uid)
fclose (fp);
if (n == 0)
return NULL;
buffer[n] = 0;
/* Fixme: Is it specified that "Name" is always the first line? For
* robustness I would prefer to have a real parser here. -wk */
if (strncmp (buffer, "Name:\t", 6))
@ -501,6 +384,13 @@ get_pid_name_for_uid (unsigned long pid, int uid)
#endif /*!HAVE_W32_SYSTEM*/
const char *
pinentry_get_pgmname (void)
{
return this_pgmname;
}
/* Return a malloced string with the title. The caller mus free the
* string. If no title is available or the title string has an error
* NULL is returned. */
@ -520,7 +410,7 @@ pinentry_get_title (pinentry_t pe)
char *cmdline = NULL;
if (pe->owner_host &&
!uname (&utsbuf) && utsbuf.nodename &&
!uname (&utsbuf) &&
!strcmp (utsbuf.nodename, pe->owner_host))
{
pidname = get_pid_name_for_uid (pe->owner_pid, pe->owner_uid);
@ -537,7 +427,6 @@ pinentry_get_title (pinentry_t pe)
else
snprintf (buf, sizeof buf, "[%lu] <unknown host>",
pe->owner_pid);
buf[sizeof buf - 1] = 0;
free (pidname);
free (cmdline);
title = strdup (buf);
@ -625,6 +514,122 @@ pinentry_inq_quality (pinentry_t pin, const char *passphrase, size_t length)
}
/* Run a checkpin inquiry */
char *
pinentry_inq_checkpin (pinentry_t pin, const char *passphrase, size_t length)
{
assuan_context_t ctx = pin->ctx_assuan;
const char prefix[] = "INQUIRE CHECKPIN ";
char *command;
char *line;
size_t linelen;
int gotvalue = 0;
char *value = NULL;
int rc;
if (!ctx)
return 0; /* Can't run the callback. */
if (length > 300)
length = 300; /* Limit so that it definitely fits into an Assuan
line. */
command = secmem_malloc (strlen (prefix) + 3*length + 1);
if (!command)
return 0;
strcpy (command, prefix);
copy_and_escape (command + strlen(command), passphrase, length);
rc = assuan_write_line (ctx, command);
secmem_free (command);
if (rc)
{
fprintf (stderr, "ASSUAN WRITE LINE failed: rc=%d\n", rc);
return 0;
}
for (;;)
{
do
{
rc = assuan_read_line (ctx, &line, &linelen);
if (rc)
{
fprintf (stderr, "ASSUAN READ LINE failed: rc=%d\n", rc);
return 0;
}
}
while (*line == '#' || !linelen);
if (line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
&& (!line[3] || line[3] == ' '))
break; /* END command received*/
if (line[0] == 'C' && line[1] == 'A' && line[2] == 'N'
&& (!line[3] || line[3] == ' '))
break; /* CAN command received*/
if (line[0] == 'E' && line[1] == 'R' && line[2] == 'R'
&& (!line[3] || line[3] == ' '))
break; /* ERR command received*/
if (line[0] != 'D' || line[1] != ' ' || linelen < 3 || gotvalue)
continue;
gotvalue = 1;
value = strdup (line + 2);
}
return value;
}
/* Run a genpin inquiry */
char *
pinentry_inq_genpin (pinentry_t pin)
{
assuan_context_t ctx = pin->ctx_assuan;
const char prefix[] = "INQUIRE GENPIN";
char *line;
size_t linelen;
int gotvalue = 0;
char *value = NULL;
int rc;
if (!ctx)
return 0; /* Can't run the callback. */
rc = assuan_write_line (ctx, prefix);
if (rc)
{
fprintf (stderr, "ASSUAN WRITE LINE failed: rc=%d\n", rc);
return 0;
}
for (;;)
{
do
{
rc = assuan_read_line (ctx, &line, &linelen);
if (rc)
{
fprintf (stderr, "ASSUAN READ LINE failed: rc=%d\n", rc);
free (value);
return 0;
}
}
while (*line == '#' || !linelen);
if (line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
&& (!line[3] || line[3] == ' '))
break; /* END command received*/
if (line[0] == 'C' && line[1] == 'A' && line[2] == 'N'
&& (!line[3] || line[3] == ' '))
break; /* CAN command received*/
if (line[0] == 'E' && line[1] == 'R' && line[2] == 'R'
&& (!line[3] || line[3] == ' '))
break; /* ERR command received*/
if (line[0] != 'D' || line[1] != ' ' || linelen < 3 || gotvalue)
continue;
gotvalue = 1;
value = strdup (line + 2);
}
return value;
}
/* Try to make room for at least LEN bytes in the pinentry. Returns
new buffer on success and 0 on failure or when the old buffer is
@ -819,7 +824,6 @@ my_strusage( int level )
{
snprintf (str, n, "Usage: %s [options] (-h for help)",
this_pgmname);
str[n-1] = 0;
}
}
p = str;
@ -950,8 +954,8 @@ pinentry_parse_opts (int argc, char *argv[])
}
break;
case 'N':
pinentry.ttytype = strdup (pargs.r.ret_str);
if (!pinentry.ttytype)
pinentry.ttytype_l = strdup (pargs.r.ret_str);
if (!pinentry.ttytype_l)
{
#ifndef HAVE_W32CE_SYSTEM
fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno));
@ -1070,10 +1074,10 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
}
else if (!strcmp (key, "ttytype"))
{
if (pinentry.ttytype)
free (pinentry.ttytype);
pinentry.ttytype = strdup (value);
if (!pinentry.ttytype)
if (pinentry.ttytype_l)
free (pinentry.ttytype_l);
pinentry.ttytype_l = strdup (value);
if (!pinentry.ttytype_l)
return gpg_error_from_syserror ();
}
else if (!strcmp (key, "ttyalert"))
@ -1195,6 +1199,12 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
if (!pinentry.default_tt_hide)
return gpg_error_from_syserror ();
}
else if (!strcmp (key, "default-capshint"))
{
pinentry.default_capshint = strdup (value);
if (!pinentry.default_capshint)
return gpg_error_from_syserror ();
}
else if (!strcmp (key, "allow-external-password-cache") && !*value)
{
pinentry.allow_external_password_cache = 1;
@ -1214,6 +1224,48 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
if (!pinentry.invisible_char)
return gpg_error_from_syserror ();
}
else if (!strcmp (key, "formatted-passphrase") && !*value)
{
pinentry.formatted_passphrase = 1;
}
else if (!strcmp (key, "formatted-passphrase-hint"))
{
if (pinentry.formatted_passphrase_hint)
free (pinentry.formatted_passphrase_hint);
pinentry.formatted_passphrase_hint = strdup (value);
if (!pinentry.formatted_passphrase_hint)
return gpg_error_from_syserror ();
do_unescape_inplace(pinentry.formatted_passphrase_hint);
}
else if (!strcmp (key, "constraints-enforce") && !*value)
pinentry.constraints_enforce = 1;
else if (!strcmp (key, "constraints-hint-short"))
{
if (pinentry.constraints_hint_short)
free (pinentry.constraints_hint_short);
pinentry.constraints_hint_short = strdup (value);
if (!pinentry.constraints_hint_short)
return gpg_error_from_syserror ();
do_unescape_inplace(pinentry.constraints_hint_short);
}
else if (!strcmp (key, "constraints-hint-long"))
{
if (pinentry.constraints_hint_long)
free (pinentry.constraints_hint_long);
pinentry.constraints_hint_long = strdup (value);
if (!pinentry.constraints_hint_long)
return gpg_error_from_syserror ();
do_unescape_inplace(pinentry.constraints_hint_long);
}
else if (!strcmp (key, "constraints-error-title"))
{
if (pinentry.constraints_error_title)
free (pinentry.constraints_error_title);
pinentry.constraints_error_title = strdup (value);
if (!pinentry.constraints_error_title)
return gpg_error_from_syserror ();
do_unescape_inplace(pinentry.constraints_error_title);
}
else
return gpg_error (GPG_ERR_UNKNOWN_OPTION);
return 0;
@ -1257,7 +1309,6 @@ write_status_error (assuan_context_t ctx, pinentry_t pe)
pe->specific_err_loc? pe->specific_err_loc : "?",
pe->specific_err,
pe->specific_err_info? pe->specific_err_info : "");
buf[sizeof buf -1] = 0;
assuan_write_status (ctx, "ERROR", buf);
}
@ -1507,6 +1558,53 @@ cmd_setqualitybar_tt (assuan_context_t ctx, char *line)
return 0;
}
/* Set the tooltip to be used for a generate action. */
static gpg_error_t
cmd_setgenpin_tt (assuan_context_t ctx, char *line)
{
char *newval;
(void)ctx;
if (*line)
{
newval = malloc (strlen (line) + 1);
if (!newval)
return gpg_error_from_syserror ();
strcpy_escaped (newval, line);
}
else
newval = NULL;
if (pinentry.genpin_tt)
free (pinentry.genpin_tt);
pinentry.genpin_tt = newval;
return 0;
}
/* Set the label to be used for a generate action. */
static gpg_error_t
cmd_setgenpin_label (assuan_context_t ctx, char *line)
{
char *newval;
(void)ctx;
if (*line)
{
newval = malloc (strlen (line) + 1);
if (!newval)
return gpg_error_from_syserror ();
strcpy_escaped (newval, line);
}
else
newval = NULL;
if (pinentry.genpin_label)
free (pinentry.genpin_label);
pinentry.genpin_label = newval;
return 0;
}
static gpg_error_t
cmd_getpin (assuan_context_t ctx, char *line)
@ -1613,6 +1711,10 @@ cmd_getpin (assuan_context_t ctx, char *line)
if (pinentry.specific_err)
{
write_status_error (ctx, &pinentry);
if (gpg_err_code (pinentry.specific_err) == GPG_ERR_FULLY_CANCELED)
assuan_set_flag (ctx, ASSUAN_FORCE_CLOSE, 1);
return pinentry.specific_err;
}
return (pinentry.locale_err
@ -1625,9 +1727,11 @@ cmd_getpin (assuan_context_t ctx, char *line)
{
if (pinentry.repeat_okay)
assuan_write_status (ctx, "PIN_REPEATED", "");
assuan_begin_confidential (ctx);
result = assuan_send_data (ctx, pinentry.pin, strlen(pinentry.pin));
if (!result)
result = assuan_send_data (ctx, NULL, 0);
assuan_end_confidential (ctx);
if (/* GPG Agent says it's okay. */
pinentry.allow_external_password_cache && pinentry.keyinfo
@ -1683,6 +1787,10 @@ cmd_confirm (assuan_context_t ctx, char *line)
if (pinentry.specific_err)
{
write_status_error (ctx, &pinentry);
if (gpg_err_code (pinentry.specific_err) == GPG_ERR_FULLY_CANCELED)
assuan_set_flag (ctx, ASSUAN_FORCE_CLOSE, 1);
return pinentry.specific_err;
}
@ -1706,6 +1814,33 @@ cmd_message (assuan_context_t ctx, char *line)
return cmd_confirm (ctx, "--one-button");
}
/* Return a staically allocated string with information on the mode,
* uid, and gid of DEVICE. On error "?" is returned if DEVICE is
* NULL, "-" is returned. */
static const char *
device_stat_string (const char *device)
{
#ifdef HAVE_STAT
static char buf[40];
struct stat st;
if (!device || !*device)
return "-";
if (stat (device, &st))
return "?"; /* Error */
snprintf (buf, sizeof buf, "%lo/%lu/%lu",
(unsigned long)st.st_mode,
(unsigned long)st.st_uid,
(unsigned long)st.st_gid);
return buf;
#else
return "-";
#endif
}
/* GETINFO <what>
Multipurpose function to return a variety of information.
@ -1714,14 +1849,14 @@ cmd_message (assuan_context_t ctx, char *line)
version - Return the version of the program.
pid - Return the process id of the server.
flavor - Return information about the used pinentry flavor
ttyinfo - Return DISPLAY and ttyinfo.
ttyinfo - Return DISPLAY, ttyinfo and an emacs pinentry status
*/
static gpg_error_t
cmd_getinfo (assuan_context_t ctx, char *line)
{
int rc;
const char *s;
char buffer[100];
char buffer[150];
if (!strcmp (line, "version"))
{
@ -1732,7 +1867,6 @@ cmd_getinfo (assuan_context_t ctx, char *line)
{
snprintf (buffer, sizeof buffer, "%lu", (unsigned long)getpid ());
buffer[sizeof buffer -1] = 0;
rc = assuan_send_data (ctx, buffer, strlen (buffer));
}
else if (!strcmp (line, "flavor"))
@ -1746,18 +1880,31 @@ cmd_getinfo (assuan_context_t ctx, char *line)
s,
flavor_flag? ":":"",
flavor_flag? flavor_flag : "");
buffer[sizeof buffer -1] = 0;
rc = assuan_send_data (ctx, buffer, strlen (buffer));
/* if (!rc) */
/* rc = assuan_write_status (ctx, "FEATURES", "tabbing foo bar"); */
}
else if (!strcmp (line, "ttyinfo"))
{
snprintf (buffer, sizeof buffer, "%s %s %s",
char emacs_status[10];
#ifdef INSIDE_EMACS
snprintf (emacs_status, sizeof emacs_status,
"%d", pinentry_emacs_status ());
#else
strcpy (emacs_status, "-");
#endif
snprintf (buffer, sizeof buffer, "%s %s %s %s %lu/%lu %s",
pinentry.ttyname? pinentry.ttyname : "-",
pinentry.ttytype? pinentry.ttytype : "-",
pinentry.display? pinentry.display : "-" );
buffer[sizeof buffer -1] = 0;
pinentry.ttytype_l? pinentry.ttytype_l : "-",
pinentry.display? pinentry.display : "-",
device_stat_string (pinentry.ttyname),
#ifdef HAVE_DOSISH_SYSTEM
0l, 0l,
#else
(unsigned long)geteuid (), (unsigned long)getegid (),
#endif
emacs_status
);
rc = assuan_send_data (ctx, buffer, strlen (buffer));
}
else
@ -1816,6 +1963,8 @@ register_commands (assuan_context_t ctx)
{ "MESSAGE", cmd_message },
{ "SETQUALITYBAR", cmd_setqualitybar },
{ "SETQUALITYBAR_TT", cmd_setqualitybar_tt },
{ "SETGENPIN", cmd_setgenpin_label },
{ "SETGENPIN_TT", cmd_setgenpin_tt },
{ "GETINFO", cmd_getinfo },
{ "SETTITLE", cmd_settitle },
{ "SETTIMEOUT", cmd_settimeout },

@ -1,5 +1,5 @@
/* pinentry.h - The interface for the PIN entry support library.
* Copyright (C) 2002, 2003, 2010, 2015 g10 Code GmbH
* Copyright (C) 2002, 2003, 2010, 2015, 2021 g10 Code GmbH
*
* This file is part of PINENTRY.
*
@ -75,7 +75,7 @@ struct pinentry
supported. (Assuan: "OPTION ttyname TTYNAME".) */
char *ttyname;
/* The type of the terminal. (Assuan: "OPTION ttytype TTYTYPE".) */
char *ttytype;
char *ttytype_l;
/* Set the alert mode (none, beep or flash). */
char *ttyalert;
/* The LC_CTYPE value for the terminal. (Assuan: "OPTION lc-ctype
@ -170,10 +170,29 @@ struct pinentry
"SETQUALITYBAR LABEL".) */
char *quality_bar;
/* The tooltip to be show for the qualitybar. Malloced or NULL.
/* The tooltip to be shown for the qualitybar. Malloced or NULL.
(Assuan: "SETQUALITYBAR_TT TOOLTIP".) */
char *quality_bar_tt;
/* If this is not NULL, a generate action should be shown.
There will be an inquiry back to the caller to get such a
PIN. generate action. Malloced or NULL.
(Assuan: "SETGENPIN LABEL" .) */
char *genpin_label;
/* The tooltip to be shown for the generate action. Malloced or NULL.
(Assuan: "SETGENPIN_TT TOOLTIP".) */
char *genpin_tt;
/* Specifies whether passphrase formatting should be enabled.
(Assuan: "OPTION formatted-passphrase") */
int formatted_passphrase;
/* A hint to be shown near the passphrase input field if passphrase
formatting is enabled. Malloced or NULL.
(Assuan: "OPTION formatted-passphrase-hint=HINT".) */
char *formatted_passphrase_hint;
/* For the curses pinentry, the color of error messages. */
pinentry_color_t color_fg;
int color_fg_bright;
@ -202,6 +221,9 @@ struct pinentry
/* (Assuan: "OPTION default-tt-hide
Hide passphrase"). */
char *default_tt_hide;
/* (Assuan: "OPTION default-capshint
Caps Lock is on"). */
char *default_capshint;
/* Whether we are allowed to read the password from an external
cache. (Assuan: "OPTION allow-external-password-cache") */
@ -220,8 +242,8 @@ struct pinentry
/* NOTE: If you add any additional fields to this structure, be sure
to update the initializer in pinentry/pinentry.c!!! */
/* For the quality indicator we need to do an inquiry. Thus we need
to save the assuan ctx. */
/* For the quality indicator and genpin we need to do an inquiry.
Thus we need to save the assuan ctx. */
void *ctx_assuan;
/* An UTF-8 string with an invisible character used to override the
@ -229,6 +251,26 @@ struct pinentry
used. */
char *invisible_char;
/* Whether the passphrase constraints are enforced by gpg-agent.
(Assuan: "OPTION constraints-enforce") */
int constraints_enforce;
/* A short translated hint for the user with the constraints for new
passphrases to be displayed near the passphrase input field.
Malloced or NULL.
(Assuan: "OPTION constraints-hint-short=At least 8 characters".) */
char *constraints_hint_short;
/* A longer translated hint for the user with the constraints for new
passphrases to be displayed for example as tooltip. Malloced or NULL.
(Assuan: "OPTION constraints-hint-long=The passphrase must ...".) */
char *constraints_hint_long;
/* A short translated title for an error dialog informing the user about
unsatisfied passphrase constraints. Malloced or NULL.
(Assuan: "OPTION constraints-error-title=Passphrase Not Allowed".) */
char *constraints_error_title;
};
typedef struct pinentry *pinentry_t;
@ -253,15 +295,7 @@ int pinentry_loop (void);
*/
int pinentry_loop2 (int infd, int outfd);
/* Convert the UTF-8 encoded string TEXT to the encoding given in
LC_CTYPE. Return NULL on error. */
char *pinentry_utf8_to_local (const char *lc_ctype, const char *text);
/* Convert TEXT which is encoded according to LC_CTYPE to UTF-8. With
SECURE set to true, use secure memory for the returned buffer.
Return NULL on error. */
char *pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure);
const char *pinentry_get_pgmname (void);
char *pinentry_get_title (pinentry_t pe);
@ -269,6 +303,15 @@ char *pinentry_get_title (pinentry_t pe);
int pinentry_inq_quality (pinentry_t pin,
const char *passphrase, size_t length);
/* Run a checkpin inquiry for PASSPHRASE of LENGTH. Returns NULL, if the
passphrase satisfies the constraints. Otherwise, returns a malloced error
string. */
char *pinentry_inq_checkpin (pinentry_t pin,
const char *passphrase, size_t length);
/* Run a genpin iquriry. Returns a malloced string or NULL */
char *pinentry_inq_genpin (pinentry_t pin);
/* Try to make room for at least LEN bytes for the pin in the pinentry
PIN. Returns new buffer on success and 0 on failure. */
char *pinentry_setbufferlen (pinentry_t pin, int len);

@ -0,0 +1,75 @@
# Makefile.am
# Copyright (C) 2002 g10 Code GmbH, Klarälvdalens Datakonsult AB
# Copyright (C) 2008, 2015 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, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0+
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = pinentry-qt
EXTRA_DIST = pinentryrc.qrc
SUBDIRS = icons
if FALLBACK_CURSES
ncurses_include = $(NCURSES_INCLUDE)
libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV)
else
ncurses_include =
libcurses =
endif
AM_CPPFLAGS = $(COMMON_CFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)/secmem \
$(ncurses_include) -I$(top_srcdir)/pinentry
AM_CXXFLAGS = $(PINENTRY_QT_CFLAGS)
pinentry_qt_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_QT_LIBS) $(libcurses)
pinentry_qt_LDFLAGS = $(PINENTRY_QT_LDFLAGS)
if BUILD_PINENTRY_QT
BUILT_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc \
pinentryrc.cpp
endif
CLEANFILES = $(BUILT_SOURCES)
if HAVE_W32_SYSTEM
pinentry_qt_platform_SOURCES = capslock_win.cpp
else
pinentry_qt_platform_SOURCES = capslock_unix.cpp
endif
pinentry_qt_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp pinentryconfirm.cpp pinentryconfirm.h \
pinlineedit.h pinlineedit.cpp capslock.cpp capslock.h capslock_p.h \
pinentry_debug.cpp pinentry_debug.h util.h accessibility.cpp \
accessibility.h qti18n.cpp pinentryrc.qrc \
$(pinentry_qt_platform_SOURCES)
nodist_pinentry_qt_SOURCES = $(BUILT_SOURCES)
.h.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
pinentryrc.cpp: pinentryrc.qrc
$(RCC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

@ -0,0 +1,902 @@
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am
# Copyright (C) 2002 g10 Code GmbH, Klarälvdalens Datakonsult AB
# Copyright (C) 2008, 2015 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, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-qt$(EXEEXT)
subdir = qt
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am__pinentry_qt_SOURCES_DIST = pinentrydialog.h pinentrydialog.cpp \
main.cpp pinentryconfirm.cpp pinentryconfirm.h pinlineedit.h \
pinlineedit.cpp capslock.cpp capslock.h capslock_p.h \
pinentry_debug.cpp pinentry_debug.h util.h accessibility.cpp \
accessibility.h qti18n.cpp pinentryrc.qrc capslock_unix.cpp \
capslock_win.cpp
@HAVE_W32_SYSTEM_FALSE@am__objects_1 = capslock_unix.$(OBJEXT)
@HAVE_W32_SYSTEM_TRUE@am__objects_1 = capslock_win.$(OBJEXT)
am_pinentry_qt_OBJECTS = pinentrydialog.$(OBJEXT) main.$(OBJEXT) \
pinentryconfirm.$(OBJEXT) pinlineedit.$(OBJEXT) \
capslock.$(OBJEXT) pinentry_debug.$(OBJEXT) \
accessibility.$(OBJEXT) qti18n.$(OBJEXT) $(am__objects_1)
@BUILD_PINENTRY_QT_TRUE@am__objects_2 = pinentryrc.$(OBJEXT)
nodist_pinentry_qt_OBJECTS = $(am__objects_2)
pinentry_qt_OBJECTS = $(am_pinentry_qt_OBJECTS) \
$(nodist_pinentry_qt_OBJECTS)
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_qt_DEPENDENCIES = ../pinentry/libpinentry.a \
$(top_builddir)/secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
pinentry_qt_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(pinentry_qt_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/accessibility.Po \
./$(DEPDIR)/capslock.Po ./$(DEPDIR)/capslock_unix.Po \
./$(DEPDIR)/capslock_win.Po ./$(DEPDIR)/main.Po \
./$(DEPDIR)/pinentry_debug.Po ./$(DEPDIR)/pinentryconfirm.Po \
./$(DEPDIR)/pinentrydialog.Po ./$(DEPDIR)/pinentryrc.Po \
./$(DEPDIR)/pinlineedit.Po ./$(DEPDIR)/qti18n.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
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 =
SOURCES = $(pinentry_qt_SOURCES) $(nodist_pinentry_qt_SOURCES)
DIST_SOURCES = $(am__pinentry_qt_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_CFLAGS = @COMMON_CFLAGS@
COMMON_LIBS = @COMMON_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
FLTKCXXFLAGS = @FLTKCXXFLAGS@
FLTKLIBS = @FLTKLIBS@
FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
GPG_ERROR_MT_CFLAGS = @GPG_ERROR_MT_CFLAGS@
GPG_ERROR_MT_LIBS = @GPG_ERROR_MT_LIBS@
GREP = @GREP@
GTK2_CFLAGS = @GTK2_CFLAGS@
GTK2_LIBS = @GTK2_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TQT_MOC = @TQT_MOC@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = pinentryrc.qrc
SUBDIRS = icons
@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) \
-I$(top_srcdir) -I$(top_srcdir)/secmem \
$(ncurses_include) -I$(top_srcdir)/pinentry
AM_CXXFLAGS = $(PINENTRY_QT_CFLAGS)
pinentry_qt_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_QT_LIBS) $(libcurses)
pinentry_qt_LDFLAGS = $(PINENTRY_QT_LDFLAGS)
@BUILD_PINENTRY_QT_TRUE@BUILT_SOURCES = \
@BUILD_PINENTRY_QT_TRUE@ pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc \
@BUILD_PINENTRY_QT_TRUE@ pinentryrc.cpp
CLEANFILES = $(BUILT_SOURCES)
@HAVE_W32_SYSTEM_FALSE@pinentry_qt_platform_SOURCES = capslock_unix.cpp
@HAVE_W32_SYSTEM_TRUE@pinentry_qt_platform_SOURCES = capslock_win.cpp
pinentry_qt_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp pinentryconfirm.cpp pinentryconfirm.h \
pinlineedit.h pinlineedit.cpp capslock.cpp capslock.h capslock_p.h \
pinentry_debug.cpp pinentry_debug.h util.h accessibility.cpp \
accessibility.h qti18n.cpp pinentryrc.qrc \
$(pinentry_qt_platform_SOURCES)
nodist_pinentry_qt_SOURCES = $(BUILT_SOURCES)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .cpp .h .moc .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu qt/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu qt/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
pinentry-qt$(EXEEXT): $(pinentry_qt_OBJECTS) $(pinentry_qt_DEPENDENCIES) $(EXTRA_pinentry_qt_DEPENDENCIES)
@rm -f pinentry-qt$(EXEEXT)
$(AM_V_CXXLD)$(pinentry_qt_LINK) $(pinentry_qt_OBJECTS) $(pinentry_qt_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accessibility.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capslock.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capslock_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capslock_win.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry_debug.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentryconfirm.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentrydialog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentryrc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinlineedit.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qti18n.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.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
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-recursive
all-am: Makefile $(PROGRAMS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-recursive
install-exec: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f ./$(DEPDIR)/accessibility.Po
-rm -f ./$(DEPDIR)/capslock.Po
-rm -f ./$(DEPDIR)/capslock_unix.Po
-rm -f ./$(DEPDIR)/capslock_win.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentry_debug.Po
-rm -f ./$(DEPDIR)/pinentryconfirm.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/pinentryrc.Po
-rm -f ./$(DEPDIR)/pinlineedit.Po
-rm -f ./$(DEPDIR)/qti18n.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/accessibility.Po
-rm -f ./$(DEPDIR)/capslock.Po
-rm -f ./$(DEPDIR)/capslock_unix.Po
-rm -f ./$(DEPDIR)/capslock_win.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentry_debug.Po
-rm -f ./$(DEPDIR)/pinentryconfirm.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/pinentryrc.Po
-rm -f ./$(DEPDIR)/pinlineedit.Po
-rm -f ./$(DEPDIR)/qti18n.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: $(am__recursive_targets) all check install install-am \
install-exec install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--depfiles check check-am clean clean-binPROGRAMS \
clean-generic cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
.h.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
pinentryrc.cpp: pinentryrc.qrc
$(RCC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -0,0 +1,70 @@
/* accessibility.cpp - Helpers for making pinentry accessible
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include "accessibility.h"
#include <QLabel>
#include <QString>
#include <QTextDocument>
#include <QWidget>
#include "pinentry_debug.h"
namespace Accessibility
{
void setDescription(QWidget *w, const QString &text)
{
if (w) {
#ifndef QT_NO_ACCESSIBILITY
w->setAccessibleDescription(text);
#endif
}
}
void setName(QWidget *w, const QString &text)
{
if (w) {
#ifndef QT_NO_ACCESSIBILITY
w->setAccessibleName(text);
#endif
}
}
void selectLabelText(QLabel *label)
{
if (!label || label->text().isEmpty()) {
return;
}
if (label->textFormat() == Qt::PlainText) {
label->setSelection(0, label->text().size());
} else if (label->textFormat() == Qt::RichText) {
// unfortunately, there is no selectAll(); therefore, we need
// to determine the "visual" length of the text by stripping
// the label's text of all formatting information
QTextDocument temp;
temp.setHtml(label->text());
label->setSelection(0, temp.toRawText().size());
} else {
qDebug(PINENTRY_LOG) << "Label with unsupported text format" << label->textFormat() << "got focus";
}
}
} // namespace Accessibility

@ -0,0 +1,45 @@
/* accessibility.h - Helpers for making pinentry accessible
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRY_QT_ACCESSIBILITY_H__
#define __PINENTRY_QT_ACCESSIBILITY_H__
class QLabel;
class QString;
class QWidget;
namespace Accessibility
{
/* Wrapper for QWidget::setAccessibleDescription which does nothing if
QT_NO_ACCESSIBILITY is defined. */
void setDescription(QWidget *w, const QString &text);
/* Wrapper for QWidget::setAccessibleName which does nothing if
QT_NO_ACCESSIBILITY is defined. */
void setName(QWidget *w, const QString &text);
/* Selects the text displayed by the label. Only QLabel with text format
Qt::PlainText or Qt::RichText are supported. */
void selectLabelText(QLabel *label);
} // namespace Accessibility
#endif // __PINENTRY_QT_ACCESSIBILITY_H__

@ -0,0 +1,53 @@
/* capslock.cpp - Helper to check whether Caps Lock is on
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "capslock.h"
#include "capslock_p.h"
#include <QGuiApplication>
#include <QDebug>
CapsLockWatcher::Private::Private(CapsLockWatcher *q)
: q{q}
{
#ifdef PINENTRY_QT_WAYLAND
if (qApp->platformName() == QLatin1String("wayland")) {
watchWayland();
}
#endif
}
CapsLockWatcher::CapsLockWatcher(QObject *parent)
: QObject{parent}
, d{new Private{this}}
{
if (qApp->platformName() == QLatin1String("wayland")) {
#ifndef PINENTRY_QT_WAYLAND
qWarning() << "CapsLockWatcher was compiled without support for Wayland";
#endif
}
}
#include "capslock.moc"

@ -0,0 +1,52 @@
/* capslock.h - Helper to check whether Caps Lock is on
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRY_QT_CAPSLOCK_H__
#define __PINENTRY_QT_CAPSLOCK_H__
#include <QObject>
#include <memory>
enum class LockState
{
Unknown = -1,
Off,
On
};
LockState capsLockState();
class CapsLockWatcher : public QObject
{
Q_OBJECT
public:
explicit CapsLockWatcher(QObject *parent = nullptr);
Q_SIGNALS:
void stateChanged(bool locked);
private:
class Private;
std::unique_ptr<Private> d;
};
#endif // __PINENTRY_QT_CAPSLOCK_H__

@ -0,0 +1,61 @@
/* capslock_p.h - Helper to check whether Caps Lock is on
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRY_QT_CAPSLOCK_P_H__
#define __PINENTRY_QT_CAPSLOCK_P_H__
#include "capslock.h"
#ifdef PINENTRY_QT_WAYLAND
namespace KWayland
{
namespace Client
{
class Registry;
class Seat;
}
}
#endif
class CapsLockWatcher::Private
{
public:
explicit Private(CapsLockWatcher *);
#ifdef PINENTRY_QT_WAYLAND
void watchWayland();
#endif
private:
#ifdef PINENTRY_QT_WAYLAND
void registry_seatAnnounced(quint32, quint32);
void seat_hasKeyboardChanged(bool);
void keyboard_modifiersChanged(quint32);
#endif
private:
CapsLockWatcher *const q;
#ifdef PINENTRY_QT_WAYLAND
KWayland::Client::Registry *registry = nullptr;
KWayland::Client::Seat *seat = nullptr;
#endif
};
#endif // __PINENTRY_QT_CAPSLOCK_P_H__

@ -0,0 +1,136 @@
/* capslock_unix.cpp - Helper to check whether Caps Lock is on
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "capslock.h"
#include "capslock_p.h"
#ifdef PINENTRY_QT_WAYLAND
# include <KWayland/Client/connection_thread.h>
# include <KWayland/Client/keyboard.h>
# include <KWayland/Client/registry.h>
# include <KWayland/Client/seat.h>
#endif
#include <QGuiApplication>
#ifdef PINENTRY_QT_X11
# include <QX11Info>
# include <X11/XKBlib.h>
# undef Status
#endif
#include <QDebug>
#ifdef PINENTRY_QT_WAYLAND
using namespace KWayland::Client;
#endif
#ifdef PINENTRY_QT_WAYLAND
static bool watchingWayland = false;
#endif
LockState capsLockState()
{
static bool reportUnsupportedPlatform = true;
#ifdef PINENTRY_QT_X11
if (qApp->platformName() == QLatin1String("xcb")) {
unsigned int state;
XkbGetIndicatorState(QX11Info::display(), XkbUseCoreKbd, &state);
return (state & 0x01) == 1 ? LockState::On : LockState::Off;
}
#endif
#ifdef PINENTRY_QT_WAYLAND
if (qApp->platformName() == QLatin1String("wayland")) {
if (!watchingWayland && reportUnsupportedPlatform) {
qDebug() << "Use CapsLockWatcher for checking for Caps Lock on Wayland";
}
} else
#endif
if (reportUnsupportedPlatform) {
qWarning() << "Checking for Caps Lock not possible on unsupported platform:" << qApp->platformName();
}
reportUnsupportedPlatform = false;
return LockState::Unknown;
}
#ifdef PINENTRY_QT_WAYLAND
void CapsLockWatcher::Private::watchWayland()
{
watchingWayland = true;
auto connection = ConnectionThread::fromApplication(q);
if (!connection) {
qWarning() << "Failed to get connection to Wayland server from QPA";
return;
}
registry = new Registry{q};
registry->create(connection);
if (!registry->isValid()) {
qWarning() << "Failed to create valid KWayland registry";
return;
}
registry->setup();
connect(registry, &Registry::seatAnnounced,
q, [this] (quint32 name, quint32 version) { registry_seatAnnounced(name, version); });
}
void CapsLockWatcher::Private::registry_seatAnnounced(quint32 name, quint32 version)
{
Q_ASSERT(registry);
seat = registry->createSeat(name, version, q);
if (!seat->isValid()) {
qWarning() << "Failed to create valid KWayland seat";
return;
}
connect(seat, &Seat::hasKeyboardChanged,
q, [this] (bool hasKeyboard) { seat_hasKeyboardChanged(hasKeyboard); });
}
void CapsLockWatcher::Private::seat_hasKeyboardChanged(bool hasKeyboard)
{
Q_ASSERT(seat);
if (!hasKeyboard) {
qDebug() << "Seat has no keyboard";
return;
}
auto keyboard = seat->createKeyboard(q);
if (!keyboard->isValid()) {
qWarning() << "Failed to create valid KWayland keyboard";
return;
}
connect(keyboard, &Keyboard::modifiersChanged,
q, [this] (quint32, quint32, quint32 locked, quint32) { keyboard_modifiersChanged(locked); });
}
void CapsLockWatcher::Private::keyboard_modifiersChanged(quint32 locked)
{
const bool capsLockIsLocked = (locked & 2u) != 0;
qDebug() << "Caps Lock is locked:" << capsLockIsLocked;
Q_EMIT q->stateChanged(capsLockIsLocked);
}
#endif

@ -0,0 +1,28 @@
/* capslock_win.cpp - Helper to check whether Caps Lock is on
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include "capslock.h"
#include <windows.h>
LockState capsLockState()
{
return (GetKeyState(VK_CAPITAL) & 1) ? LockState::On : LockState::Off;
}

@ -0,0 +1,26 @@
# Makefile.am
# Copyright (C) 2022 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, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0+
## Process this file with automake to produce Makefile.in
EXTRA_DIST = data-error.svg \
document-encrypt.png \
hint.svg \
password-generate.svg \
visibility.svg

@ -0,0 +1,503 @@
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am
# Copyright (C) 2022 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, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = qt/icons
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_CFLAGS = @COMMON_CFLAGS@
COMMON_LIBS = @COMMON_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
FLTKCXXFLAGS = @FLTKCXXFLAGS@
FLTKLIBS = @FLTKLIBS@
FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
GPG_ERROR_MT_CFLAGS = @GPG_ERROR_MT_CFLAGS@
GPG_ERROR_MT_LIBS = @GPG_ERROR_MT_LIBS@
GREP = @GREP@
GTK2_CFLAGS = @GTK2_CFLAGS@
GTK2_LIBS = @GTK2_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TQT_MOC = @TQT_MOC@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = data-error.svg \
document-encrypt.png \
hint.svg \
password-generate.svg \
visibility.svg
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu qt/icons/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu qt/icons/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -0,0 +1,9 @@
<svg version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
<style type="text/css" id="current-color-scheme">
.ColorScheme-NegativeText {
color:#da4453;
}
</style>
<rect class="ColorScheme-NegativeText" x="3" y="3" width="16" height="16" rx="2" fill="currentColor"/>
<path d="M 6.414,5 5,6.414 9.586,11 5,15.586 6.414,17 11,12.414 15.586,17 17,15.586 12.414,11 17,6.414 15.586,5 11,9.586 Z" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 471 B

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#232629;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 13.314453 2 L 2 13.294922 L 2.7148438 14 L 14 2.6972656 L 13.314453 2 z M 8 3 A 8.9999916 9.000003 0 0 0 0.12304688 7.6679688 C 0.25199187 8.0317035 0.48048562 8.3445563 0.77929688 8.5761719 A 7.9999926 8.0000028 0 0 1 8 4 A 3.9999993 4.0000007 0 0 0 4 8 A 3.9999993 4.0000007 0 0 0 4.1054688 8.8945312 L 5 8 A 2.9999993 3.0000005 0 0 1 8 5 L 8.8925781 4.1074219 A 3.9999993 4.0000007 0 0 0 8.3496094 4.0175781 A 7.9999926 8.0000028 0 0 1 8.9277344 4.0722656 L 9.8066406 3.1933594 A 8.9999916 9.000003 0 0 0 8 3 z M 13.835938 5.1640625 L 13.121094 5.8789062 A 7.9999926 8.0000028 0 0 1 15.220703 8.5761719 C 15.522218 8.3424607 15.752612 8.0261216 15.880859 7.6582031 A 8.9999916 9.000003 0 0 0 13.835938 5.1640625 z M 11.894531 7.1054688 L 11 8 A 2.9999993 3.0000005 0 0 1 8 11 L 7.1074219 11.892578 A 3.9999993 4.0000007 0 0 0 8 12 A 3.9999993 4.0000007 0 0 0 12 8 A 3.9999993 4.0000007 0 0 0 11.894531 7.1054688 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#232629;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="m3.5 2l-.531.969-.969.531.969.531.531.969.531-.969.969-.531-.969-.531zm7.631 0l-9.125 9.125 2.875 2.875 9.125-9.125zm0 1.438l1.438 1.439-2.781 2.779-1.438-1.438z"
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 496 B

@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#232629;
}
</style>
</defs>
<g
transform="translate(-421.71429,-531.79074)">
<g
transform="matrix(0.75,0,0,0.74999813,421.46429,-241.22897)">
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 8 3 A 8.9999925 9.0000023 0 0 0 0.12304688 7.6679688 C 0.2519919 8.0317178 0.48048563 8.3445725 0.77929688 8.5761719 A 7.9999935 8.0000021 0 0 1 8 4 A 3.9999996 4.0000004 0 0 0 4 8 A 3.9999996 4.0000004 0 0 0 8 12 A 3.9999996 4.0000004 0 0 0 12 8 A 3.9999996 4.0000004 0 0 0 8.3496094 4.0175781 A 7.9999935 8.0000021 0 0 1 15.220703 8.5761719 C 15.522218 8.3424725 15.752612 8.0260772 15.880859 7.6582031 A 8.9999925 9.0000023 0 0 0 8 3 z M 8 5 A 2.9999996 3.0000002 0 0 1 11 8 A 2.9999996 3.0000002 0 0 1 8 11 A 2.9999996 3.0000002 0 0 1 5 8 A 2.9999996 3.0000002 0 0 1 8 5 z M 8 6 A 1.9999999 2.0000003 0 0 0 6 8 A 1.9999999 2.0000003 0 0 0 8 10 A 1.9999999 2.0000003 0 0 0 10 8 A 1.9999999 2.0000003 0 0 0 9.9101562 7.4121094 A 0.9999999 1 0 0 1 9 8 A 0.9999999 1 0 0 1 8 7 A 0.9999999 1 0 0 1 8.5898438 6.0898438 A 1.9999999 2.0000003 0 0 0 8 6 z "
transform="matrix(1.3333333,0,0,1.3333367,0.33333333,1030.6955)"
class="ColorScheme-Text"
id="rect4170" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,429 @@
/* main.cpp - A Qt dialog for PIN entry.
* Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB)
* Copyright (C) 2003, 2021 g10 Code GmbH
* Copyright 2007 Ingo Klöcker
*
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
* Modified by Marcus Brinkmann <marcus@g10code.de>.
* Modified by Marc Mutz <marc@kdab.com>
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "accessibility.h"
#include "pinentryconfirm.h"
#include "pinentrydialog.h"
#include "pinentry.h"
#include "util.h"
#include <QApplication>
#include <QDebug>
#include <QIcon>
#include <QMessageBox>
#include <QPushButton>
#include <QString>
#include <QWidget>
#if QT_VERSION >= 0x050000
#include <QWindow>
#endif
#include <stdio.h>
#include <errno.h>
#include <stdexcept>
#include <gpg-error.h>
#ifdef FALLBACK_CURSES
#include <pinentry-curses.h>
#endif
#if QT_VERSION >= 0x050000 && defined(QT_STATIC)
#include <QtPlugin>
#ifdef Q_OS_WIN
#include <windows.h>
#include <shlobj.h>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#elif defined(Q_OS_MAC)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
#else
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
#endif
#endif
#ifdef Q_OS_WIN
#include <windows.h>
#endif
#include "pinentry_debug.h"
static QString escape_accel(const QString &s)
{
QString result;
result.reserve(s.size());
bool afterUnderscore = false;
for (unsigned int i = 0, end = s.size() ; i != end ; ++i) {
const QChar ch = s[i];
if (ch == QLatin1Char('_')) {
if (afterUnderscore) { // escaped _
result += QLatin1Char('_');
afterUnderscore = false;
} else { // accel
afterUnderscore = true;
}
} else {
if (afterUnderscore || // accel
ch == QLatin1Char('&')) { // escape & from being interpreted by Qt
result += QLatin1Char('&');
}
result += ch;
afterUnderscore = false;
}
}
if (afterUnderscore)
// trailing single underscore: shouldn't happen, but deal with it robustly:
{
result += QLatin1Char('_');
}
return result;
}
namespace
{
class InvalidUtf8 : public std::invalid_argument
{
public:
InvalidUtf8() : std::invalid_argument("invalid utf8") {}
~InvalidUtf8() throw() {}
};
}
static const bool GPG_AGENT_IS_PORTED_TO_ONLY_SEND_UTF8 = false;
static QString from_utf8(const char *s)
{
const QString result = QString::fromUtf8(s);
if (result.contains(QChar::ReplacementCharacter)) {
if (GPG_AGENT_IS_PORTED_TO_ONLY_SEND_UTF8) {
throw InvalidUtf8();
} else {
return QString::fromLocal8Bit(s);
}
}
return result;
}
static void
setup_foreground_window(QWidget *widget, WId parentWid)
{
#if QT_VERSION >= 0x050000
/* For windows set the desktop window as the transient parent */
QWindow *parentWindow = nullptr;
if (parentWid) {
parentWindow = QWindow::fromWinId(parentWid);
}
#ifdef Q_OS_WIN
if (!parentWindow) {
HWND desktop = GetDesktopWindow();
if (desktop) {
parentWindow = QWindow::fromWinId((WId) desktop);
}
}
#endif
if (parentWindow) {
// Ensure that we have a native wid
widget->winId();
QWindow *wndHandle = widget->windowHandle();
if (wndHandle) {
wndHandle->setTransientParent(parentWindow);
}
}
#endif
widget->setWindowFlags(Qt::Window |
Qt::CustomizeWindowHint |
Qt::WindowTitleHint |
Qt::WindowCloseButtonHint |
Qt::WindowStaysOnTopHint |
Qt::WindowMinimizeButtonHint);
}
static int
qt_cmd_handler(pinentry_t pe)
{
int want_pass = !!pe->pin;
const QString ok =
pe->ok ? escape_accel(from_utf8(pe->ok)) :
pe->default_ok ? escape_accel(from_utf8(pe->default_ok)) :
/* else */ QLatin1String("&OK") ;
const QString cancel =
pe->cancel ? escape_accel(from_utf8(pe->cancel)) :
pe->default_cancel ? escape_accel(from_utf8(pe->default_cancel)) :
/* else */ QLatin1String("&Cancel") ;
unique_malloced_ptr<char> str{pinentry_get_title(pe)};
const QString title =
str ? from_utf8(str.get()) :
/* else */ QLatin1String("pinentry-qt") ;
const QString repeatError =
pe->repeat_error_string ? from_utf8(pe->repeat_error_string) :
QLatin1String("Passphrases do not match");
const QString repeatString =
pe->repeat_passphrase ? from_utf8(pe->repeat_passphrase) :
QString();
const QString visibilityTT =
pe->default_tt_visi ? from_utf8(pe->default_tt_visi) :
QLatin1String("Show passphrase");
const QString hideTT =
pe->default_tt_hide ? from_utf8(pe->default_tt_hide) :
QLatin1String("Hide passphrase");
const QString capsLockHint =
pe->default_capshint ? from_utf8(pe->default_capshint) :
QLatin1String("Caps Lock is on");
const QString generateLbl = pe->genpin_label ? from_utf8(pe->genpin_label) :
QString();
const QString generateTT = pe->genpin_tt ? from_utf8(pe->genpin_tt) :
QString();
if (want_pass) {
PinEntryDialog pinentry(nullptr, 0, pe->timeout, true, !!pe->quality_bar,
repeatString, visibilityTT, hideTT);
setup_foreground_window(&pinentry, pe->parent_wid);
pinentry.setPinentryInfo(pe);
pinentry.setPrompt(escape_accel(from_utf8(pe->prompt)));
pinentry.setDescription(from_utf8(pe->description));
pinentry.setRepeatErrorText(repeatError);
pinentry.setGenpinLabel(generateLbl);
pinentry.setGenpinTT(generateTT);
pinentry.setCapsLockHint(capsLockHint);
pinentry.setFormattedPassphrase({
bool(pe->formatted_passphrase),
from_utf8(pe->formatted_passphrase_hint)});
pinentry.setConstraintsOptions({
bool(pe->constraints_enforce),
from_utf8(pe->constraints_hint_short),
from_utf8(pe->constraints_hint_long),
from_utf8(pe->constraints_error_title)
});
if (!title.isEmpty()) {
pinentry.setWindowTitle(title);
}
/* If we reuse the same dialog window. */
pinentry.setPin(QString());
pinentry.setOkText(ok);
pinentry.setCancelText(cancel);
if (pe->error) {
pinentry.setError(from_utf8(pe->error));
}
if (pe->quality_bar) {
pinentry.setQualityBar(from_utf8(pe->quality_bar));
}
if (pe->quality_bar_tt) {
pinentry.setQualityBarTT(from_utf8(pe->quality_bar_tt));
}
bool ret = pinentry.exec();
if (!ret) {
if (pinentry.timedOut())
pe->specific_err = gpg_error (GPG_ERR_TIMEOUT);
return -1;
}
const QString pinStr = pinentry.pin();
QByteArray pin = pinStr.toUtf8();
if (!!pe->repeat_passphrase) {
/* Should not have been possible to accept
the dialog in that case but we do a safety
check here */
pe->repeat_okay = (pinStr == pinentry.repeatedPin());
}
int len = strlen(pin.constData());
if (len >= 0) {
pinentry_setbufferlen(pe, len + 1);
if (pe->pin) {
strcpy(pe->pin, pin.constData());
return len;
}
}
return -1;
} else {
const QString desc = pe->description ? from_utf8(pe->description) : QString();
const QString notok = pe->notok ? escape_accel(from_utf8(pe->notok)) : QString();
const QMessageBox::StandardButtons buttons =
pe->one_button ? QMessageBox::Ok :
pe->notok ? QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel :
/* else */ QMessageBox::Ok | QMessageBox::Cancel ;
PinentryConfirm box{QMessageBox::Information, title, desc, buttons};
box.setTextFormat(Qt::PlainText);
box.setTextInteractionFlags(Qt::TextSelectableByMouse);
box.setTimeout(std::chrono::seconds{pe->timeout});
setup_foreground_window(&box, pe->parent_wid);
const struct {
QMessageBox::StandardButton button;
QString label;
} buttonLabels[] = {
{ QMessageBox::Ok, ok },
{ QMessageBox::Yes, ok },
{ QMessageBox::No, notok },
{ QMessageBox::Cancel, cancel },
};
for (size_t i = 0 ; i < sizeof buttonLabels / sizeof * buttonLabels ; ++i)
if ((buttons & buttonLabels[i].button) && !buttonLabels[i].label.isEmpty()) {
box.button(buttonLabels[i].button)->setText(buttonLabels[i].label);
Accessibility::setDescription(box.button(buttonLabels[i].button),
buttonLabels[i].label);
}
box.setIconPixmap(applicationIconPixmap());
if (!pe->one_button) {
box.setDefaultButton(QMessageBox::Cancel);
}
box.show();
raiseWindow(&box);
const int rc = box.exec();
if (rc == QMessageBox::Cancel) {
pe->canceled = true;
}
if (box.timedOut()) {
pe->specific_err = gpg_error (GPG_ERR_TIMEOUT);
}
return rc == QMessageBox::Ok || rc == QMessageBox::Yes ;
}
}
static int
qt_cmd_handler_ex(pinentry_t pe)
{
try {
return qt_cmd_handler(pe);
} catch (const InvalidUtf8 &) {
pe->locale_err = true;
return pe->pin ? -1 : false ;
} catch (...) {
pe->canceled = true;
return pe->pin ? -1 : false ;
}
}
pinentry_cmd_handler_t pinentry_cmd_handler = qt_cmd_handler_ex;
int
main(int argc, char *argv[])
{
pinentry_init("pinentry-qt");
QApplication *app = NULL;
int new_argc = 0;
#ifdef FALLBACK_CURSES
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
// check a few environment variables that are usually set on X11 or Wayland sessions
const bool hasWaylandDisplay = qEnvironmentVariableIsSet("WAYLAND_DISPLAY");
const bool isWaylandSessionType = qgetenv("XDG_SESSION_TYPE") == "wayland";
const bool hasX11Display = pinentry_have_display(argc, argv);
const bool isX11SessionType = qgetenv("XDG_SESSION_TYPE") == "x11";
const bool isGUISession = hasWaylandDisplay || isWaylandSessionType || hasX11Display || isX11SessionType;
qCDebug(PINENTRY_LOG) << "hasWaylandDisplay:" << hasWaylandDisplay;
qCDebug(PINENTRY_LOG) << "isWaylandSessionType:" << isWaylandSessionType;
qCDebug(PINENTRY_LOG) << "hasX11Display:" << hasX11Display;
qCDebug(PINENTRY_LOG) << "isX11SessionType:" << isX11SessionType;
qCDebug(PINENTRY_LOG) << "isGUISession:" << isGUISession;
#else
const bool isGUISession = pinentry_have_display(argc, argv);
#endif
if (!isGUISession) {
pinentry_cmd_handler = curses_cmd_handler;
pinentry_set_flavor_flag ("curses");
} else
#endif
{
/* Qt does only understand -display but not --display; thus we
are fixing that here. The code is pretty simply and may get
confused if an argument is called "--display". */
char **new_argv, *p;
size_t n;
int i, done;
for (n = 0, i = 0; i < argc; i++) {
n += strlen(argv[i]) + 1;
}
n++;
new_argv = (char **)calloc(argc + 1, sizeof * new_argv);
if (new_argv) {
*new_argv = (char *)malloc(n);
}
if (!new_argv || !*new_argv) {
fprintf(stderr, "pinentry-qt: can't fixup argument list: %s\n",
strerror(errno));
exit(EXIT_FAILURE);
}
for (done = 0, p = *new_argv, i = 0; i < argc; i++)
if (!done && !strcmp(argv[i], "--display")) {
new_argv[i] = strcpy(p, argv[i] + 1);
p += strlen(argv[i] + 1) + 1;
done = 1;
} else {
new_argv[i] = strcpy(p, argv[i]);
p += strlen(argv[i]) + 1;
}
/* Note: QApplication uses int &argc so argc has to be valid
* for the full lifetime of the application.
*
* As Qt might modify argc / argv we use copies here so that
* we do not loose options that are handled in both. e.g. display.
*/
new_argc = argc;
Q_ASSERT (new_argc);
app = new QApplication(new_argc, new_argv);
app->setWindowIcon(QIcon(QLatin1String(":/icons/document-encrypt.png")));
}
pinentry_parse_opts(argc, argv);
int rc = pinentry_loop();
delete app;
return rc ? EXIT_FAILURE : EXIT_SUCCESS ;
}

@ -0,0 +1,31 @@
/* pinentry_debug.h - Logging category for pinentry
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "pinentry_debug.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
Q_LOGGING_CATEGORY(PINENTRY_LOG, "gpg.pinentry", QtWarningMsg)
#else
Q_LOGGING_CATEGORY(PINENTRY_LOG, "gpg.pinentry")
#endif

@ -0,0 +1,28 @@
/* pinentry_debug.h - Logging category for pinentry
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRY_QT_DEBUG_H__
#define __PINENTRY_QT_DEBUG_H__
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(PINENTRY_LOG)
#endif // __PINENTRY_QT_DEBUG_H__

@ -0,0 +1,145 @@
/* pinentryconfirm.cpp - A QMessageBox with a timeout
*
* Copyright (C) 2011 Ben Kibbey <bjk@luxsci.net>
* Copyright (C) 2022 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include "pinentryconfirm.h"
#include "accessibility.h"
#include "pinentrydialog.h"
#include <QApplication>
#include <QAbstractButton>
#include <QGridLayout>
#include <QLabel>
#include <QSpacerItem>
#include <QFontMetrics>
namespace
{
QLabel *messageBoxLabel(QMessageBox *messageBox)
{
return messageBox->findChild<QLabel *>(QStringLiteral("qt_msgbox_label"));
}
}
PinentryConfirm::PinentryConfirm(Icon icon, const QString &title, const QString &text,
StandardButtons buttons, QWidget *parent, Qt::WindowFlags flags)
: QMessageBox{icon, title, text, buttons, parent, flags}
{
_timer.callOnTimeout(this, &PinentryConfirm::slotTimeout);
Accessibility::setDescription(this, text);
Accessibility::setName(this, title);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installActivationObserver(this);
accessibilityActiveChanged(QAccessible::isActive());
#endif
#if QT_VERSION >= 0x050000
/* This is in line with PinentryDialog ctor to have a maximizing
* animation when opening. */
if (qApp->platformName() != QLatin1String("wayland")) {
setWindowState(Qt::WindowMinimized);
QTimer::singleShot(0, this, [this] () {
raiseWindow(this);
});
}
#else
activateWindow();
raise();
#endif
}
PinentryConfirm::~PinentryConfirm()
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::removeActivationObserver(this);
#endif
}
void PinentryConfirm::setTimeout(std::chrono::seconds timeout)
{
_timer.setInterval(timeout);
}
std::chrono::seconds PinentryConfirm::timeout() const
{
return std::chrono::duration_cast<std::chrono::seconds>(_timer.intervalAsDuration());
}
bool PinentryConfirm::timedOut() const
{
return _timed_out;
}
void PinentryConfirm::showEvent(QShowEvent *event)
{
static bool resized;
if (!resized) {
QGridLayout* lay = dynamic_cast<QGridLayout*> (layout());
if (lay) {
QSize textSize = fontMetrics().size(Qt::TextExpandTabs, text(), fontMetrics().maxWidth());
QSpacerItem* horizontalSpacer = new QSpacerItem(textSize.width() + iconPixmap().width(),
0, QSizePolicy::Minimum, QSizePolicy::Expanding);
lay->addItem(horizontalSpacer, lay->rowCount(), 1, 1, lay->columnCount() - 1);
}
resized = true;
}
QMessageBox::showEvent(event);
if (timeout() > std::chrono::milliseconds::zero()) {
_timer.setSingleShot(true);
_timer.start();
}
}
bool PinentryConfirm::focusNextPrevChild(bool next)
{
auto ret = QMessageBox::focusNextPrevChild(next);
if (ret && (focusWidget() == messageBoxLabel(this))) {
Accessibility::selectLabelText(messageBoxLabel(this));
}
return ret;
}
void PinentryConfirm::slotTimeout()
{
QAbstractButton *b = button(QMessageBox::Cancel);
_timed_out = true;
if (b) {
b->animateClick(0);
}
}
#ifndef QT_NO_ACCESSIBILITY
void PinentryConfirm::accessibilityActiveChanged(bool active)
{
// Allow text label to get focus if accessibility is active
const auto focusPolicy = active ? Qt::StrongFocus : Qt::ClickFocus;
if (auto label = messageBoxLabel(this)) {
label->setFocusPolicy(focusPolicy);
}
}
#endif
#include "pinentryconfirm.moc"

@ -0,0 +1,64 @@
/* pinentryconfirm.h - A QMessageBox with a timeout
*
* Copyright (C) 2011 Ben Kibbey <bjk@luxsci.net>
* Copyright (C) 2022 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef PINENTRYCONFIRM_H
#define PINENTRYCONFIRM_H
#include <QAccessible>
#include <QMessageBox>
#include <QTimer>
class PinentryConfirm : public QMessageBox
#ifndef QT_NO_ACCESSIBILITY
, public QAccessible::ActivationObserver
#endif
{
Q_OBJECT
public:
PinentryConfirm(Icon icon, const QString &title, const QString &text,
StandardButtons buttons = NoButton, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
~PinentryConfirm() override;
void setTimeout(std::chrono::seconds timeout);
std::chrono::seconds timeout() const;
bool timedOut() const;
protected:
void showEvent(QShowEvent *event) override;
bool focusNextPrevChild(bool next) override;
private Q_SLOTS:
void slotTimeout();
private:
#ifndef QT_NO_ACCESSIBILITY
void accessibilityActiveChanged(bool active) override;
#endif
private:
QTimer _timer;
bool _timed_out = false;
};
#endif

@ -0,0 +1,793 @@
/* pinentrydialog.cpp - A (not yet) secure Qt 4 dialog for PIN entry.
* Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB)
* Copyright 2007 Ingo Klöcker
* Copyright 2016 Intevation GmbH
* Copyright (C) 2021, 2022 g10 Code GmbH
*
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
* Modified by Andre Heinecke <aheinecke@intevation.de>
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "pinentrydialog.h"
#include "accessibility.h"
#include "capslock.h"
#include "pinlineedit.h"
#include "util.h"
#include <QGridLayout>
#include <QProgressBar>
#include <QApplication>
#include <QFontMetrics>
#include <QStyle>
#include <QPainter>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QKeyEvent>
#include <QLabel>
#include <QPalette>
#include <QLineEdit>
#include <QAction>
#include <QCheckBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QMessageBox>
#include <QRegularExpression>
#include <QAccessible>
#include <QDebug>
#ifdef Q_OS_WIN
#include <windows.h>
#if QT_VERSION >= 0x050700
#include <QtPlatformHeaders/QWindowsWindowFunctions>
#endif
#endif
void raiseWindow(QWidget *w)
{
#ifdef Q_OS_WIN
#if QT_VERSION >= 0x050700
QWindowsWindowFunctions::setWindowActivationBehavior(
QWindowsWindowFunctions::AlwaysActivateWindow);
#endif
#endif
w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
w->activateWindow();
w->raise();
}
QPixmap applicationIconPixmap(const QIcon &overlayIcon)
{
QPixmap pm = qApp->windowIcon().pixmap(48, 48);
if (!overlayIcon.isNull()) {
QPainter painter(&pm);
const int emblemSize = 22;
painter.drawPixmap(pm.width() - emblemSize, 0,
overlayIcon.pixmap(emblemSize, emblemSize));
}
return pm;
}
namespace
{
class TextLabel : public QLabel
{
public:
using QLabel::QLabel;
protected:
void focusInEvent(QFocusEvent *ev) override;
};
void TextLabel::focusInEvent(QFocusEvent *ev)
{
QLabel::focusInEvent(ev);
// if the text label gets focus, then select its text; this is a workaround
// for missing focus indicators for labels in many Qt styles
const Qt::FocusReason reason = ev->reason();
const auto isKeyboardFocusEvent = reason == Qt::TabFocusReason
|| reason == Qt::BacktabFocusReason
|| reason == Qt::ShortcutFocusReason;
if (!text().isEmpty() && isKeyboardFocusEvent) {
Accessibility::selectLabelText(this);
}
}
}
void PinEntryDialog::slotTimeout()
{
_timed_out = true;
reject();
}
PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
int timeout, bool modal, bool enable_quality_bar,
const QString &repeatString,
const QString &visibilityTT,
const QString &hideTT)
: QDialog{parent}
, _have_quality_bar{enable_quality_bar}
, mVisibilityTT{visibilityTT}
, mHideTT{hideTT}
{
Q_UNUSED(name)
if (modal) {
setWindowModality(Qt::ApplicationModal);
}
QPalette redTextPalette;
redTextPalette.setColor(QPalette::WindowText, Qt::red);
auto *const mainLayout = new QVBoxLayout{this};
auto *const hbox = new QHBoxLayout;
_icon = new QLabel(this);
_icon->setPixmap(applicationIconPixmap());
hbox->addWidget(_icon, 0, Qt::AlignVCenter | Qt::AlignLeft);
auto *const grid = new QGridLayout;
int row = 1;
_error = new TextLabel{this};
_error->setTextFormat(Qt::PlainText);
_error->setTextInteractionFlags(Qt::TextSelectableByMouse);
_error->setPalette(redTextPalette);
_error->hide();
grid->addWidget(_error, row, 1, 1, 2);
row++;
_desc = new TextLabel{this};
_desc->setTextFormat(Qt::PlainText);
_desc->setTextInteractionFlags(Qt::TextSelectableByMouse);
_desc->hide();
grid->addWidget(_desc, row, 1, 1, 2);
row++;
mCapsLockHint = new TextLabel{this};
mCapsLockHint->setTextFormat(Qt::PlainText);
mCapsLockHint->setTextInteractionFlags(Qt::TextSelectableByMouse);
mCapsLockHint->setPalette(redTextPalette);
mCapsLockHint->setAlignment(Qt::AlignCenter);
mCapsLockHint->setVisible(false);
grid->addWidget(mCapsLockHint, row, 1, 1, 2);
row++;
{
_prompt = new QLabel(this);
_prompt->setTextFormat(Qt::PlainText);
_prompt->setTextInteractionFlags(Qt::TextSelectableByMouse);
_prompt->hide();
grid->addWidget(_prompt, row, 1);
const auto l = new QHBoxLayout;
_edit = new PinLineEdit(this);
_edit->setMaxLength(256);
_edit->setMinimumWidth(_edit->fontMetrics().averageCharWidth()*20 + 48);
_edit->setEchoMode(QLineEdit::Password);
_prompt->setBuddy(_edit);
l->addWidget(_edit, 1);
if (!repeatString.isNull()) {
mGenerateButton = new QPushButton{this};
mGenerateButton->setIcon(QIcon(QLatin1String(":/icons/password-generate")));
mGenerateButton->setVisible(false);
l->addWidget(mGenerateButton);
}
grid->addLayout(l, row, 2);
}
/* Set up the show password action */
const QIcon visibilityIcon = QIcon(QLatin1String(":/icons/visibility.svg"));
const QIcon hideIcon = QIcon(QLatin1String(":/icons/hint.svg"));
#if QT_VERSION >= 0x050200
if (!visibilityIcon.isNull() && !hideIcon.isNull()) {
mVisiActionEdit = _edit->addAction(visibilityIcon, QLineEdit::TrailingPosition);
mVisiActionEdit->setVisible(false);
mVisiActionEdit->setToolTip(mVisibilityTT);
} else
#endif
{
if (!mVisibilityTT.isNull()) {
row++;
mVisiCB = new QCheckBox{mVisibilityTT, this};
grid->addWidget(mVisiCB, row, 1, 1, 2, Qt::AlignLeft);
}
}
row++;
mConstraintsHint = new TextLabel{this};
mConstraintsHint->setTextFormat(Qt::PlainText);
mConstraintsHint->setTextInteractionFlags(Qt::TextSelectableByMouse);
mConstraintsHint->setVisible(false);
grid->addWidget(mConstraintsHint, row, 2);
row++;
mFormattedPassphraseHintSpacer = new QLabel{this};
mFormattedPassphraseHintSpacer->setVisible(false);
mFormattedPassphraseHint = new TextLabel{this};
mFormattedPassphraseHint->setTextFormat(Qt::PlainText);
mFormattedPassphraseHint->setTextInteractionFlags(Qt::TextSelectableByMouse);
mFormattedPassphraseHint->setVisible(false);
grid->addWidget(mFormattedPassphraseHintSpacer, row, 1);
grid->addWidget(mFormattedPassphraseHint, row, 2);
if (!repeatString.isNull()) {
row++;
auto repeatLabel = new QLabel{this};
repeatLabel->setTextFormat(Qt::PlainText);
repeatLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
repeatLabel->setText(repeatString);
grid->addWidget(repeatLabel, row, 1);
mRepeat = new PinLineEdit(this);
mRepeat->setMaxLength(256);
mRepeat->setEchoMode(QLineEdit::Password);
repeatLabel->setBuddy(mRepeat);
grid->addWidget(mRepeat, row, 2);
row++;
mRepeatError = new TextLabel{this};
mRepeatError->setTextFormat(Qt::PlainText);
mRepeatError->setTextInteractionFlags(Qt::TextSelectableByMouse);
mRepeatError->setPalette(redTextPalette);
mRepeatError->hide();
grid->addWidget(mRepeatError, row, 2);
}
if (enable_quality_bar) {
row++;
_quality_bar_label = new QLabel(this);
_quality_bar_label->setTextFormat(Qt::PlainText);
_quality_bar_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
_quality_bar_label->setAlignment(Qt::AlignVCenter);
grid->addWidget(_quality_bar_label, row, 1);
_quality_bar = new QProgressBar(this);
_quality_bar->setAlignment(Qt::AlignCenter);
_quality_bar_label->setBuddy(_quality_bar);
grid->addWidget(_quality_bar, row, 2);
}
hbox->addLayout(grid, 1);
mainLayout->addLayout(hbox);
QDialogButtonBox *const buttons = new QDialogButtonBox(this);
buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
_ok = buttons->button(QDialogButtonBox::Ok);
_cancel = buttons->button(QDialogButtonBox::Cancel);
if (style()->styleHint(QStyle::SH_DialogButtonBox_ButtonsHaveIcons)) {
_ok->setIcon(style()->standardIcon(QStyle::SP_DialogOkButton));
_cancel->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton));
}
mainLayout->addStretch(1);
mainLayout->addWidget(buttons);
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
if (timeout > 0) {
_timer = new QTimer(this);
connect(_timer, &QTimer::timeout, this, &PinEntryDialog::slotTimeout);
_timer->start(timeout * 1000);
}
connect(buttons, &QDialogButtonBox::accepted,
this, &PinEntryDialog::onAccept);
connect(buttons, &QDialogButtonBox::rejected,
this, &QDialog::reject);
connect(_edit, &QLineEdit::textChanged,
this, &PinEntryDialog::updateQuality);
connect(_edit, &QLineEdit::textChanged,
this, &PinEntryDialog::textChanged);
connect(_edit, &PinLineEdit::backspacePressed,
this, &PinEntryDialog::onBackspace);
if (mGenerateButton) {
connect(mGenerateButton, &QPushButton::clicked,
this, &PinEntryDialog::generatePin);
}
if (mVisiActionEdit) {
connect(mVisiActionEdit, &QAction::triggered,
this, &PinEntryDialog::toggleVisibility);
}
if (mVisiCB) {
connect(mVisiCB, &QCheckBox::toggled,
this, &PinEntryDialog::toggleVisibility);
}
if (mRepeat) {
connect(mRepeat, &QLineEdit::textChanged,
this, &PinEntryDialog::textChanged);
}
auto capsLockWatcher = new CapsLockWatcher{this};
connect(capsLockWatcher, &CapsLockWatcher::stateChanged,
this, [this] (bool locked) {
mCapsLockHint->setVisible(locked);
});
connect(qApp, &QApplication::focusChanged,
this, &PinEntryDialog::focusChanged);
connect(qApp, &QApplication::applicationStateChanged,
this, &PinEntryDialog::checkCapsLock);
checkCapsLock();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installActivationObserver(this);
accessibilityActiveChanged(QAccessible::isActive());
#endif
#if QT_VERSION >= 0x050000
/* This is mostly an issue on Windows where this results
in the pinentry popping up nicely with an animation and
comes to front. It is not ifdefed for Windows only since
window managers on Linux like KWin can also have this
result in an animation when the pinentry is shown and
not just popping it up.
*/
if (qApp->platformName() != QLatin1String("wayland")) {
setWindowState(Qt::WindowMinimized);
QTimer::singleShot(0, this, [this] () {
raiseWindow(this);
});
}
#else
activateWindow();
raise();
#endif
}
PinEntryDialog::~PinEntryDialog()
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::removeActivationObserver(this);
#endif
}
void PinEntryDialog::keyPressEvent(QKeyEvent *e)
{
const auto returnPressed =
(!e->modifiers() && (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return))
|| (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter);
if (returnPressed && _edit->hasFocus() && mRepeat) {
// if the user pressed Return in the first input field, then move the
// focus to the repeat input field and prevent further event processing
// by QDialog (which would trigger the default button)
mRepeat->setFocus();
e->ignore();
return;
}
QDialog::keyPressEvent(e);
}
void PinEntryDialog::keyReleaseEvent(QKeyEvent *event)
{
QDialog::keyReleaseEvent(event);
checkCapsLock();
}
void PinEntryDialog::showEvent(QShowEvent *event)
{
QDialog::showEvent(event);
_edit->setFocus();
}
void PinEntryDialog::setDescription(const QString &txt)
{
_desc->setVisible(!txt.isEmpty());
_desc->setText(txt);
Accessibility::setDescription(_desc, txt);
_icon->setPixmap(applicationIconPixmap());
setError(QString());
}
QString PinEntryDialog::description() const
{
return _desc->text();
}
void PinEntryDialog::setError(const QString &txt)
{
if (!txt.isNull()) {
_icon->setPixmap(applicationIconPixmap(QIcon{QStringLiteral(":/icons/data-error.svg")}));
}
_error->setText(txt);
Accessibility::setDescription(_error, txt);
_error->setVisible(!txt.isEmpty());
}
QString PinEntryDialog::error() const
{
return _error->text();
}
void PinEntryDialog::setPin(const QString &txt)
{
_edit->setPin(txt);
}
QString PinEntryDialog::pin() const
{
return _edit->pin();
}
void PinEntryDialog::setPrompt(const QString &txt)
{
_prompt->setText(txt);
_prompt->setVisible(!txt.isEmpty());
if (txt.contains("PIN"))
_disable_echo_allowed = false;
}
QString PinEntryDialog::prompt() const
{
return _prompt->text();
}
void PinEntryDialog::setOkText(const QString &txt)
{
_ok->setText(txt);
Accessibility::setDescription(_ok, txt);
_ok->setVisible(!txt.isEmpty());
}
void PinEntryDialog::setCancelText(const QString &txt)
{
_cancel->setText(txt);
Accessibility::setDescription(_cancel, txt);
_cancel->setVisible(!txt.isEmpty());
}
void PinEntryDialog::setQualityBar(const QString &txt)
{
if (_have_quality_bar) {
_quality_bar_label->setText(txt);
Accessibility::setDescription(_quality_bar_label, txt);
}
}
void PinEntryDialog::setQualityBarTT(const QString &txt)
{
if (_have_quality_bar) {
_quality_bar->setToolTip(txt);
}
}
void PinEntryDialog::setGenpinLabel(const QString &txt)
{
if (!mGenerateButton) {
return;
}
mGenerateButton->setVisible(!txt.isEmpty());
if (!txt.isEmpty()) {
Accessibility::setName(mGenerateButton, txt);
}
}
void PinEntryDialog::setGenpinTT(const QString &txt)
{
if (mGenerateButton) {
mGenerateButton->setToolTip(txt);
}
}
void PinEntryDialog::setCapsLockHint(const QString &txt)
{
mCapsLockHint->setText(txt);
}
void PinEntryDialog::setFormattedPassphrase(const PinEntryDialog::FormattedPassphraseOptions &options)
{
mFormatPassphrase = options.formatPassphrase;
mFormattedPassphraseHint->setTextFormat(Qt::RichText);
mFormattedPassphraseHint->setText(QLatin1String("<html>") + options.hint.toHtmlEscaped() + QLatin1String("</html>"));
Accessibility::setName(mFormattedPassphraseHint, options.hint);
toggleFormattedPassphrase();
}
void PinEntryDialog::setConstraintsOptions(const ConstraintsOptions &options)
{
mEnforceConstraints = options.enforce;
mConstraintsHint->setText(options.shortHint);
if (!options.longHint.isEmpty()) {
mConstraintsHint->setToolTip(QLatin1String("<html>") +
options.longHint.toHtmlEscaped().replace(QLatin1String("\n\n"), QLatin1String("<br>")) +
QLatin1String("</html>"));
Accessibility::setDescription(mConstraintsHint, options.longHint);
}
mConstraintsErrorTitle = options.errorTitle;
mConstraintsHint->setVisible(mEnforceConstraints && !options.shortHint.isEmpty());
}
void PinEntryDialog::toggleFormattedPassphrase()
{
const bool enableFormatting = mFormatPassphrase && _edit->echoMode() == QLineEdit::Normal;
_edit->setFormattedPassphrase(enableFormatting);
if (mRepeat) {
mRepeat->setFormattedPassphrase(enableFormatting);
const bool hintAboutToBeHidden = mFormattedPassphraseHint->isVisible() && !enableFormatting;
if (hintAboutToBeHidden) {
// set hint spacer to current height of hint label before hiding the hint
mFormattedPassphraseHintSpacer->setMinimumHeight(mFormattedPassphraseHint->height());
mFormattedPassphraseHintSpacer->setVisible(true);
} else if (enableFormatting) {
mFormattedPassphraseHintSpacer->setVisible(false);
}
mFormattedPassphraseHint->setVisible(enableFormatting);
}
}
void PinEntryDialog::onBackspace()
{
cancelTimeout();
if (_disable_echo_allowed) {
_edit->setEchoMode(QLineEdit::NoEcho);
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::NoEcho);
}
}
}
void PinEntryDialog::updateQuality(const QString &txt)
{
int length;
int percent;
QPalette pal;
_disable_echo_allowed = false;
if (!_have_quality_bar || !_pinentry_info) {
return;
}
const QByteArray utf8_pin = txt.toUtf8();
const char *pin = utf8_pin.constData();
length = strlen(pin);
percent = length ? pinentry_inq_quality(_pinentry_info, pin, length) : 0;
if (!length) {
_quality_bar->reset();
} else {
pal = _quality_bar->palette();
if (percent < 0) {
pal.setColor(QPalette::Highlight, QColor("red"));
percent = -percent;
} else {
pal.setColor(QPalette::Highlight, QColor("green"));
}
_quality_bar->setPalette(pal);
_quality_bar->setValue(percent);
}
}
void PinEntryDialog::setPinentryInfo(pinentry_t peinfo)
{
_pinentry_info = peinfo;
}
void PinEntryDialog::focusChanged(QWidget *old, QWidget *now)
{
// Grab keyboard. It might be a little weird to do it here, but it works!
// Previously this code was in showEvent, but that did not work in Qt4.
if (!_pinentry_info || _pinentry_info->grab) {
if (_grabbed && old && (old == _edit || old == mRepeat)) {
old->releaseKeyboard();
_grabbed = false;
}
if (!_grabbed && now && (now == _edit || now == mRepeat)) {
now->grabKeyboard();
_grabbed = true;
}
}
}
void PinEntryDialog::textChanged(const QString &text)
{
Q_UNUSED(text);
cancelTimeout();
if (mVisiActionEdit && sender() == _edit) {
mVisiActionEdit->setVisible(!_edit->pin().isEmpty());
}
if (mGenerateButton) {
mGenerateButton->setVisible(
_edit->pin().isEmpty()
#ifndef QT_NO_ACCESSIBILITY
&& !mGenerateButton->accessibleName().isEmpty()
#endif
);
}
}
void PinEntryDialog::generatePin()
{
unique_malloced_ptr<char> pin{pinentry_inq_genpin(_pinentry_info)};
if (pin) {
if (_edit->echoMode() == QLineEdit::Password) {
if (mVisiActionEdit) {
mVisiActionEdit->trigger();
}
if (mVisiCB) {
mVisiCB->setChecked(true);
}
}
const auto pinStr = QString::fromUtf8(pin.get());
_edit->setPin(pinStr);
mRepeat->setPin(pinStr);
// explicitly focus the first input field and select the generated password
_edit->setFocus();
_edit->selectAll();
}
}
void PinEntryDialog::toggleVisibility()
{
if (sender() != mVisiCB) {
if (_edit->echoMode() == QLineEdit::Password) {
if (mVisiActionEdit) {
mVisiActionEdit->setIcon(QIcon(QLatin1String(":/icons/hint.svg")));
mVisiActionEdit->setToolTip(mHideTT);
}
_edit->setEchoMode(QLineEdit::Normal);
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::Normal);
}
} else {
if (mVisiActionEdit) {
mVisiActionEdit->setIcon(QIcon(QLatin1String(":/icons/visibility.svg")));
mVisiActionEdit->setToolTip(mVisibilityTT);
}
_edit->setEchoMode(QLineEdit::Password);
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::Password);
}
}
} else {
if (mVisiCB->isChecked()) {
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::Normal);
}
_edit->setEchoMode(QLineEdit::Normal);
} else {
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::Password);
}
_edit->setEchoMode(QLineEdit::Password);
}
}
toggleFormattedPassphrase();
}
QString PinEntryDialog::repeatedPin() const
{
if (mRepeat) {
return mRepeat->pin();
}
return QString();
}
bool PinEntryDialog::timedOut() const
{
return _timed_out;
}
void PinEntryDialog::setRepeatErrorText(const QString &err)
{
if (mRepeatError) {
mRepeatError->setText(err);
}
}
void PinEntryDialog::cancelTimeout()
{
if (_timer) {
_timer->stop();
}
}
void PinEntryDialog::checkCapsLock()
{
const auto state = capsLockState();
if (state != LockState::Unknown) {
mCapsLockHint->setVisible(state == LockState::On);
}
}
void PinEntryDialog::onAccept()
{
cancelTimeout();
if (mRepeat && mRepeat->pin() != _edit->pin()) {
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
QMessageBox::information(this, mRepeatError->text(), mRepeatError->text());
} else
#endif
{
mRepeatError->setVisible(true);
}
return;
}
const auto result = checkConstraints();
if (result != PassphraseNotOk) {
accept();
}
}
#ifndef QT_NO_ACCESSIBILITY
void PinEntryDialog::accessibilityActiveChanged(bool active)
{
// Allow text labels to get focus if accessibility is active
const auto focusPolicy = active ? Qt::StrongFocus : Qt::ClickFocus;
_error->setFocusPolicy(focusPolicy);
_desc->setFocusPolicy(focusPolicy);
mCapsLockHint->setFocusPolicy(focusPolicy);
mConstraintsHint->setFocusPolicy(focusPolicy);
mFormattedPassphraseHint->setFocusPolicy(focusPolicy);
if (mRepeatError) {
mRepeatError->setFocusPolicy(focusPolicy);
}
}
#endif
PinEntryDialog::PassphraseCheckResult PinEntryDialog::checkConstraints()
{
if (!mEnforceConstraints) {
return PassphraseNotChecked;
}
const auto passphrase = _edit->pin().toUtf8();
unique_malloced_ptr<char> error{pinentry_inq_checkpin(
_pinentry_info, passphrase.constData(), passphrase.size())};
if (!error) {
return PassphraseOk;
}
const auto messageLines = QString::fromUtf8(QByteArray::fromPercentEncoding(error.get())).split(QChar{'\n'});
if (messageLines.isEmpty()) {
// shouldn't happen because pinentry_inq_checkpin() either returns NULL or a non-empty string
return PassphraseOk;
}
const auto firstLine = messageLines.first();
const auto indexOfFirstNonEmptyAdditionalLine = messageLines.indexOf(QRegularExpression{QStringLiteral(".*\\S.*")}, 1);
const auto additionalLines = indexOfFirstNonEmptyAdditionalLine > 0 ? messageLines.mid(indexOfFirstNonEmptyAdditionalLine).join(QChar{'\n'}) : QString{};
QMessageBox messageBox{this};
messageBox.setIcon(QMessageBox::Information);
messageBox.setWindowTitle(mConstraintsErrorTitle);
messageBox.setText(firstLine);
messageBox.setInformativeText(additionalLines);
messageBox.setStandardButtons(QMessageBox::Ok);
messageBox.exec();
return PassphraseNotOk;
}
#include "pinentrydialog.moc"

@ -0,0 +1,181 @@
/* pinentrydialog.h - A (not yet) secure Qt 4 dialog for PIN entry.
* Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB)
* Copyright 2007 Ingo Klöcker
* Copyright 2016 Intevation GmbH
* Copyright (C) 2021, 2022 g10 Code GmbH
*
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
* Modified by Andre Heinecke <aheinecke@intevation.de>
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRYDIALOG_H__
#define __PINENTRYDIALOG_H__
#include <QAccessible>
#include <QDialog>
#include <QStyle>
#include <QTimer>
#include "pinentry.h"
class QIcon;
class QLabel;
class QPushButton;
class QLineEdit;
class PinLineEdit;
class QString;
class QProgressBar;
class QCheckBox;
class QAction;
QPixmap applicationIconPixmap(const QIcon &overlayIcon = {});
void raiseWindow(QWidget *w);
class PinEntryDialog : public QDialog
#ifndef QT_NO_ACCESSIBILITY
, public QAccessible::ActivationObserver
#endif
{
Q_OBJECT
Q_PROPERTY(QString description READ description WRITE setDescription)
Q_PROPERTY(QString error READ error WRITE setError)
Q_PROPERTY(QString pin READ pin WRITE setPin)
Q_PROPERTY(QString prompt READ prompt WRITE setPrompt)
public:
struct FormattedPassphraseOptions
{
bool formatPassphrase;
QString hint;
};
struct ConstraintsOptions
{
bool enforce;
QString shortHint;
QString longHint;
QString errorTitle;
};
explicit PinEntryDialog(QWidget *parent = 0, const char *name = 0,
int timeout = 0, bool modal = false,
bool enable_quality_bar = false,
const QString &repeatString = QString(),
const QString &visibiltyTT = QString(),
const QString &hideTT = QString());
~PinEntryDialog() override;
void setDescription(const QString &);
QString description() const;
void setError(const QString &);
QString error() const;
void setPin(const QString &);
QString pin() const;
QString repeatedPin() const;
void setRepeatErrorText(const QString &);
void setPrompt(const QString &);
QString prompt() const;
void setOkText(const QString &);
void setCancelText(const QString &);
void setQualityBar(const QString &);
void setQualityBarTT(const QString &);
void setGenpinLabel(const QString &);
void setGenpinTT(const QString &);
void setCapsLockHint(const QString &);
void setFormattedPassphrase(const FormattedPassphraseOptions &options);
void setConstraintsOptions(const ConstraintsOptions &options);
void setPinentryInfo(pinentry_t);
bool timedOut() const;
protected Q_SLOTS:
void updateQuality(const QString &);
void slotTimeout();
void textChanged(const QString &);
void focusChanged(QWidget *old, QWidget *now);
void toggleVisibility();
void onBackspace();
void generatePin();
void toggleFormattedPassphrase();
protected:
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void showEvent(QShowEvent *event) override;
private Q_SLOTS:
void cancelTimeout();
void checkCapsLock();
void onAccept();
private:
#ifndef QT_NO_ACCESSIBILITY
void accessibilityActiveChanged(bool active) override;
#endif
enum PassphraseCheckResult {
PassphraseNotChecked = -1,
PassphraseNotOk = 0,
PassphraseOk
};
PassphraseCheckResult checkConstraints();
private:
QLabel *_icon = nullptr;
QLabel *_desc = nullptr;
QLabel *_error = nullptr;
QLabel *_prompt = nullptr;
QLabel *_quality_bar_label = nullptr;
QProgressBar *_quality_bar = nullptr;
PinLineEdit *_edit = nullptr;
PinLineEdit *mRepeat = nullptr;
QLabel *mRepeatError = nullptr;
QPushButton *_ok = nullptr;
QPushButton *_cancel = nullptr;
bool _grabbed = false;
bool _have_quality_bar = false;
bool _timed_out = false;
bool _disable_echo_allowed = true;
bool mEnforceConstraints = false;
bool mFormatPassphrase = false;
pinentry_t _pinentry_info = nullptr;
QTimer *_timer = nullptr;
QString mVisibilityTT;
QString mHideTT;
QAction *mVisiActionEdit = nullptr;
QPushButton *mGenerateButton = nullptr;
QCheckBox *mVisiCB = nullptr;
QLabel *mFormattedPassphraseHint = nullptr;
QLabel *mFormattedPassphraseHintSpacer = nullptr;
QLabel *mCapsLockHint = nullptr;
QLabel *mConstraintsHint = nullptr;
QString mConstraintsErrorTitle;
};
#endif // __PINENTRYDIALOG_H__

@ -0,0 +1,10 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
<file>icons/data-error.svg</file>
<file>icons/document-encrypt.png</file>
<file>icons/hint.svg</file>
<file>icons/password-generate.svg</file>
<file>icons/visibility.svg</file>
</qresource>
</RCC>

@ -0,0 +1,232 @@
/* pinlineedit.cpp - Modified QLineEdit widget.
* Copyright (C) 2018 Damien Goutte-Gattat
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include "pinlineedit.h"
#include <QClipboard>
#include <QGuiApplication>
#include <QKeyEvent>
static const int FormattedPassphraseGroupSize = 5;
static const QChar FormattedPassphraseSeparator = QChar::Nbsp;
namespace
{
struct Selection
{
bool empty() const { return start < 0 || start >= end; }
int length() const { return empty() ? 0 : end - start; }
int start;
int end;
};
}
class PinLineEdit::Private
{
PinLineEdit *const q;
public:
Private(PinLineEdit *q)
: q{q}
{}
QString formatted(QString text) const
{
const int dashCount = text.size() / FormattedPassphraseGroupSize;
text.reserve(text.size() + dashCount);
for (int i = FormattedPassphraseGroupSize; i < text.size(); i += FormattedPassphraseGroupSize + 1) {
text.insert(i, FormattedPassphraseSeparator);
}
return text;
}
Selection formattedSelection(Selection selection) const
{
if (selection.empty()) {
return selection;
}
return {
selection.start + selection.start / FormattedPassphraseGroupSize,
selection.end + (selection.end - 1) / FormattedPassphraseGroupSize
};
}
QString unformatted(QString text) const
{
for (int i = FormattedPassphraseGroupSize; i < text.size(); i += FormattedPassphraseGroupSize) {
text.remove(i, 1);
}
return text;
}
Selection unformattedSelection(Selection selection) const
{
if (selection.empty()) {
return selection;
}
return {
selection.start - selection.start / (FormattedPassphraseGroupSize + 1),
selection.end - selection.end / (FormattedPassphraseGroupSize + 1)
};
}
void copyToClipboard()
{
if (q->echoMode() != QLineEdit::Normal) {
return;
}
QString text = q->selectedText();
if (mFormattedPassphrase) {
text.remove(FormattedPassphraseSeparator);
}
if (!text.isEmpty()) {
QGuiApplication::clipboard()->setText(text);
}
}
int selectionEnd()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return q->selectionEnd();
#else
return q->selectionStart() + q->selectedText().size();
#endif
}
public:
bool mFormattedPassphrase = false;
};
PinLineEdit::PinLineEdit(QWidget *parent)
: QLineEdit(parent)
, d{new Private{this}}
{
connect(this, SIGNAL(textEdited(QString)),
this, SLOT(textEdited()));
}
PinLineEdit::~PinLineEdit() = default;
void PinLineEdit::setFormattedPassphrase(bool on)
{
if (on == d->mFormattedPassphrase) {
return;
}
d->mFormattedPassphrase = on;
Selection selection{selectionStart(), d->selectionEnd()};
if (d->mFormattedPassphrase) {
setText(d->formatted(text()));
selection = d->formattedSelection(selection);
} else {
setText(d->unformatted(text()));
selection = d->unformattedSelection(selection);
}
if (!selection.empty()) {
setSelection(selection.start, selection.length());
}
}
void PinLineEdit::copy() const
{
d->copyToClipboard();
}
void PinLineEdit::cut()
{
if (hasSelectedText()) {
copy();
del();
}
}
void PinLineEdit::setPin(const QString &pin)
{
setText(d->mFormattedPassphrase ? d->formatted(pin) : pin);
}
QString PinLineEdit::pin() const
{
if (d->mFormattedPassphrase) {
return d->unformatted(text());
} else {
return text();
}
}
void PinLineEdit::keyPressEvent(QKeyEvent *e)
{
if (e == QKeySequence::Copy) {
copy();
return;
}
else if (e == QKeySequence::Cut) {
if (!isReadOnly() && hasSelectedText()) {
copy();
del();
}
return;
}
else if (e == QKeySequence::DeleteEndOfLine) {
if (!isReadOnly()) {
setSelection(cursorPosition(), text().size());
copy();
del();
}
return;
}
else if (e == QKeySequence::DeleteCompleteLine) {
if (!isReadOnly()) {
setSelection(0, text().size());
copy();
del();
}
return;
}
QLineEdit::keyPressEvent(e);
if (e->key() == Qt::Key::Key_Backspace) {
emit backspacePressed();
}
}
void PinLineEdit::textEdited()
{
if (!d->mFormattedPassphrase) {
return;
}
auto currentText = text();
// first calculate the cursor position in the reformatted text; the cursor
// is put left of the separators, so that backspace works as expected
auto cursorPos = cursorPosition();
cursorPos -= QStringView{currentText}.left(cursorPos).count(FormattedPassphraseSeparator);
cursorPos += std::max(cursorPos - 1, 0) / FormattedPassphraseGroupSize;
// then reformat the text
currentText.remove(FormattedPassphraseSeparator);
currentText = d->formatted(currentText);
// finally, set reformatted text and updated cursor position
setText(currentText);
setCursorPosition(cursorPos);
}
#include "pinlineedit.moc"

@ -0,0 +1,63 @@
/* pinlineedit.h - Modified QLineEdit widget.
* Copyright (C) 2018 Damien Goutte-Gattat
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _PINLINEEDIT_H_
#define _PINLINEEDIT_H_
#include <QLineEdit>
#include <memory>
class PinLineEdit : public QLineEdit
{
Q_OBJECT
public:
explicit PinLineEdit(QWidget *parent = nullptr);
~PinLineEdit() override;
void setPin(const QString &pin);
QString pin() const;
public Q_SLOTS:
void setFormattedPassphrase(bool on);
void copy() const;
void cut();
Q_SIGNALS:
void backspacePressed();
protected:
void keyPressEvent(QKeyEvent *) override;
private:
using QLineEdit::setText;
using QLineEdit::text;
private Q_SLOTS:
void textEdited();
private:
class Private;
std::unique_ptr<Private> d;
};
#endif // _PINLINEEDIT_H_

@ -0,0 +1,93 @@
/* qti18n.cpp - Load qt translations for pinentry.
* Copyright 2021 g10 Code GmbH
* SPDX-FileCopyrightText: 2015 Lukáš Tinkl <ltinkl@redhat.com>
* SPDX-FileCopyrightText: 2021 Ingo Klöcker <kloecker@kde.org>
*
* Copied from k18n under the terms of LGPLv2 or later.
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include <QDebug>
#include <QCoreApplication>
#include <QLibraryInfo>
#include <QLocale>
#include <QTranslator>
#include <memory>
static bool loadCatalog(const QString &catalog, const QLocale &locale)
{
auto translator = new QTranslator(QCoreApplication::instance());
if (!translator->load(locale, catalog, QString(), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
qDebug() << "Loading the" << catalog << "catalog failed for locale" << locale;
delete translator;
return false;
}
QCoreApplication::instance()->installTranslator(translator);
return true;
}
static bool loadCatalog(const QString &catalog, const QLocale &locale, const QLocale &fallbackLocale)
{
// try to load the catalog for locale
if (loadCatalog(catalog, locale)) {
return true;
}
// if this fails, then try the fallback locale (if it's different from locale)
if (fallbackLocale != locale) {
return loadCatalog(catalog, fallbackLocale);
}
return false;
}
// load global Qt translation, needed in KDE e.g. by lots of builtin dialogs (QColorDialog, QFontDialog) that we use
static void loadTranslation(const QString &localeName, const QString &fallbackLocaleName)
{
const QLocale locale{localeName};
const QLocale fallbackLocale{fallbackLocaleName};
// first, try to load the qt_ meta catalog
if (loadCatalog(QStringLiteral("qt_"), locale, fallbackLocale)) {
return;
}
// if loading the meta catalog failed, then try loading the four catalogs
// it depends on, i.e. qtbase, qtscript, qtmultimedia, qtxmlpatterns, separately
const auto catalogs = {
QStringLiteral("qtbase_"),
/* QStringLiteral("qtscript_"),
QStringLiteral("qtmultimedia_"),
QStringLiteral("qtxmlpatterns_"), */
};
for (const auto &catalog : catalogs) {
loadCatalog(catalog, locale, fallbackLocale);
}
}
static void load()
{
// The way Qt translation system handles plural forms makes it necessary to
// have a translation file which contains only plural forms for `en`. That's
// why we load the `en` translation unconditionally, then load the
// translation for the current locale to overload it.
loadCatalog(QStringLiteral("qt_"), QLocale{QStringLiteral("en")});
const QLocale locale = QLocale::system();
if (locale.name() != QStringLiteral("en")) {
loadTranslation(locale.name(), locale.bcp47Name());
}
}
Q_COREAPP_STARTUP_FUNCTION(load)

@ -0,0 +1,40 @@
/* util.h - Helper for managing malloced pointers
* Copyright (C) 2021 g10 Code GmbH
*
* Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __PINENTRY_QT_UTIL_H__
#define __PINENTRY_QT_UTIL_H__
#include <memory>
#include <stdlib.h>
namespace _detail
{
struct FreeDeleter {
void operator()(void *ptr) const {
free(ptr);
}
};
}
template<class T>
using unique_malloced_ptr = std::unique_ptr<T, _detail::FreeDeleter>;
#endif // __PINENTRY_QT_UTIL_H__

@ -20,7 +20,7 @@
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = pinentry-qt
bin_PROGRAMS = pinentry-qt4
EXTRA_DIST = document-encrypt.png pinentry.qrc
@ -37,22 +37,26 @@ endif
AM_CPPFLAGS = $(COMMON_CFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)/secmem \
$(ncurses_include) -I$(top_srcdir)/pinentry
AM_CXXFLAGS = $(PINENTRY_QT_CFLAGS)
pinentry_qt_LDADD = \
AM_CXXFLAGS = $(PINENTRY_QT4_CFLAGS)
pinentry_qt4_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_QT_LIBS) $(libcurses) $(LIBCAP)
$(COMMON_LIBS) $(PINENTRY_QT4_LIBS) $(libcurses) $(LIBCAP)
pinentry_qt4_LDFLAGS = $(PINENTRY_QT4_LDFLAGS)
if BUILD_PINENTRY_QT4
BUILT_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
endif
CLEANFILES = \
pinentryconfirm.moc pinentrydialog.moc
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
pinentry_qt_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h
pinentry_qt4_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h \
pinlineedit.h pinlineedit.cpp
nodist_pinentry_qt_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc
nodist_pinentry_qt4_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
.h.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
$(MOC4) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -35,7 +35,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -98,38 +108,39 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-qt$(EXEEXT)
subdir = qt
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
bin_PROGRAMS = pinentry-qt4$(EXEEXT)
subdir = qt4
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_pinentry_qt_OBJECTS = pinentrydialog.$(OBJEXT) main.$(OBJEXT) \
qrc_pinentry.$(OBJEXT) pinentryconfirm.$(OBJEXT)
nodist_pinentry_qt_OBJECTS =
pinentry_qt_OBJECTS = $(am_pinentry_qt_OBJECTS) \
$(nodist_pinentry_qt_OBJECTS)
am_pinentry_qt4_OBJECTS = pinentrydialog.$(OBJEXT) main.$(OBJEXT) \
qrc_pinentry.$(OBJEXT) pinentryconfirm.$(OBJEXT) \
pinlineedit.$(OBJEXT)
nodist_pinentry_qt4_OBJECTS =
pinentry_qt4_OBJECTS = $(am_pinentry_qt4_OBJECTS) \
$(nodist_pinentry_qt4_OBJECTS)
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_qt_DEPENDENCIES = ../pinentry/libpinentry.a \
pinentry_qt4_DEPENDENCIES = ../pinentry/libpinentry.a \
$(top_builddir)/secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
pinentry_qt4_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(pinentry_qt4_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -144,7 +155,10 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/main.Po \
./$(DEPDIR)/pinentryconfirm.Po ./$(DEPDIR)/pinentrydialog.Po \
./$(DEPDIR)/pinlineedit.Po ./$(DEPDIR)/qrc_pinentry.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -171,8 +185,8 @@ 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 =
SOURCES = $(pinentry_qt_SOURCES) $(nodist_pinentry_qt_SOURCES)
DIST_SOURCES = $(pinentry_qt_SOURCES)
SOURCES = $(pinentry_qt4_SOURCES) $(nodist_pinentry_qt4_SOURCES)
DIST_SOURCES = $(pinentry_qt4_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -197,6 +211,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -221,6 +237,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -230,6 +248,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -243,11 +262,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -256,6 +276,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -264,6 +286,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -277,16 +301,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -336,6 +367,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -353,22 +385,24 @@ AM_CPPFLAGS = $(COMMON_CFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)/secmem \
$(ncurses_include) -I$(top_srcdir)/pinentry
AM_CXXFLAGS = $(PINENTRY_QT_CFLAGS)
pinentry_qt_LDADD = \
AM_CXXFLAGS = $(PINENTRY_QT4_CFLAGS)
pinentry_qt4_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_QT_LIBS) $(libcurses) $(LIBCAP)
$(COMMON_LIBS) $(PINENTRY_QT4_LIBS) $(libcurses) $(LIBCAP)
BUILT_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc
pinentry_qt4_LDFLAGS = $(PINENTRY_QT4_LDFLAGS)
@BUILD_PINENTRY_QT4_TRUE@BUILT_SOURCES = \
@BUILD_PINENTRY_QT4_TRUE@ pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
CLEANFILES = \
pinentryconfirm.moc pinentrydialog.moc
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
pinentry_qt_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h
pinentry_qt4_SOURCES = pinentrydialog.h pinentrydialog.cpp \
main.cpp qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h \
pinlineedit.h pinlineedit.cpp
nodist_pinentry_qt_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc
nodist_pinentry_qt4_SOURCES = \
pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
@ -384,17 +418,16 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu qt/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu qt4/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu qt/Makefile
.PRECIOUS: Makefile
$(AUTOMAKE) --gnu qt4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -448,9 +481,9 @@ uninstall-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
pinentry-qt$(EXEEXT): $(pinentry_qt_OBJECTS) $(pinentry_qt_DEPENDENCIES) $(EXTRA_pinentry_qt_DEPENDENCIES)
@rm -f pinentry-qt$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(pinentry_qt_OBJECTS) $(pinentry_qt_LDADD) $(LIBS)
pinentry-qt4$(EXEEXT): $(pinentry_qt4_OBJECTS) $(pinentry_qt4_DEPENDENCIES) $(EXTRA_pinentry_qt4_DEPENDENCIES)
@rm -f pinentry-qt4$(EXEEXT)
$(AM_V_CXXLD)$(pinentry_qt4_LINK) $(pinentry_qt4_OBJECTS) $(pinentry_qt4_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@ -458,10 +491,17 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentryconfirm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentrydialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qrc_pinentry.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentryconfirm.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentrydialog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinlineedit.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qrc_pinentry.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -529,7 +569,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -569,7 +612,8 @@ installdirs:
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-exec: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@ -605,7 +649,11 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentryconfirm.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/pinlineedit.Po
-rm -f ./$(DEPDIR)/qrc_pinentry.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -651,7 +699,11 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentryconfirm.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/pinlineedit.Po
-rm -f ./$(DEPDIR)/qrc_pinentry.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -669,9 +721,9 @@ ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: all check install install-am install-strip
.MAKE: all check install install-am install-exec install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -685,9 +737,11 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
.h.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
$(MOC4) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -30,12 +30,16 @@
#include "pinentrydialog.h"
#include "pinentry.h"
#include <qapplication.h>
#include <QApplication>
#include <QDebug>
#include <QIcon>
#include <QString>
#include <qwidget.h>
#include <qmessagebox.h>
#include <QMessageBox>
#include <QPushButton>
#include <QString>
#include <QWidget>
#if QT_VERSION >= 0x050000
#include <QWindow>
#endif
#include <stdio.h>
#include <stdlib.h>
@ -61,6 +65,10 @@
#endif
#endif
#ifdef Q_OS_WIN
#include <windows.h>
#endif
static QString escape_accel(const QString &s)
{
@ -97,22 +105,6 @@ static QString escape_accel(const QString &s)
return result;
}
/* Hack for creating a QWidget with a "foreign" window ID */
class ForeignWidget : public QWidget
{
public:
explicit ForeignWidget(WId wid) : QWidget(0)
{
QWidget::destroy();
create(wid, false, false);
}
~ForeignWidget()
{
destroy(false, false);
}
};
namespace
{
class InvalidUtf8 : public std::invalid_argument
@ -139,17 +131,46 @@ static QString from_utf8(const char *s)
return result;
}
static void
setup_foreground_window(QWidget *widget, WId parentWid)
{
#if QT_VERSION >= 0x050000
/* For windows set the desktop window as the transient parent */
QWindow *parentWindow = nullptr;
if (parentWid) {
parentWindow = QWindow::fromWinId(parentWid);
}
#ifdef Q_OS_WIN
if (!parentWindow) {
HWND desktop = GetDesktopWindow();
if (desktop) {
parentWindow = QWindow::fromWinId((WId) desktop);
}
}
#endif
if (parentWindow) {
// Ensure that we have a native wid
widget->winId();
QWindow *wndHandle = widget->windowHandle();
if (wndHandle) {
wndHandle->setTransientParent(parentWindow);
}
}
#endif
widget->setWindowFlags(Qt::Window |
Qt::CustomizeWindowHint |
Qt::WindowTitleHint |
Qt::WindowCloseButtonHint |
Qt::WindowStaysOnTopHint |
Qt::WindowMinimizeButtonHint);
}
static int
qt_cmd_handler(pinentry_t pe)
{
QWidget *parent = 0;
char *str;
/* FIXME: Add parent window ID to pinentry and GTK. */
if (pe->parent_wid) {
parent = new ForeignWidget((WId) pe->parent_wid);
}
int want_pass = !!pe->pin;
const QString ok =
@ -180,17 +201,24 @@ qt_cmd_handler(pinentry_t pe)
pe->default_tt_hide ? from_utf8(pe->default_tt_hide) :
QLatin1String("Hide passphrase");
const QString generateLbl = pe->genpin_label ? from_utf8(pe->genpin_label) :
QString();
const QString generateTT = pe->genpin_tt ? from_utf8(pe->genpin_tt) :
QString();
if (want_pass) {
char *str;
PinEntryDialog pinentry(parent, 0, pe->timeout, true, !!pe->quality_bar,
PinEntryDialog pinentry(NULL, 0, pe->timeout, true, !!pe->quality_bar,
repeatString, visibilityTT, hideTT);
setup_foreground_window(&pinentry, pe->parent_wid);
pinentry.setPinentryInfo(pe);
pinentry.setPrompt(escape_accel(from_utf8(pe->prompt)));
pinentry.setDescription(from_utf8(pe->description));
pinentry.setRepeatErrorText(repeatError);
pinentry.setGenpinLabel(generateLbl);
pinentry.setGenpinTT(generateTT);
str = pinentry_get_title (pe);
if (str) {
@ -247,7 +275,8 @@ qt_cmd_handler(pinentry_t pe)
pe->notok ? QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel :
/* else */ QMessageBox::Ok | QMessageBox::Cancel ;
PinentryConfirm box(QMessageBox::Information, pe->timeout, title, desc, buttons, parent);
PinentryConfirm box(QMessageBox::Information, pe->timeout, title, desc, buttons, NULL);
setup_foreground_window(&box, pe->parent_wid);
const struct {
QMessageBox::StandardButton button;
@ -312,6 +341,7 @@ main(int argc, char *argv[])
pinentry_init("pinentry-qt");
QApplication *app = NULL;
int new_argc = 0;
#ifdef FALLBACK_CURSES
if (!pinentry_have_display(argc, argv)) {
@ -351,8 +381,15 @@ main(int argc, char *argv[])
p += strlen(argv[i]) + 1;
}
i = argc;
app = new QApplication(i, new_argv);
/* Note: QApplication uses int &argc so argc has to be valid
* for the full lifetime of the application.
*
* As Qt might modify argc / argv we use copies here so that
* we do not loose options that are handled in both. e.g. display.
*/
new_argc = argc;
Q_ASSERT (new_argc);
app = new QApplication(new_argc, new_argv);
app->setWindowIcon(QIcon(QLatin1String(":/document-encrypt.png")));
}

@ -26,6 +26,7 @@
#include <QProgressBar>
#include <QApplication>
#include <QFontMetrics>
#include <QStyle>
#include <QPainter>
#include <QPushButton>
@ -36,71 +37,28 @@
#include <QLineEdit>
#include <QAction>
#include <QCheckBox>
#include "pinlineedit.h"
#include <QDebug>
#ifdef Q_OS_WIN
#include <windows.h>
#if QT_VERSION >= 0x050700
#include <QtPlatformHeaders/QWindowsWindowFunctions>
#endif
/* I [wk] have no idea for what this code was supposed to do.
Foregrounding a window is heavily restricted by modern Windows
versions. This is the reason why gpg-agent employs its
AllowSetForegroundWindow callback machinery to ask the supposed to
be be calling process to allow a pinentry to go into the
foreground.
[ah] This is a Hack to workaround the fact that Foregrounding
a Window is so restricted that it AllowSetForegroundWindow
does not always work (e.g. when the ForegroundWindow timeout
has not expired.
*/
#ifdef Q_OS_WIN
WINBOOL SetForegroundWindowEx(HWND hWnd)
{
//Attach foreground window thread to our thread
const DWORD ForeGroundID = GetWindowThreadProcessId(::GetForegroundWindow(), NULL);
const DWORD CurrentID = GetCurrentThreadId();
WINBOOL retval;
AttachThreadInput(ForeGroundID, CurrentID, TRUE);
//Do our stuff here
HWND hLastActivePopupWnd = GetLastActivePopup(hWnd);
retval = SetForegroundWindow(hLastActivePopupWnd);
//Detach the attached thread
AttachThreadInput(ForeGroundID, CurrentID, FALSE);
return retval;
}// End SetForegroundWindowEx
#endif
void raiseWindow(QWidget *w)
{
/* Maybe Qt will become aggressive enough one day that
* this is enough on windows too*/
w->raise();
#ifdef Q_OS_WIN
HWND wid = (HWND)w->effectiveWinId();
/* In the meantime we do our own attention grabbing */
if (!SetForegroundWindow(wid) && !SetForegroundWindowEx(wid)) {
OutputDebugString("SetForegroundWindow (ex) failed");
/* Yet another fallback which will not work on some
* versions and is not recommended by msdn */
if (!ShowWindow(wid, SW_SHOWNORMAL)) {
OutputDebugString("ShowWindow failed.");
}
}
/* Even if SetForgeoundWindow / SetForegroundWinowEx don't fail
* we sometimes are still not in the foreground. So we try yet
* another hack by using SetWindowPos */
if (!SetWindowPos(wid, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW)) {
OutputDebugString("SetWindowPos failed.");
} else {
/* Without moving back to NOTOPMOST we just stay on top.
* Even if the user changes focus. */
SetWindowPos(wid, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
}
#if QT_VERSION >= 0x050700
QWindowsWindowFunctions::setWindowActivationBehavior(
QWindowsWindowFunctions::AlwaysActivateWindow);
#endif
#endif
w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
w->activateWindow();
w->raise();
}
QPixmap icon(QStyle::StandardPixmap which)
@ -129,16 +87,17 @@ PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
const QString &repeatString,
const QString &visibilityTT,
const QString &hideTT)
: QDialog(parent, Qt::WindowStaysOnTopHint),
: QDialog(parent),
mRepeat(NULL),
_grabbed(false),
_disable_echo_allowed(true),
mVisibilityTT(visibilityTT),
mHideTT(hideTT),
mVisiActionEdit(NULL),
mGenerateActionEdit(NULL),
mVisiCB(NULL)
{
_timed_out = false;
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (modal) {
setWindowModality(Qt::ApplicationModal);
@ -159,8 +118,9 @@ PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
_prompt = new QLabel(this);
_prompt->hide();
_edit = new QLineEdit(this);
_edit = new PinLineEdit(this);
_edit->setMaxLength(256);
_edit->setMinimumWidth(_edit->fontMetrics().averageCharWidth()*20 + 48);
_edit->setEchoMode(QLineEdit::Password);
_prompt->setBuddy(_edit);
@ -201,8 +161,8 @@ PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
this, SLOT(updateQuality(QString)));
connect(_edit, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
_edit->setFocus();
connect(_edit, SIGNAL(backspacePressed()),
this, SLOT(onBackspace()));
QGridLayout *const grid = new QGridLayout(this);
int row = 1;
@ -231,7 +191,15 @@ PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
/* Set up the show password action */
const QIcon visibilityIcon = QIcon::fromTheme(QLatin1String("visibility"));
const QIcon hideIcon = QIcon::fromTheme(QLatin1String("hint"));
const QIcon generateIcon = QIcon(); /* Disabled for now
QIcon::fromTheme(QLatin1String("password-generate")); */
#if QT_VERSION >= 0x050200
if (!generateIcon.isNull()) {
mGenerateActionEdit = _edit->addAction(generateIcon,
QLineEdit::LeadingPosition);
mGenerateActionEdit->setToolTip(mGenerateTT);
connect(mGenerateActionEdit, SIGNAL(triggered()), this, SLOT(generatePin()));
}
if (!visibilityIcon.isNull() && !hideIcon.isNull()) {
mVisiActionEdit = _edit->addAction(visibilityIcon, QLineEdit::TrailingPosition);
mVisiActionEdit->setVisible(false);
@ -255,12 +223,29 @@ PinEntryDialog::PinEntryDialog(QWidget *parent, const char *name,
connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget *)),
this, SLOT(focusChanged(QWidget *, QWidget *)));
#if QT_VERSION >= 0x050000
/* This is mostly an issue on Windows where this results
in the pinentry popping up nicely with an animation and
comes to front. It is not ifdefed for Windows only since
window managers on Linux like KWin can also have this
result in an animation when the pinentry is shown and
not just popping it up.
*/
setWindowState(Qt::WindowMinimized);
QTimer::singleShot(0, this, [this] () {
raiseWindow (this);
});
#else
activateWindow();
raise();
#endif
}
void PinEntryDialog::showEvent(QShowEvent *event)
{
QDialog::showEvent(event);
raiseWindow(this);
_edit->setFocus();
}
void PinEntryDialog::setDescription(const QString &txt)
@ -271,7 +256,7 @@ void PinEntryDialog::setDescription(const QString &txt)
_desc->setAccessibleDescription(txt);
#endif
_icon->setPixmap(icon());
setError(QString::null);
setError(QString());
}
QString PinEntryDialog::description() const
@ -310,6 +295,8 @@ void PinEntryDialog::setPrompt(const QString &txt)
{
_prompt->setText(txt);
_prompt->setVisible(!txt.isEmpty());
if (txt.contains("PIN"))
_disable_echo_allowed = false;
}
QString PinEntryDialog::prompt() const
@ -352,6 +339,36 @@ void PinEntryDialog::setQualityBarTT(const QString &txt)
}
}
void PinEntryDialog::setGenpinLabel(const QString &txt)
{
if (!mGenerateActionEdit) {
return;
}
if (txt.isEmpty()) {
mGenerateActionEdit->setVisible(false);
} else {
mGenerateActionEdit->setText(txt);
mGenerateActionEdit->setVisible(true);
}
}
void PinEntryDialog::setGenpinTT(const QString &txt)
{
if (mGenerateActionEdit) {
mGenerateActionEdit->setToolTip(txt);
}
}
void PinEntryDialog::onBackspace()
{
if (_disable_echo_allowed) {
_edit->setEchoMode(QLineEdit::NoEcho);
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::NoEcho);
}
}
}
void PinEntryDialog::updateQuality(const QString &txt)
{
int length;
@ -362,6 +379,8 @@ void PinEntryDialog::updateQuality(const QString &txt)
_timer->stop();
}
_disable_echo_allowed = false;
if (!_have_quality_bar || !_pinentry_info) {
return;
}
@ -420,11 +439,28 @@ void PinEntryDialog::textChanged(const QString &text)
if (mVisiActionEdit && sender() == _edit) {
mVisiActionEdit->setVisible(!_edit->text().isEmpty());
}
if (mGenerateActionEdit) {
mGenerateActionEdit->setVisible(_edit->text().isEmpty() &&
_pinentry_info->genpin_label);
}
}
void PinEntryDialog::generatePin()
{
const char *pin = pinentry_inq_genpin(_pinentry_info);
if (pin) {
if (_edit->echoMode() == QLineEdit::Password) {
toggleVisibility();
}
const QString pinStr = QString::fromUtf8(pin);
_edit->setText(pinStr);
mRepeat->setText(pinStr);
}
}
void PinEntryDialog::toggleVisibility()
{
if (sender() == mVisiActionEdit) {
if (sender() != mVisiCB) {
if (_edit->echoMode() == QLineEdit::Password) {
mVisiActionEdit->setIcon(QIcon::fromTheme(QLatin1String("hint")));
mVisiActionEdit->setToolTip(mHideTT);
@ -440,8 +476,7 @@ void PinEntryDialog::toggleVisibility()
mRepeat->setEchoMode(QLineEdit::Password);
}
}
}
if (sender() == mVisiCB) {
} else {
if (mVisiCB->isChecked()) {
if (mRepeat) {
mRepeat->setEchoMode(QLineEdit::Normal);

@ -33,6 +33,7 @@
class QLabel;
class QPushButton;
class QLineEdit;
class PinLineEdit;
class QString;
class QProgressBar;
class QCheckBox;
@ -79,6 +80,9 @@ public:
void setQualityBar(const QString &);
void setQualityBarTT(const QString &);
void setGenpinLabel(const QString &);
void setGenpinTT(const QString &);
void setPinentryInfo(pinentry_t);
bool timedOut() const;
@ -89,6 +93,8 @@ protected slots:
void textChanged(const QString &);
void focusChanged(QWidget *old, QWidget *now);
void toggleVisibility();
void onBackspace();
void generatePin();
protected:
/* reimp */ void showEvent(QShowEvent *event);
@ -100,19 +106,22 @@ private:
QLabel *_prompt;
QLabel *_quality_bar_label;
QProgressBar *_quality_bar;
QLineEdit *_edit;
QLineEdit *mRepeat;
PinLineEdit *_edit;
QLineEdit *mRepeat;
QPushButton *_ok;
QPushButton *_cancel;
bool _grabbed;
bool _have_quality_bar;
bool _timed_out;
bool _disable_echo_allowed;
pinentry_t _pinentry_info;
QTimer *_timer;
QString mRepeatError,
mVisibilityTT,
mGenerateTT,
mHideTT;
QAction *mVisiActionEdit;
QAction *mVisiActionEdit,
*mGenerateActionEdit;
QCheckBox *mVisiCB;
};

@ -0,0 +1,36 @@
/* pinlineedit.cpp - Modified QLineEdit widget.
* Copyright (C) 2018 Damien Goutte-Gattat
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#include "pinlineedit.h"
#include <QKeyEvent>
PinLineEdit::PinLineEdit(QWidget *parent) : QLineEdit(parent)
{
}
void
PinLineEdit::keyPressEvent(QKeyEvent *e)
{
QLineEdit::keyPressEvent(e);
if ( e->key() == Qt::Key_Backspace )
emit backspacePressed();
}
#include "pinlineedit.moc"

@ -0,0 +1,38 @@
/* pinlineedit.h - Modified QLineEdit widget.
* Copyright (C) 2018 Damien Goutte-Gattat
*
* This program 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.
*
* This program 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, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _PINLINEEDIT_H_
#define _PINLINEEDIT_H_
#include <QLineEdit>
class PinLineEdit : public QLineEdit
{
Q_OBJECT
public:
PinLineEdit(QWidget *);
signals:
void backspacePressed();
protected:
void keyPressEvent(QKeyEvent *);
};
#endif // _PINLINEEDIT_H_

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -98,16 +108,15 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = secmem
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -137,7 +146,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/secmem.Po ./$(DEPDIR)/util.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -177,6 +187,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -201,6 +213,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -210,6 +224,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -223,11 +238,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -236,6 +252,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -244,6 +262,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -257,16 +277,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -316,6 +343,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -349,14 +377,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu secmem/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu secmem/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -382,8 +409,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secmem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secmem.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -451,7 +484,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -520,7 +556,8 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/secmem.Po
-rm -f ./$(DEPDIR)/util.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -566,7 +603,8 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/secmem.Po
-rm -f ./$(DEPDIR)/util.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -586,18 +624,20 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.

@ -31,9 +31,6 @@
# include <sys/mman.h>
# include <sys/types.h>
# include <fcntl.h>
# ifdef USE_CAPABILITIES
# include <sys/capability.h>
# endif
#endif
#include <string.h>
@ -51,7 +48,7 @@ typedef union {
short b;
char c[1];
long d;
#ifdef HAVE_U64_TYPEDEF
#ifdef HAVE_U64_TYPE
u64 e;
#endif
float f;
@ -103,7 +100,9 @@ struct memblock_struct {
static void *pool;
static volatile int pool_okay; /* may be checked in an atexit function */
#if HAVE_MMAP
static int pool_is_mmapped;
#endif
static size_t poolsize; /* allocated length */
static size_t poollen; /* used length */
static MEMBLOCK *unused_blocks;
@ -128,26 +127,7 @@ print_warn(void)
static void
lock_pool( void *p, size_t n )
{
#if defined(USE_CAPABILITIES) && defined(HAVE_MLOCK)
int err;
cap_set_proc( cap_from_text("cap_ipc_lock+ep") );
err = mlock( p, n );
if( err && errno )
err = errno;
cap_set_proc( cap_from_text("cap_ipc_lock+p") );
if( err ) {
if( errno != EPERM
#ifdef EAGAIN /* OpenBSD returns this */
&& errno != EAGAIN
#endif
)
log_error("can't lock memory: %s\n", strerror(err));
show_warning = 1;
}
#elif defined(HAVE_MLOCK)
#if defined(HAVE_MLOCK)
uid_t uid;
int err;
@ -156,17 +136,13 @@ lock_pool( void *p, size_t n )
#ifdef HAVE_BROKEN_MLOCK
if( uid ) {
errno = EPERM;
err = errno;
err = -1;
}
else {
err = mlock( p, n );
if( err && errno )
err = errno;
}
#else
err = mlock( p, n );
if( err && errno )
err = errno;
#endif
if( uid && !geteuid() ) {
@ -180,11 +156,13 @@ lock_pool( void *p, size_t n )
&& errno != EAGAIN
#endif
)
log_error("can't lock memory: %s\n", strerror(err));
log_error("can't lock memory: %s\n", strerror(errno));
show_warning = 1;
}
#else
(void)p;
(void)n;
log_info("Please note that you don't have secure memory on this system\n");
#endif
}
@ -193,20 +171,22 @@ lock_pool( void *p, size_t n )
static void
init_pool( size_t n)
{
#if HAVE_MMAP
size_t pgsize;
#endif
poolsize = n;
if( disable_secmem )
log_bug("secure memory is disabled");
#if HAVE_MMAP
#ifdef HAVE_GETPAGESIZE
pgsize = getpagesize();
#else
pgsize = 4096;
#endif
#if HAVE_MMAP
poolsize = (poolsize + pgsize -1 ) & ~(pgsize-1);
# ifdef MAP_ANONYMOUS
pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE,
@ -284,11 +264,7 @@ void
secmem_init( size_t n )
{
if( !n ) {
#ifdef USE_CAPABILITIES
/* drop all capabilities */
cap_set_proc( cap_from_text("all-eip") );
#elif !defined(HAVE_DOSISH_SYSTEM)
#if !defined(HAVE_DOSISH_SYSTEM)
uid_t uid;
disable_secmem=1;

@ -22,21 +22,20 @@
#include <sys/types.h>
#ifndef HAVE_BYTE_TYPEDEF
#ifndef HAVE_TYPE_BYTE
# undef byte
# ifdef __riscos__
/* Norcroft treats char == unsigned char but char* != unsigned char* */
typedef char byte;
# else
typedef unsigned char byte;
# if !(defined(_WIN32) && defined(cbNDRContext))
/* Windows typedefs byte in the rpc headers. Avoid warning about
double definition. */
typedef unsigned char byte;
# endif
# define HAVE_BYTE_TYPEDEF
# define HAVE_TYPE_BYTE
#endif
#ifndef HAVE_ULONG_TYPEDEF
#ifndef HAVE_TYPE_ULONG
# undef ulong
typedef unsigned long ulong;
# define HAVE_ULONG_TYPEDEF
# define HAVE_TYPE_ULONG
#endif

@ -38,10 +38,12 @@ AM_CPPFLAGS = $(COMMON_CFLAGS) \
AM_CXXFLAGS = $(PINENTRY_TQT_CFLAGS)
pinentry_tqt_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_TQT_LIBS) $(libcurses) $(LIBCAP)
$(COMMON_LIBS) $(PINENTRY_TQT_LIBS) $(libcurses)
if BUILD_PINENTRY_TQT
BUILT_SOURCES = \
secqlineedit.moc pinentrydialog.moc
endif
CLEANFILES = \
secqlineedit.moc pinentrydialog.moc

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -35,7 +35,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -100,16 +110,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-tqt$(EXEEXT)
subdir = tqt
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -129,8 +138,7 @@ am__DEPENDENCIES_1 =
@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1)
pinentry_tqt_DEPENDENCIES = ../pinentry/libpinentry.a \
$(top_builddir)/secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -145,7 +153,10 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/main.Po \
./$(DEPDIR)/pinentrydialog.Po ./$(DEPDIR)/secqinternal.Po \
./$(DEPDIR)/secqlineedit.Po ./$(DEPDIR)/secqstring.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -198,6 +209,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -222,6 +235,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -231,6 +246,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -244,11 +260,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -257,6 +274,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -265,6 +284,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -278,16 +299,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -337,6 +365,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -356,10 +385,10 @@ AM_CPPFLAGS = $(COMMON_CFLAGS) \
AM_CXXFLAGS = $(PINENTRY_TQT_CFLAGS)
pinentry_tqt_LDADD = \
../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \
$(COMMON_LIBS) $(PINENTRY_TQT_LIBS) $(libcurses) $(LIBCAP)
$(COMMON_LIBS) $(PINENTRY_TQT_LIBS) $(libcurses)
BUILT_SOURCES = \
secqlineedit.moc pinentrydialog.moc
@BUILD_PINENTRY_TQT_TRUE@BUILT_SOURCES = \
@BUILD_PINENTRY_TQT_TRUE@ secqlineedit.moc pinentrydialog.moc
CLEANFILES = \
secqlineedit.moc pinentrydialog.moc
@ -389,14 +418,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tqt/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tqt/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -460,11 +488,17 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentrydialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqinternal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqlineedit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqstring.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentrydialog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqinternal.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqlineedit.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqstring.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -532,7 +566,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -572,7 +609,8 @@ installdirs:
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-exec: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@ -608,7 +646,11 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/secqinternal.Po
-rm -f ./$(DEPDIR)/secqlineedit.Po
-rm -f ./$(DEPDIR)/secqstring.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -654,7 +696,11 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/pinentrydialog.Po
-rm -f ./$(DEPDIR)/secqinternal.Po
-rm -f ./$(DEPDIR)/secqlineedit.Po
-rm -f ./$(DEPDIR)/secqstring.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -672,9 +718,9 @@ ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: all check install install-am install-strip
.MAKE: all check install install-am install-exec install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -688,6 +734,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
.h.moc:
$(TQT_MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@

@ -32,7 +32,8 @@
PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
bool modal, bool enable_quality_bar )
: TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false )
: TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false ),
_disable_echo_allowed ( true )
{
TQBoxLayout* top = new TQVBoxLayout( this, 6 );
TQBoxLayout* upperLayout = new TQHBoxLayout( top );
@ -89,6 +90,8 @@ PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
this, SIGNAL( rejected() ) );
connect( _edit, SIGNAL( textModified(const SecTQString&) ),
this, SLOT( updateQuality(const SecTQString&) ) );
connect (_edit, SIGNAL (backspacePressed()),
this, SLOT (onBackspace ()));
connect (this, SIGNAL (accepted ()),
this, SLOT (accept ()));
connect (this, SIGNAL (rejected ()),
@ -131,6 +134,8 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )
int percent;
TQPalette pal;
_disable_echo_allowed = false;
if (!_have_quality_bar || !_pinentry_info)
return;
pin = (char*)txt.utf8();
@ -159,6 +164,13 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )
}
void PinEntryDialog::onBackspace()
{
if (_disable_echo_allowed)
_edit->setEchoMode( SecTQLineEdit::NoEcho );
}
void PinEntryDialog::setDescription( const TQString& txt )
{
_desc->setText( txt );
@ -196,6 +208,8 @@ SecTQString PinEntryDialog::text() const
void PinEntryDialog::setPrompt( const TQString& txt )
{
_prompt->setText( txt );
if (txt.contains("PIN"))
_disable_echo_allowed = false;
}
TQString PinEntryDialog::prompt() const

@ -1,5 +1,5 @@
/* pinentrydialog.h - A secure KDE dialog for PIN entry.
* Copyright (C) 2002 Klarälvdalens Datakonsult AB
* Copyright (C) 2002 Klarälvdalens Datakonsult AB
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
*
* This program is free software; you can redistribute it and/or
@ -63,6 +63,7 @@ public:
public slots:
void updateQuality(const SecTQString &);
void onBackspace();
signals:
void accepted();
@ -86,6 +87,7 @@ private:
bool _grabbed;
bool _have_quality_bar;
pinentry_t _pinentry_info;
bool _disable_echo_allowed;
};

@ -719,6 +719,8 @@ void SecTQLineEdit::backspace()
d->del( TRUE );
}
d->finishChange( priorState );
emit backspacePressed();
}
/*!

@ -187,6 +187,7 @@ signals:
void returnPressed();
void lostFocus();
void selectionChanged();
void backspacePressed();
protected:
bool event( TQEvent * );

@ -23,6 +23,6 @@ bin_PROGRAMS = pinentry-tty
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(LIBICONV)
$(COMMON_LIBS) $(LIBICONV)
pinentry_tty_SOURCES = pinentry-tty.c

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-tty$(EXEEXT)
subdir = tty
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -121,7 +130,7 @@ pinentry_tty_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
pinentry_tty_DEPENDENCIES = ../pinentry/libpinentry.a \
../secmem/libsecmem.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(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
@ -136,7 +145,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/pinentry-tty.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -176,6 +186,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -200,6 +212,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -209,6 +223,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -222,11 +237,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -235,6 +251,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -243,6 +261,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -256,16 +276,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -315,6 +342,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -325,7 +353,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry
LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \
$(COMMON_LIBS) $(LIBCAP) $(LIBICONV)
$(COMMON_LIBS) $(LIBICONV)
pinentry_tty_SOURCES = pinentry-tty.c
all: all-am
@ -344,14 +372,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tty/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tty/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -415,7 +442,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-tty.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-tty.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -483,7 +516,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -555,7 +591,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-tty.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -601,7 +637,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/pinentry-tty.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -621,7 +657,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -635,6 +671,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

@ -51,14 +51,32 @@ static struct termios n_term;
static struct termios o_term;
static int
cbreak (int fd)
terminal_save (int fd)
{
if ((tcgetattr(fd, &o_term)) == -1)
if ((tcgetattr (fd, &o_term)) == -1)
return -1;
return 0;
}
static void
terminal_restore (int fd)
{
tcsetattr (fd, TCSANOW, &o_term);
}
static int
terminal_setup (int fd, int line_edit)
{
n_term = o_term;
n_term.c_lflag = n_term.c_lflag & ~(ECHO|ICANON);
n_term.c_cc[VMIN] = 1;
n_term.c_cc[VTIME]= 0;
if (line_edit)
n_term.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
else
{
n_term.c_lflag &= ~(ECHO|ICANON);
n_term.c_lflag |= ISIG;
n_term.c_cc[VMIN] = 1;
n_term.c_cc[VTIME]= 0;
}
if ((tcsetattr(fd, TCSAFLUSH, &n_term)) == -1)
return -1;
return 1;
@ -69,10 +87,32 @@ cbreak (int fd)
#define ALERT_START "\033[1;31m"
#define NORMAL_RESTORE "\033[0m"
static void
fputs_highlighted (char *text, char *highlight, FILE *ttyfo)
{
for (; *text; text ++)
{
/* Skip accelerator prefix. */
if (*text == '_')
{
text ++;
if (! *text)
break;
}
if (text == highlight)
fputs (UNDERLINE_START, ttyfo);
fputc (*text, ttyfo);
if (text == highlight)
fputs (NORMAL_RESTORE, ttyfo);
}
}
static char
button (char *text, char *default_text, FILE *ttyfo)
{
char *highlight;
int use_default = 0;
if (! text)
return 0;
@ -110,25 +150,17 @@ button (char *text, char *default_text, FILE *ttyfo)
{
if (! default_text)
return 0;
text = highlight = default_text;
highlight = default_text;
use_default = 1;
}
fputs (" ", ttyfo);
for (; *text; text ++)
fputs_highlighted (text, highlight, ttyfo);
if (use_default)
{
/* Skip accelerator prefix. */
if (*text == '_')
{
text ++;
if (! *text)
break;
}
if (text == highlight)
fputs (UNDERLINE_START, ttyfo);
fputc (*text, ttyfo);
if (text == highlight)
fputs (NORMAL_RESTORE, ttyfo);
fputs (" (", ttyfo);
fputs_highlighted (default_text, highlight, ttyfo);
fputc (')', ttyfo);
}
fputc ('\n', ttyfo);
@ -220,14 +252,6 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
notok = button (pinentry->notok, "No", ttyfo);
}
if (cbreak (fileno (ttyfi)) == -1)
{
int err = errno;
fprintf (stderr, "cbreak failure, exiting\n");
errno = err;
return -1;
}
while (1)
{
int input;
@ -248,18 +272,26 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
fflush (ttyfo);
input = fgetc (ttyfi);
fprintf (ttyfo, "%c\n", input);
input = tolower (input);
if (input == EOF || input == 0x4)
/* End of file or control-d (= end of file). */
if (input == EOF)
{
pinentry->close_button = 1;
pinentry->canceled = 1;
#ifndef HAVE_DOSISH_SYSTEM
if (!timed_out && errno == EINTR)
pinentry->specific_err = gpg_error (GPG_ERR_FULLY_CANCELED);
#endif
ret = 0;
break;
}
else
{
fprintf (ttyfo, "%c\n", input);
input = tolower (input);
}
if (pinentry->one_button)
{
@ -294,13 +326,11 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
pinentry->specific_err = gpg_error (GPG_ERR_TIMEOUT);
#endif
tcsetattr (fileno(ttyfi), TCSANOW, &o_term);
return ret;
}
static char *
read_password (FILE *ttyfi, FILE *ttyfo)
read_password (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
{
int done = 0;
int len = 128;
@ -309,14 +339,6 @@ read_password (FILE *ttyfi, FILE *ttyfo)
(void) ttyfo;
if (cbreak (fileno (ttyfi)) == -1)
{
int err = errno;
fprintf (stderr, "cbreak failure, exiting\n");
errno = err;
return NULL;
}
buffer = secmem_malloc (len);
if (! buffer)
return NULL;
@ -344,21 +366,18 @@ read_password (FILE *ttyfi, FILE *ttyfo)
c = fgetc (ttyfi);
switch (c)
{
case 0x4: case EOF:
/* Control-d (i.e., end of file) or a real EOF. */
done = -1;
case EOF:
done = -1;
#ifndef HAVE_DOSISH_SYSTEM
if (!timed_out && errno == EINTR)
pinentry->specific_err = gpg_error (GPG_ERR_FULLY_CANCELED);
#endif
break;
case '\n':
done = 1;
break;
case 0x7f:
/* Backspace. */
if (count > 0)
count --;
break;
default:
buffer[count ++] = c;
break;
@ -366,8 +385,6 @@ read_password (FILE *ttyfi, FILE *ttyfo)
}
buffer[count] = '\0';
tcsetattr (fileno(ttyfi), TCSANOW, &o_term);
if (done == -1)
{
secmem_free (buffer);
@ -411,7 +428,7 @@ password (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
|| prompt[strlen(prompt) - 1] == '?') ? "" : ":");
fflush (ttyfo);
passphrase = read_password (ttyfi, ttyfo);
passphrase = read_password (pinentry, ttyfi, ttyfo);
fputc ('\n', ttyfo);
if (! passphrase)
{
@ -433,7 +450,7 @@ password (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
|| prompt[strlen(prompt) - 1] == '?') ? "" : ":");
fflush (ttyfo);
passphrase2 = read_password (ttyfi, ttyfo);
passphrase2 = read_password (pinentry, ttyfi, ttyfo);
fputc ('\n', ttyfo);
if (! passphrase2)
{
@ -495,7 +512,7 @@ do_touch_file(pinentry_t pinentry)
#ifndef HAVE_DOSISH_SYSTEM
static void
catchsig(int sig)
catchsig (int sig)
{
if (sig == SIGALRM)
timed_out = 1;
@ -503,11 +520,12 @@ catchsig(int sig)
#endif
int
tty_cmd_handler(pinentry_t pinentry)
tty_cmd_handler (pinentry_t pinentry)
{
int rc = 0;
FILE *ttyfi = stdin;
FILE *ttyfo = stdout;
int saved_errno = 0;
#ifndef HAVE_DOSISH_SYSTEM
timed_out = 0;
@ -516,10 +534,11 @@ tty_cmd_handler(pinentry_t pinentry)
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
memset (&sa, 0, sizeof(sa));
sa.sa_handler = catchsig;
sigaction(SIGALRM, &sa, NULL);
alarm(pinentry->timeout);
sigaction (SIGALRM, &sa, NULL);
sigaction (SIGINT, &sa, NULL);
alarm (pinentry->timeout);
}
#endif
@ -527,29 +546,39 @@ tty_cmd_handler(pinentry_t pinentry)
{
ttyfi = fopen (pinentry->ttyname, "r");
if (!ttyfi)
rc = -1;
else
return -1;
ttyfo = fopen (pinentry->ttyname, "w");
if (!ttyfo)
{
ttyfo = fopen (pinentry->ttyname, "w");
if (!ttyfo)
{
int err = errno;
fclose (ttyfi);
errno = err;
rc = -1;
}
saved_errno = errno;
fclose (ttyfi);
errno = saved_errno;
return -1;
}
}
if (! rc)
if (terminal_save (fileno (ttyfi)) < 0)
rc = -1;
else
{
if (pinentry->pin)
rc = password (pinentry, ttyfi, ttyfo);
if (terminal_setup (fileno (ttyfi), !!pinentry->pin) == -1)
{
saved_errno = errno;
fprintf (stderr, "terminal_setup failure, exiting\n");
rc = -1;
}
else
rc = confirm (pinentry, ttyfi, ttyfo);
}
{
if (pinentry->pin)
rc = password (pinentry, ttyfi, ttyfo);
else
rc = confirm (pinentry, ttyfi, ttyfo);
do_touch_file (pinentry);
terminal_restore (fileno (ttyfi));
do_touch_file (pinentry);
}
}
if (pinentry->ttyname)
{
@ -557,6 +586,9 @@ tty_cmd_handler(pinentry_t pinentry)
fclose (ttyfo);
}
if (saved_errno)
errno = saved_errno;
return rc;
}

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,17 @@
# SPDX-License-Identifier: GPL-2.0+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -99,16 +109,15 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = pinentry-w32$(EXEEXT)
subdir = w32
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/libassuan.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/qt.m4 $(top_srcdir)/m4/qt4.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@ -136,7 +145,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/main.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -176,6 +186,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -200,6 +212,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EFL_CFLAGS = @EFL_CFLAGS@
EFL_LIBS = @EFL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLTKCFLAGS = @FLTKCFLAGS@
@ -209,6 +223,7 @@ FLTK_CONFIG = @FLTK_CONFIG@
GITLOG_TO_CHANGELOG = @GITLOG_TO_CHANGELOG@
GNOME3_CFLAGS = @GNOME3_CFLAGS@
GNOME3_LIBS = @GNOME3_LIBS@
GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@ -222,11 +237,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KF5WAYLANDCLIENT_CFLAGS = @KF5WAYLANDCLIENT_CFLAGS@
KF5WAYLANDCLIENT_LIBS = @KF5WAYLANDCLIENT_LIBS@
LDFLAGS = @LDFLAGS@
LIBASSUAN_CFLAGS = @LIBASSUAN_CFLAGS@
LIBASSUAN_CONFIG = @LIBASSUAN_CONFIG@
LIBASSUAN_LIBS = @LIBASSUAN_LIBS@
LIBCAP = @LIBCAP@
LIBCURSES = @LIBCURSES@
LIBICONV = @LIBICONV@
LIBNCURSES = @LIBNCURSES@
@ -235,6 +251,8 @@ LIBS = @LIBS@
LIBSECRET_CFLAGS = @LIBSECRET_CFLAGS@
LIBSECRET_LIBS = @LIBSECRET_LIBS@
LIBTERMCAP = @LIBTERMCAP@
LIBX11_CFLAGS = @LIBX11_CFLAGS@
LIBX11_LIBS = @LIBX11_LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@ -243,6 +261,8 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MOC = @MOC@
MOC2 = @MOC2@
MOC4 = @MOC4@
MOC42 = @MOC42@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_INCLUDE = @NCURSES_INCLUDE@
NCURSES_LIBS = @NCURSES_LIBS@
@ -256,16 +276,23 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PINENTRY_DEFAULT = @PINENTRY_DEFAULT@
PINENTRY_QT4_CFLAGS = @PINENTRY_QT4_CFLAGS@
PINENTRY_QT4_LDFLAGS = @PINENTRY_QT4_LDFLAGS@
PINENTRY_QT4_LIBS = @PINENTRY_QT4_LIBS@
PINENTRY_QT_CFLAGS = @PINENTRY_QT_CFLAGS@
PINENTRY_QT_LDFLAGS = @PINENTRY_QT_LDFLAGS@
PINENTRY_QT_LIBS = @PINENTRY_QT_LIBS@
PINENTRY_QT_REQUIRE_CPP11_CFLAGS = @PINENTRY_QT_REQUIRE_CPP11_CFLAGS@
PINENTRY_QT_REQUIRE_CPP11_LIBS = @PINENTRY_QT_REQUIRE_CPP11_LIBS@
PINENTRY_QT_X11_EXTRAS_CFLAGS = @PINENTRY_QT_X11_EXTRAS_CFLAGS@
PINENTRY_QT_X11_EXTRAS_LIBS = @PINENTRY_QT_X11_EXTRAS_LIBS@
PINENTRY_TQT_CFLAGS = @PINENTRY_TQT_CFLAGS@
PINENTRY_TQT_LIBS = @PINENTRY_TQT_LIBS@
PKG_CONFIG = @PKG_CONFIG@
QTCHOOSER = @QTCHOOSER@
RANLIB = @RANLIB@
SETCAP = @SETCAP@
RCC = @RCC@
RCC2 = @RCC2@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -315,6 +342,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -352,14 +380,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu w32/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu w32/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -423,7 +450,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -491,7 +524,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -563,7 +599,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -609,7 +645,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/main.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -629,7 +665,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
@ -643,6 +679,8 @@ uninstall-am: uninstall-binPROGRAMS
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
pinentry-w32.o: pinentry-w32.rc resource.h $(logos)
$(WINDRES) -I.. -v -o $@ $<

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 582 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

@ -83,7 +83,6 @@ w32_strerror (int ec)
/* There is only a wchar_t FormatMessage. It does not make much
sense to play the conversion game; we print only the code. */
snprintf (strerr, sizeof strerr, "ec=%d", ec);
strerr[sizeof strerr -1] = 0;
#else
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, ec,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),

@ -0,0 +1,9 @@
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQRtqm5kp20oQFcbSQJSiJe4JkA62gUCYwYDUwAKCRBSiJe4JkA6
2oLvAQDnnCjGuMWl2Q2OhNWTJ+xCSh98qjbCJhhPh0XdlYYllAEAgpwKE8j8zhb8
bpWiye8YMK73S52u22spIO1fOzXH0QKIdQQAFggAHRYhBKyOEVv3Pi2NR/qZCOmO
my0Zxsi9BQJjBw2vAAoJEOmOmy0Zxsi9gg0BAMw2ynU0fU0kDoi6zce44On7VmXE
9MMvpki4BbfW9yvmAQCzzRirV3k/NY3fMVC+T9OFQV6KEpBCSd8I2dQ6v79WDw==
=WKvZ
-----END PGP SIGNATURE-----
Loading…
Cancel
Save