Signed-off-by: Slávek Banko <slavek.banko@axis.cz>pull/5/head
@ -1 +0,0 @@
|
||||
1.1.0
|
@ -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
|
||||
])
|
@ -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
|
||||
])
|
@ -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)
|
||||
------------------------------------------------
|
||||
|
@ -0,0 +1 @@
|
||||
1.2.1
|
@ -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,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
|
||||
|
@ -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
|
@ -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-----
|
@ -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;
|
||||
}
|
@ -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
|
||||
])
|
||||
])
|
@ -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
|
||||
])
|
@ -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:
|
After Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 496 B |
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__
|
After Width: | Height: | Size: 1.8 KiB |
@ -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_
|
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 |
@ -0,0 +1,9 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iHUEABYIAB0WIQRtqm5kp20oQFcbSQJSiJe4JkA62gUCYwYDUwAKCRBSiJe4JkA6
|
||||
2oLvAQDnnCjGuMWl2Q2OhNWTJ+xCSh98qjbCJhhPh0XdlYYllAEAgpwKE8j8zhb8
|
||||
bpWiye8YMK73S52u22spIO1fOzXH0QKIdQQAFggAHRYhBKyOEVv3Pi2NR/qZCOmO
|
||||
my0Zxsi9BQJjBw2vAAoJEOmOmy0Zxsi9gg0BAMw2ynU0fU0kDoi6zce44On7VmXE
|
||||
9MMvpki4BbfW9yvmAQCzzRirV3k/NY3fMVC+T9OFQV6KEpBCSd8I2dQ6v79WDw==
|
||||
=WKvZ
|
||||
-----END PGP SIGNATURE-----
|