Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F18824729
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
85 KB
Subscribers
None
View Options
diff --git a/configure.ac b/configure.ac
index d345981..7702310 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,848 +1,849 @@
# configure.ac
# Copyright (C) 1999 Robert Bihlmeyer <robbe@orcus.priv.at>
# Copyright (C) 2001, 2002, 2003, 2004, 2007, 2015, 2016 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 autoconf to produce a configure script.)
AC_PREREQ([2.69])
min_automake_version="1.14"
# To build a release you need to create a tag with the version number
# (git tag -s pinentry-n.m.k) and run "./autogen.sh --force". Please
# bump the version number immediately after the release and do another
# commit and push so that the git magic is able to work.
m4_define([mym4_package],[pinentry])
m4_define([mym4_major], [1])
m4_define([mym4_minor], [2])
m4_define([mym4_micro], [1])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
# flag indicating a development version (mym4_isbeta). Note that the
# m4 processing is done by autoconf and not during the configure run.
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
mym4_package mym4_major mym4_minor mym4_micro),[:]))
m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
m4_define([mym4_version], m4_argn(4, mym4_verslist))
m4_define([mym4_revision], m4_argn(7, mym4_verslist))
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
m4_esyscmd([echo ]mym4_version[>VERSION])
AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR(pinentry/pinentry.h)
AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
AC_USE_SYSTEM_EXTENSIONS
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AH_TOP([
#ifndef PINENTRY_CONFIG_H_INCLUDED
#define PINENTRY_CONFIG_H_INCLUDED
/* Enable gpg-error's strerror macro under W32CE. */
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
])
AH_BOTTOM([
#endif /*PINENTRY_CONFIG_H_INCLUDED*/
])
dnl Checks for programs.
AC_PROG_MAKE_SET
AM_SANITY_CHECK
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_RANLIB
# We need to check for cplusplus here because we may not do the test
# for Qt and autoconf does does not allow that.
AC_PROG_CXX
AC_PROG_LN_S
PKG_PROG_PKG_CONFIG
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog,
[build-aux/gitlog-to-changelog])
have_dosish_system=no
have_w32_system=no
have_w32ce_system=no
case "${host}" in
*-mingw32*)
AC_DEFINE(USE_ONLY_8DOT3,1,
[Set this to limit filenames to the 8.3 format])
have_dosish_system=yes
have_w32_system=yes
case "${host}" in
*-mingw32ce*)
have_w32ce_system=yes
;;
*)
AC_DEFINE(HAVE_DRIVE_LETTERS,1,
[Defined if the OS supports drive letters.])
;;
esac
;;
i?86-emx-os2 | i?86-*-os2*emx )
# OS/2 with the EMX environment
AC_DEFINE(HAVE_DRIVE_LETTERS)
have_dosish_system=yes
;;
i?86-*-msdosdjgpp*)
# DOS with the DJGPP environment
AC_DEFINE(HAVE_DRIVE_LETTERS)
have_dosish_system=yes
;;
esac
if test "$have_dosish_system" = yes; then
AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
[Defined if we run on some of the PCDOS like systems
(DOS, Windoze. OS/2) with special properties like
no file modes])
fi
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
if test "$have_w32_system" = yes; then
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
if test "$have_w32ce_system" = yes; then
AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
fi
fi
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
dnl Checks for compiler features.
if test "$GCC" = yes; then
# Check whether gcc does not emit a diagnositc for unknown -Wno-*
# options. This is the case for gcc >= 4.6
AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
#kickerror
#endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
AC_MSG_RESULT($_gcc_silent_wno)
if test "$USE_MAINTAINER_MODE" = "yes"; then
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
if test x"$_gcc_silent_wno" = xyes ; then
_gcc_warn=yes
else
AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-missing-field-initializers"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[_gcc_warn=yes],[_gcc_warn=no])
AC_MSG_RESULT($_gcc_warn)
CFLAGS=$_gcc_cflags_save;
fi
if test x"$_gcc_warn" = xyes ; then
CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
fi
AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wdeclaration-after-statement"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no)
AC_MSG_RESULT($_gcc_warn)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_warn" = xyes ; then
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
fi
else
# Not in maintainer mode: Use standard warnings.
CFLAGS="$CFLAGS -Wall"
fi
CPPFLAGS="$CPPFLAGS -Wall"
if test x"$_gcc_silent_wno" = xyes ; then
_gcc_warn=yes
else
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_warn=yes],[_gcc_warn=no])
AC_MSG_RESULT($_gcc_warn)
CFLAGS=$_gcc_cflags_save;
fi
if test x"$_gcc_warn" = xyes ; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wpointer-arith"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no)
AC_MSG_RESULT($_gcc_warn)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_warn" = xyes ; then
CFLAGS="$CFLAGS -Wpointer-arith"
fi
fi
# Checks for header files.
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h wchar.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(seteuid stpcpy mmap stat)
GNUPG_CHECK_MLOCK
dnl Checks for standard types.
AC_TYPE_UINT32_T
# Common libraries and cflags.
COMMON_CFLAGS=
COMMON_LIBS=
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(COMMON_LIBS)
dnl Checks for libgpg-error
#
# libgpg-error is a library with error codes shared between GnuPG
# related projects.
#
NEED_GPG_ERROR_VERSION=1.16
have_gpg_error=no
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
have_gpg_error=yes,have_gpg_error=no)
COMMON_CFLAGS="$GPG_ERROR_CFLAGS $COMMON_CFLAGS"
COMMON_LIBS="$GPG_ERROR_LIBS $COMMON_LIBS"
AC_DEFINE_UNQUOTED(GPG_ERR_ENABLE_GETTEXT_MACROS, 1,
[Under Windows we use the gettext code from libgpg-error])
AC_DEFINE_UNQUOTED(GPG_ERR_ENABLE_ERRNO_MACROS, 1,
[Under WindowsCE we use the strerror replacement from libgpg-error.])
dnl Checks for libassuan.
#
# libassuan is used for IPC
#
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.1.0
have_libassuan=no
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
have_libassuan=yes,have_libassuan=no)
if test "$have_libassuan" = "yes"; then
AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
[version of the libassuan library])
fi
COMMON_CFLAGS="$LIBASSUAN_CFLAGS $COMMON_CFLAGS"
COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS"
dnl Checks for libsecmem.
GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
dnl Check for libcap
AC_ARG_WITH([libcap], AS_HELP_STRING([--without-libcap],
[Disable support for capabilities library]))
if test "x$with_libcap" != "xno"; then
AC_PATH_PROG(SETCAP, setcap, :, "$PATH:/sbin:/usr/sbin")
AC_CHECK_LIB(cap, cap_set_proc, [
AC_DEFINE(USE_CAPABILITIES,1,[The capabilities support library is installed])
LIBCAP=-lcap
])
fi
AC_SUBST(LIBCAP)
dnl
dnl Check for curses pinentry program.
dnl
AC_ARG_ENABLE(pinentry-curses,
AS_HELP_STRING([--enable-pinentry-curses],[build curses pinentry]),
pinentry_curses=$enableval, pinentry_curses=maybe)
AC_ARG_ENABLE(fallback-curses,
AS_HELP_STRING([--enable-fallback-curses],[include curses fallback]),
fallback_curses=$enableval, fallback_curses=maybe)
dnl
dnl Checks for curses libraries. Deal correctly with $pinentry_curses = maybe
dnl and $fallback_curses = maybe.
dnl
if test "$pinentry_curses" != "no" -o "$fallback_curses" != "no"; then
IU_LIB_CURSES
fi
if test "$LIBCURSES"; then
if test "$pinentry_curses" != "no"; then
pinentry_curses=yes
fi
if test "$fallback_curses" != "no"; then
fallback_curses=yes
AC_DEFINE(FALLBACK_CURSES, 1,
[The GUI pinentries should fall back to curses if X is not available.])
fi
else
if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then
AC_MSG_ERROR([[
***
*** The curses library is required. The latest version of
*** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/.
***]])
fi
pinentry_curses=no
fallback_curses=no
fi
AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES,
test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes")
AM_CONDITIONAL(BUILD_PINENTRY_CURSES, test "$pinentry_curses" = "yes")
AM_CONDITIONAL(FALLBACK_CURSES, test "$fallback_curses" = "yes")
if test "$pinentry_curses" = "yes"; then
AC_DEFINE(PINENTRY_CURSES, 1,
[The Curses version of Pinentry is to be build])
fi
dnl
dnl Check for tty pinentry program.
dnl
AC_ARG_ENABLE(pinentry-tty,
AS_HELP_STRING([--enable-pinentry-tty],[build tty pinentry]),
pinentry_tty=$enableval, pinentry_tty=maybe)
AM_CONDITIONAL(BUILD_PINENTRY_TTY, test "$pinentry_tty" = "yes")
if test "$pinentry_tty" = "yes"; then
AC_DEFINE(PINENTRY_TTY, 1,
[The TTY version of Pinentry is to be build])
fi
dnl
dnl Additional checks pinentry Curses.
dnl
if test "$pinentry_curses" = "yes" \
-o "$fallback_curses" = "yes" ; then
AM_ICONV
if test "$am_cv_func_iconv" != "yes"; then
AC_MSG_ERROR([[
***
*** The iconv function is required. You can specify its location
*** using the --with-libiconv-prefix=PREFIX option to configure.
***]])
fi
fi
dnl
dnl Check for emacs pinentry program.
dnl
AC_ARG_ENABLE(pinentry-emacs,
AS_HELP_STRING([--enable-pinentry-emacs],[build emacs pinentry]),
pinentry_emacs=$enableval, pinentry_emacs=no)
AC_ARG_ENABLE(inside-emacs,
AS_HELP_STRING([--enable-inside-emacs],[include emacs hack]),
inside_emacs=$enableval, inside_emacs=maybe)
if test "$pinentry_emacs" != "no" -o "$inside_emacs" != "no"; then
AC_MSG_CHECKING([if Unix domain socket is supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/socket.h>
#include <sys/un.h>
]], [[int s = socket (AF_UNIX, SOCK_STREAM, 0);]])],[_unixsock_works=yes],[_unixsock_works=no])
AC_MSG_RESULT($_unixsock_works)
if test "$_unixsock_works" = "yes"; then
if test "$pinentry_emacs" != "no"; then
pinentry_emacs=yes
fi
if test "$inside_emacs" != "no"; then
inside_emacs=yes
AC_DEFINE(INSIDE_EMACS, 1,
[The GUI pinentries should respect INSIDE_EMACS envvar.])
fi
else
if test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes"; then
AC_MSG_ERROR([[
***
*** Support for Unix domain sockets is required.
***]])
fi
pinentry_emacs=no
inside_emacs=no
fi
fi
AM_CONDITIONAL(BUILD_LIBPINENTRY_EMACS,
test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes")
AM_CONDITIONAL(BUILD_PINENTRY_EMACS, test "$pinentry_emacs" = "yes")
AM_CONDITIONAL(INSIDE_EMACS, test "$inside_emacs" = "yes")
if test "$pinentry_emacs" = "yes"; then
AC_DEFINE(PINENTRY_EMACS, 1,
[The Emacs version of Pinentry is to be build])
fi
dnl
dnl Check for EFL pinentry programs.
dnl
AC_ARG_ENABLE(pinentry-efl,
AS_HELP_STRING([--enable-pinentry-efl],[build EFL pinentry]),
pinentry_efl=$enableval, pinentry_efl=maybe)
if test "$pinentry_efl" != "no"; then
PKG_CHECK_MODULES(
EFL,
[elementary >= 1.18,ecore-x],
[
pinentry_efl=yes
],
[
if test "$pinentry_efl" = "yes"; then
AC_MSG_ERROR([[
***
*** efl (elementary >= 1.18, ecore-x) is required for pinentry-efl.
***]])
else
AC_MSG_WARN([pkg-config could not find the modules elementary or ecore-x])
fi
pinentry_efl=no
]
)
fi
AM_CONDITIONAL(BUILD_PINENTRY_EFL, test "$pinentry_efl" = "yes")
dnl
dnl Check for GTK+-2 / GNOME3 pinentry programs.
dnl
AC_ARG_ENABLE(pinentry-gtk2,
AS_HELP_STRING([--enable-pinentry-gtk2],[build GTK+-2 pinentry]),
pinentry_gtk_2=$enableval, pinentry_gtk_2=maybe)
AC_ARG_ENABLE(pinentry-gnome3,
AS_HELP_STRING([--enable-pinentry-gnome3],[build GNOME 3 pinentry]),
pinentry_gnome_3=$enableval, pinentry_gnome_3=maybe)
dnl check if the module gtk+-2.0 exists
if test "$pinentry_gtk_2" != "no"; then
PKG_CHECK_MODULES(
GTK2,
[gtk+-2.0 >= 2.12.0],
[
test "$pinentry_gtk_2" != "no" && pinentry_gtk_2=yes
test "$pinentry_gnome_3" != "no" && pinentry_gnome_3=yes
],
[
AC_MSG_WARN([pkg-config could not find the module gtk+-2.0])
pinentry_gtk_2=no
]
)
fi
AM_CONDITIONAL(BUILD_PINENTRY_GTK_2, test "$pinentry_gtk_2" = "yes")
if test "$pinentry_gnome_3" != "no"; then
PKG_CHECK_MODULES(
GNOME3,
[gcr-3,gcr-base-3],
[
pinentry_gnome_3=yes
AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod])
],
[
AC_MSG_WARN([pkg-config could not find the module gcr-3,gcr-base-3])
pinentry_gnome_3=no
]
)
fi
AM_CONDITIONAL(BUILD_PINENTRY_GNOME_3, test "$pinentry_gnome_3" = "yes")
dnl
dnl Check for libsecret.
dnl
AC_ARG_ENABLE(libsecret,
AS_HELP_STRING([--enable-libsecret],
[optionally cache passphrases using libsecret]),
libsecret=$enableval, libsecret=maybe)
dnl check if the module libsecret exists
if test "$libsecret" != "no"; then
PKG_CHECK_MODULES(
LIBSECRET,
[libsecret-1],
[libsecret=yes],
[
AC_MSG_WARN([pkg-config could not find the module libsecret-1])
libsecret=no
]
)
fi
AM_CONDITIONAL(BUILD_WITH_LIBSECRET, test "$libsecret" = "yes")
if test "$libsecret" = "yes"; then
AC_DEFINE(HAVE_LIBSECRET, 1,
[The pinentries should optionally cache the passphrase using libsecret.])
COMMON_CFLAGS="$LIBSECRET_CFLAGS $COMMON_CFLAGS"
COMMON_LIBS="$LIBSECRET_LIBS $COMMON_LIBS"
fi
dnl
dnl Check for libX11 library
dnl
have_x11=no
if test "$have_w32_system" != "yes"; then
PKG_CHECK_MODULES(
LIBX11,
[x11],
[have_x11=yes],
[
AC_MSG_WARN([pkg-config could not find the module x11])
have_x11=no
]
)
if test "$have_x11" = "yes"; then
AC_DEFINE(HAVE_X11, 1,
[The pinentries can optionally use x11.])
fi
fi
dnl
dnl Check for KF5WaylandClient library
dnl
have_kf5waylandclient=no
if test "$have_w32_system" != "yes"; then
PKG_CHECK_MODULES(
KF5WAYLANDCLIENT,
[KF5WaylandClient >= 5.60],
[have_kf5waylandclient=yes],
[
AC_MSG_WARN([pkg-config could not find the module KF5WaylandClient])
have_kf5waylandclient=no
]
)
fi
dnl
dnl Check for Qt pinentry program.
dnl
AC_ARG_ENABLE(pinentry-qt,
AS_HELP_STRING([--enable-pinentry-qt],[build qt pinentry]),
pinentry_qt=$enableval, pinentry_qt=maybe)
dnl
dnl Checks for qt libraries. Deal correctly with $pinentry_qt = maybe.
dnl Tries to find Qt5, falls back on Qt4
dnl
if test "$pinentry_qt" != "no"; then
FIND_QT
if test "$have_qt4_libs" != "yes" -a "$have_qt5_libs" != "yes"; then
if test "$pinentry_qt" = "yes"; then
AC_MSG_ERROR([[
***
*** Qt4 (QtCore, QtGui) or Qt5 (Qt5Core, Qt5Gui, Qt5Widgets) is required.
***]])
else
pinentry_qt=no
fi
fi
fi
AC_SUBST(PINENTRY_QT_CFLAGS)
AC_SUBST(PINENTRY_QT_LIBS)
AC_SUBST(PINENTRY_QT_LDFLAGS)
AC_SUBST(MOC)
dnl If we have come so far, qt pinentry can be build.
if test "$pinentry_qt" != "no"; then
pinentry_qt=yes
fi
AM_CONDITIONAL(BUILD_PINENTRY_QT, test "$pinentry_qt" = "yes")
if test "$pinentry_qt" = "yes"; then
AC_DEFINE(PINENTRY_QT, 1, [The qt version of Pinentry is to be build])
if test "$have_qt4_libs" = "yes"; then
pinentry_qt_lib_version="(Qt4)"
else
pinentry_qt_lib_version="(Qt5)"
fi
fi
if test "$have_qt5_x11extras" = "yes"; then
AC_DEFINE(PINENTRY_QT_X11, 1, [pinentry-qt should use x11.])
fi
if test "$have_kf5waylandclient" = "yes"; then
PINENTRY_QT_CFLAGS="$KF5WAYLANDCLIENT_CFLAGS $PINENTRY_QT_CFLAGS -fpic"
PINENTRY_QT_LIBS="$KF5WAYLANDCLIENT_LIBS $PINENTRY_QT_LIBS"
AC_DEFINE(PINENTRY_QT_WAYLAND, 1, [pinentry-qt should use KF5WaylandClient.])
else
if test "$have_w32_system" != "yes"; then
AC_MSG_WARN([pinentry-qt will be built without Caps Lock warning on Wayland])
fi
fi
dnl
dnl Check for TQt pinentry program.
dnl
AC_ARG_ENABLE(pinentry-tqt,
AS_HELP_STRING([--enable-pinentry-tqt],[build tqt pinentry]),
pinentry_tqt=$enableval, pinentry_tqt=no)
if test "$pinentry_tqt" != "no"; then
if test "$pinentry_qt" = "yes"; then
AC_MSG_ERROR([[
***
*** Building both Qt and TQt pinentries is not supported.
*** Use --disable-pinentry-qt if you want the TQt pinentry.
***]])
fi
PKG_CHECK_MODULES(PINENTRY_TQT, tqt,
have_tqt_libs=yes,
[PKG_CHECK_MODULES(PINENTRY_TQT, tqt-mt,
have_tqt_libs=yes, have_tqt_libs=no)])
if test "$have_tqt_libs" = "yes"; then
AC_CHECK_TOOL([TQT_MOC], tqmoc, "no")
fi
if test "$have_tqt_libs" = "yes" -a "$TQT_MOC" != "no"; then
pinentry_tqt=yes
else
AC_MSG_WARN([TQt is not found])
pinentry_tqt=no
fi
fi
AM_CONDITIONAL(BUILD_PINENTRY_TQT, test "$pinentry_tqt" = "yes")
#
# Check whether we should build the W32 pinentry. This is actually
# the simplest check as we do this only for that platform.
#
pinentry_w32=no
test $have_w32_system = yes && pinentry_w32=yes
AM_CONDITIONAL(BUILD_PINENTRY_W32, test "$pinentry_w32" = "yes")
dnl
dnl Check for FLTK pinentry program.
dnl
AC_ARG_ENABLE(pinentry-fltk,
AS_HELP_STRING([--enable-pinentry-fltk],[build FLTK 1.3 pinentry]),
pinentry_fltk=$enableval, pinentry_fltk=maybe)
dnl check for fltk-config
if test "$pinentry_fltk" != "no"; then
AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
if test x"${FLTK_CONFIG}" = xno ; then
AC_MSG_WARN([fltk-config is not found])
pinentry_fltk=no
fi
fi
dnl check for FLTK libraries and set flags
if test "$pinentry_fltk" != "no"; then
AC_MSG_CHECKING([for FLTK 1.3])
FLTK_VERSION=`${FLTK_CONFIG} --api-version`
if test ${FLTK_VERSION} != "1.3" ; then
AC_MSG_RESULT([no])
AC_MSG_WARN([FLTK 1.3 not found (available $FLTK_VERSION)])
pinentry_fltk=no
else
AC_MSG_RESULT([yes])
FLTKCFLAGS=`${FLTK_CONFIG} --cflags`
FLTKCXXFLAGS=`${FLTK_CONFIG} --cxxflags`
FLTKLIBS=`${FLTK_CONFIG} --ldflags`
AC_SUBST(FLTKCFLAGS)
AC_SUBST(FLTKCXXFLAGS)
AC_SUBST(FLTKLIBS)
pinentry_fltk=yes
fi
fi
AM_CONDITIONAL(BUILD_PINENTRY_FLTK, test "$pinentry_fltk" = "yes")
# Figure out the default pinentry. We are very conservative here.
# Please change the order only after verifying that the preferred
# pinentry really is better (more feature-complete and more secure).
if test "$pinentry_gtk_2" = "yes"; then
PINENTRY_DEFAULT=pinentry-gtk-2
else
if test "$pinentry_qt" = "yes"; then
PINENTRY_DEFAULT=pinentry-qt
else
if test "$pinentry_gnome_3" = "yes"; then
PINENTRY_DEFAULT=pinentry-gnome3
else
if test "$pinentry_curses" = "yes"; then
PINENTRY_DEFAULT=pinentry-curses
else
if test "$pinentry_tty" = "yes"; then
PINENTRY_DEFAULT=pinentry-tty
else
if test "$pinentry_w32" = "yes"; then
PINENTRY_DEFAULT=pinentry-w32
else
if test "$pinentry_fltk" = "yes"; then
PINENTRY_DEFAULT=pinentry-fltk
else
if test "$pinentry_tqt" = "yes"; then
PINENTRY_DEFAULT=pinentry-tqt
else
if test "$pinentry_efl" = "yes"; then
PINENTRY_DEFAULT=pinentry-efl
else
AC_MSG_ERROR([[No pinentry enabled.]])
fi
fi
fi
fi
fi
fi
fi
fi
fi
AC_SUBST(PINENTRY_DEFAULT)
#
# Print errors here so that they are visible all
# together and the user can acquire them all together.
#
die=no
if test "$have_gpg_error" = "no"; then
die=yes
AC_MSG_NOTICE([[
***
*** You need libgpg-error to build this program.
** This library is for example available at
*** ftp://ftp.gnupg.org/gcrypt/libgpg-error
*** (at least version $NEED_GPG_ERROR_VERSION is required.)
***]])
fi
if test "$have_libassuan" = "no"; then
die=yes
AC_MSG_NOTICE([[
***
*** You need libassuan to build this program.
*** This library is for example available at
*** ftp://ftp.gnupg.org/gcrypt/libassuan/
*** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
***]])
fi
if test "$die" = "yes"; then
AC_MSG_ERROR([[
***
*** Required libraries not found. Please consult the above messages
*** and install them before running configure again.
***]])
fi
#
# To avoid double inclusion of config.h which might happen at some
# places, we add the usual double inclusion protection at the top of
# config.h.
#
AH_TOP([
#ifndef GNUPG_CONFIG_H_INCLUDED
#define GNUPG_CONFIG_H_INCLUDED
])
#
# Stuff which goes at the bottom of config.h.
#
AH_BOTTOM([
#ifdef GPG_ERR_SOURCE_DEFAULT
# error GPG_ERR_SOURCE_DEFAULT already defined
#endif
#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_PINENTRY
#endif /*GNUPG_CONFIG_H_INCLUDED*/
])
build_doc=yes
AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc],
[do not build the documentation]),
build_doc=$enableval, build_doc=yes)
AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
AC_CONFIG_FILES([
m4/Makefile
secmem/Makefile
pinentry/Makefile
curses/Makefile
tty/Makefile
efl/Makefile
emacs/Makefile
gtk+-2/Makefile
gnome3/Makefile
qt/Makefile
+qt/icons/Makefile
tqt/Makefile
w32/Makefile
fltk/Makefile
doc/Makefile
Makefile
])
AC_OUTPUT
AC_MSG_NOTICE([
Pinentry v${VERSION} has been configured as follows:
Revision: mym4_revision (mym4_revision_dec)
Platform: $host
Curses Pinentry ..: $pinentry_curses
TTY Pinentry .....: $pinentry_tty
Emacs Pinentry ...: $pinentry_emacs
EFL Pinentry .....: $pinentry_efl
GTK+-2 Pinentry ..: $pinentry_gtk_2
GNOME 3 Pinentry .: $pinentry_gnome_3
Qt Pinentry ......: $pinentry_qt $pinentry_qt_lib_version
TQt Pinentry .....: $pinentry_tqt
W32 Pinentry .....: $pinentry_w32
FLTK Pinentry ....: $pinentry_fltk
Fallback to Curses: $fallback_curses
Emacs integration : $inside_emacs
libsecret ........: $libsecret
Default Pinentry .: $PINENTRY_DEFAULT
])
diff --git a/m4/qt.m4 b/m4/qt.m4
index 3e65557..bf77266 100644
--- a/m4/qt.m4
+++ b/m4/qt.m4
@@ -1,134 +1,161 @@
dnl qt.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 or Qt5
dnl
dnl sets PINENTRY_QT_LIBS and PINENTRY_QT_CFLAGS
dnl
dnl if QT5 was found have_qt5_libs is set to yes
dnl if QT4 was found have_qt4_libs is set to yes
dnl
dnl The moc lookup code is based on libpoppler (rev. d821207)
AC_DEFUN([FIND_QT],
[
AC_ARG_ENABLE(pinentry-qt5,
AC_HELP_STRING([--disable-pinentry-qt5],
[Don't use qt5 even if it is available.]),
enable_pinentry_qt5=$enableval,
enable_pinentry_qt5="try")
have_qt5_libs="no";
require_qt_cpp11="no";
if test "$enable_pinentry_qt5" != "no"; then
PKG_CHECK_MODULES(PINENTRY_QT,
Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0,
[have_qt5_libs="yes"],
[have_qt5_libs="no"])
if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then
PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic"
fi
fi
if test "$have_qt5_libs" = "yes"; then
PKG_CHECK_MODULES(PINENTRY_QT_REQUIRE_CPP11,
Qt5Core >= 5.7.0,
[require_qt_cpp11="yes"],
[require_qt_cpp11="no"])
if test "${require_qt_cpp11}" = "yes"; then
PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -std=c++11"
fi
qtlibdir=`"$PKG_CONFIG" --variable libdir Qt5Core`
if test -n "$qtlibdir"; then
if test "$enable_rpath" != "no"; then
PINENTRY_QT_LDFLAGS="$PINENTRY_QT_LDFLAGS -Wl,-rpath \"$qtlibdir\""
fi
fi
if test "$have_x11" = "yes"; then
PKG_CHECK_MODULES(
PINENTRY_QT_X11_EXTRAS,
Qt5X11Extras >= 5.1.0,
[have_qt5_x11extras="yes"],
[
AC_MSG_WARN([pinentry-qt will be built without Caps Lock warning on X11])
have_qt5_x11extras="no"
])
if test "$have_qt5_x11extras" = "yes"; then
PINENTRY_QT_CFLAGS="$LIBX11_CFLAGS $PINENTRY_QT_CFLAGS $PINENTRY_QT_X11_EXTRAS_CFLAGS"
PINENTRY_QT_LIBS="$LIBX11_LIBS $PINENTRY_QT_LIBS $PINENTRY_QT_X11_EXTRAS_LIBS"
fi
fi
AC_CHECK_TOOL(MOC, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC -v 2>&1`
mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"`
if test x"$mocversiongrep" != x"$mocversion"; then
AC_MSG_RESULT([no])
# moc was not the qt5 one, try with moc-qt5
AC_CHECK_TOOL(MOC2, moc-qt5)
mocversion=`$MOC2 -v 2>&1`
mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"`
if test x"$mocversiongrep" != x"$mocversion"; then
AC_CHECK_TOOL(QTCHOOSER, qtchooser)
qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2`
mocversion=`$qt5tooldir/moc -v 2>&1`
mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"`
if test x"$mocversiongrep" != x"$mocversion"; then
# no valid moc found
have_qt5_libs="no";
else
MOC=$qt5tooldir/moc
fi
else
MOC=$MOC2
fi
fi
+
+ AC_CHECK_TOOL(RCC, rcc)
+ AC_MSG_CHECKING([rcc version])
+ rccversion=`$RCC -v 2>&1`
+ rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"`
+ if test x"$rccversiongrep" != x"$rccversion"; then
+ AC_MSG_RESULT([no])
+ # rcc was not the qt5 one, try with rcc-qt5
+ AC_CHECK_TOOL(RCC2, rcc-qt5)
+ rccversion=`$RCC2 -v 2>&1`
+ rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc-qt5 5|rcc 5"`
+ if test x"$rccversiongrep" != x"$rccversion"; then
+ AC_CHECK_TOOL(QTCHOOSER, qtchooser)
+ qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2`
+ rccversion=`$qt5tooldir/rcc -v 2>&1`
+ rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"`
+ if test x"$rccversiongrep" != x"$rccversion"; then
+ # no valid rcc found
+ have_qt5_libs="no";
+ else
+ RCC=$qt5tooldir/rcc
+ fi
+ else
+ RCC=$RCC2
+ fi
+ fi
+
fi
if test "$have_qt5_libs" != "yes"; then
PKG_CHECK_MODULES(PINENTRY_QT,
QtCore >= 4.6.0 QtGui >= 4.6.0,
[have_qt4_libs="yes"],
[have_qt4_libs="no"])
if test "$have_qt4_libs" = "yes"; then
AC_CHECK_TOOL(MOC, moc)
AC_MSG_CHECKING([moc version])
mocversion=`$MOC -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
AC_MSG_RESULT([no])
# moc was not the qt4 one, try with moc-qt4
AC_CHECK_TOOL(MOC2, moc-qt4)
mocversion=`$MOC2 -v 2>&1`
mocversiongrep=`echo $mocversion | grep "Qt 4"`
if test x"$mocversiongrep" != x"$mocversion"; then
# no valid moc found
have_qt4_libs="no";
MOC="not found"
else
MOC=$MOC2
fi
fi
fi
fi
])
diff --git a/qt/Makefile.am b/qt/Makefile.am
index 1175466..42955e5 100644
--- a/qt/Makefile.am
+++ b/qt/Makefile.am
@@ -1,71 +1,79 @@
# 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 = document-encrypt.png pinentry.qrc
+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) $(LIBCAP)
pinentry_qt_LDFLAGS = $(PINENTRY_QT_LDFLAGS)
if BUILD_PINENTRY_QT
BUILT_SOURCES = \
- pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc
+ pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc \
+ pinentryrc.cpp
endif
CLEANFILES = \
- pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc
+ pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc \
+ pinentryrc.cpp
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 qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h \
+ 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 \
+ accessibility.h qti18n.cpp pinentryrc.qrc \
$(pinentry_qt_platform_SOURCES)
nodist_pinentry_qt_SOURCES = \
- pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc
+ pinentryconfirm.moc pinentrydialog.moc pinlineedit.moc capslock.moc \
+ pinentryrc.cpp
.h.moc:
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
+
+pinentryrc.cpp: pinentryrc.qrc
+ $(RCC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
diff --git a/qt/document-encrypt.png b/qt/icons/document-encrypt.png
similarity index 100%
rename from qt/document-encrypt.png
rename to qt/icons/document-encrypt.png
diff --git a/qt/icons/hint.svg b/qt/icons/hint.svg
new file mode 100644
index 0000000..f6b818f
--- /dev/null
+++ b/qt/icons/hint.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <defs id="defs3051">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ </style>
+ </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none"
+ d="M 13.314453 2 L 2 13.294922 L 2.7148438 14 L 14 2.6972656 L 13.314453 2 z M 8 3 A 8.9999916 9.000003 0 0 0 0.12304688 7.6679688 C 0.25199187 8.0317035 0.48048562 8.3445563 0.77929688 8.5761719 A 7.9999926 8.0000028 0 0 1 8 4 A 3.9999993 4.0000007 0 0 0 4 8 A 3.9999993 4.0000007 0 0 0 4.1054688 8.8945312 L 5 8 A 2.9999993 3.0000005 0 0 1 8 5 L 8.8925781 4.1074219 A 3.9999993 4.0000007 0 0 0 8.3496094 4.0175781 A 7.9999926 8.0000028 0 0 1 8.9277344 4.0722656 L 9.8066406 3.1933594 A 8.9999916 9.000003 0 0 0 8 3 z M 13.835938 5.1640625 L 13.121094 5.8789062 A 7.9999926 8.0000028 0 0 1 15.220703 8.5761719 C 15.522218 8.3424607 15.752612 8.0261216 15.880859 7.6582031 A 8.9999916 9.000003 0 0 0 13.835938 5.1640625 z M 11.894531 7.1054688 L 11 8 A 2.9999993 3.0000005 0 0 1 8 11 L 7.1074219 11.892578 A 3.9999993 4.0000007 0 0 0 8 12 A 3.9999993 4.0000007 0 0 0 12 8 A 3.9999993 4.0000007 0 0 0 11.894531 7.1054688 z "
+ class="ColorScheme-Text"
+ />
+</svg>
diff --git a/qt/icons/password-generate.svg b/qt/icons/password-generate.svg
new file mode 100644
index 0000000..12d703c
--- /dev/null
+++ b/qt/icons/password-generate.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <defs id="defs3051">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ </style>
+ </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none"
+ d="m3.5 2l-.531.969-.969.531.969.531.531.969.531-.969.969-.531-.969-.531zm7.631 0l-9.125 9.125 2.875 2.875 9.125-9.125zm0 1.438l1.438 1.439-2.781 2.779-1.438-1.438z"
+ class="ColorScheme-Text"
+ />
+</svg>
diff --git a/qt/icons/visibility.svg b/qt/icons/visibility.svg
new file mode 100644
index 0000000..df91c9d
--- /dev/null
+++ b/qt/icons/visibility.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <defs id="defs3051">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ </style>
+ </defs>
+ <g
+ transform="translate(-421.71429,-531.79074)">
+ <g
+ transform="matrix(0.75,0,0,0.74999813,421.46429,-241.22897)">
+ <path
+ style="fill:currentColor;fill-opacity:1;stroke:none"
+ d="M 8 3 A 8.9999925 9.0000023 0 0 0 0.12304688 7.6679688 C 0.2519919 8.0317178 0.48048563 8.3445725 0.77929688 8.5761719 A 7.9999935 8.0000021 0 0 1 8 4 A 3.9999996 4.0000004 0 0 0 4 8 A 3.9999996 4.0000004 0 0 0 8 12 A 3.9999996 4.0000004 0 0 0 12 8 A 3.9999996 4.0000004 0 0 0 8.3496094 4.0175781 A 7.9999935 8.0000021 0 0 1 15.220703 8.5761719 C 15.522218 8.3424725 15.752612 8.0260772 15.880859 7.6582031 A 8.9999925 9.0000023 0 0 0 8 3 z M 8 5 A 2.9999996 3.0000002 0 0 1 11 8 A 2.9999996 3.0000002 0 0 1 8 11 A 2.9999996 3.0000002 0 0 1 5 8 A 2.9999996 3.0000002 0 0 1 8 5 z M 8 6 A 1.9999999 2.0000003 0 0 0 6 8 A 1.9999999 2.0000003 0 0 0 8 10 A 1.9999999 2.0000003 0 0 0 10 8 A 1.9999999 2.0000003 0 0 0 9.9101562 7.4121094 A 0.9999999 1 0 0 1 9 8 A 0.9999999 1 0 0 1 8 7 A 0.9999999 1 0 0 1 8.5898438 6.0898438 A 1.9999999 2.0000003 0 0 0 8 6 z "
+ transform="matrix(1.3333333,0,0,1.3333367,0.33333333,1030.6955)"
+ class="ColorScheme-Text"
+ id="rect4170" />
+ </g>
+ </g>
+</svg>
diff --git a/qt/main.cpp b/qt/main.cpp
index 4e5b44f..81b48a3 100644
--- a/qt/main.cpp
+++ b/qt/main.cpp
@@ -1,426 +1,426 @@
/* 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, pe->timeout, title, desc, buttons, nullptr);
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(icon());
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(":/document-encrypt.png")));
+ 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 ;
}
diff --git a/qt/pinentry.qrc b/qt/pinentry.qrc
deleted file mode 100644
index 94db054..0000000
--- a/qt/pinentry.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC>
-<RCC version="1.0">
-<qresource>
- <file>document-encrypt.png</file>
-</qresource>
-</RCC>
diff --git a/qt/pinentrydialog.cpp b/qt/pinentrydialog.cpp
index 53e394f..901cb33 100644
--- a/qt/pinentrydialog.cpp
+++ b/qt/pinentrydialog.cpp
@@ -1,708 +1,708 @@
/* 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 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 icon(QStyle::StandardPixmap which)
{
QPixmap pm = qApp->windowIcon().pixmap(48, 48);
if (which != QStyle::SP_CustomBase) {
const QIcon ic = qApp->style()->standardIcon(which);
QPainter painter(&pm);
const int emblemSize = 22;
painter.drawPixmap(pm.width() - emblemSize, 0,
ic.pixmap(emblemSize, emblemSize));
}
return pm;
}
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),
mRepeat(NULL),
mRepeatError{nullptr},
_grabbed(false),
_disable_echo_allowed(true),
mEnforceConstraints(false),
mFormatPassphrase{false},
mVisibilityTT(visibilityTT),
mHideTT(hideTT),
mVisiActionEdit(NULL),
mGenerateButton{nullptr},
mVisiCB(NULL),
mFormattedPassphraseHint(NULL),
mFormattedPassphraseHintSpacer(NULL),
mCapsLockHint(NULL),
mConstraintsHint(NULL)
{
_timed_out = false;
if (modal) {
setWindowModality(Qt::ApplicationModal);
}
_icon = new QLabel(this);
_icon->setPixmap(icon());
QPalette redTextPalette;
redTextPalette.setColor(QPalette::WindowText, Qt::red);
_error = new QLabel(this);
_error->setPalette(redTextPalette);
_error->hide();
mCapsLockHint = new QLabel(this);
mCapsLockHint->setPalette(redTextPalette);
mCapsLockHint->setAlignment(Qt::AlignCenter);
mCapsLockHint->setVisible(false);
_desc = new QLabel(this);
_desc->hide();
_prompt = new QLabel(this);
_prompt->hide();
_edit = new PinLineEdit(this);
_edit->setMaxLength(256);
_edit->setMinimumWidth(_edit->fontMetrics().averageCharWidth()*20 + 48);
_edit->setEchoMode(QLineEdit::Password);
_prompt->setBuddy(_edit);
if (!repeatString.isNull()) {
mGenerateButton = new QPushButton{this};
- mGenerateButton->setIcon(QIcon::fromTheme(QLatin1String("password-generate")));
+ mGenerateButton->setIcon(QIcon(QLatin1String(":/icons/password-generate")));
mGenerateButton->setVisible(false);
connect(mGenerateButton, &QPushButton::clicked, this, &PinEntryDialog::generatePin);
}
if (!repeatString.isNull()) {
mRepeat = new PinLineEdit(this);
mRepeatError = new QLabel{this};
mRepeatError->setPalette(redTextPalette);
mRepeatError->hide();
}
if (enable_quality_bar) {
_quality_bar_label = new QLabel(this);
_quality_bar_label->setAlignment(Qt::AlignVCenter);
_quality_bar = new QProgressBar(this);
_quality_bar->setAlignment(Qt::AlignCenter);
_have_quality_bar = true;
} else {
_have_quality_bar = false;
}
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));
}
if (timeout > 0) {
_timer = new QTimer(this);
connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
_timer->start(timeout * 1000);
} else {
_timer = NULL;
}
connect(buttons, SIGNAL(accepted()), this, SLOT(onAccept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(_edit, SIGNAL(textChanged(QString)),
this, SLOT(updateQuality(QString)));
connect(_edit, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
connect(_edit, SIGNAL(backspacePressed()),
this, SLOT(onBackspace()));
if (mRepeat) {
connect(_edit, &QLineEdit::returnPressed,
this, [this] { mRepeat->setFocus(); });
}
auto *const mainLayout = new QVBoxLayout{this};
auto *const hbox = new QHBoxLayout;
hbox->addWidget(_icon, 0, Qt::AlignVCenter | Qt::AlignLeft);
auto *const grid = new QGridLayout;
int row = 1;
grid->addWidget(_error, row++, 1, 1, 2);
grid->addWidget(_desc, row++, 1, 1, 2);
grid->addWidget(mCapsLockHint, row++, 1, 1, 2);
grid->addWidget(_prompt, row, 1);
{
const auto l = new QHBoxLayout;
l->addWidget(_edit, 1);
if (mGenerateButton) {
l->addWidget(mGenerateButton);
}
grid->addLayout(l, row++, 2);
}
mConstraintsHint = new QLabel;
mConstraintsHint->setVisible(false);
grid->addWidget(mConstraintsHint, row++, 2);
mFormattedPassphraseHintSpacer = new QLabel;
mFormattedPassphraseHintSpacer->setVisible(false);
mFormattedPassphraseHint = new QLabel;
mFormattedPassphraseHint->setVisible(false);
grid->addWidget(mFormattedPassphraseHintSpacer, row, 1);
grid->addWidget(mFormattedPassphraseHint, row++, 2);
if (mRepeat) {
mRepeat->setMaxLength(256);
mRepeat->setEchoMode(QLineEdit::Password);
connect(mRepeat, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
QLabel *repeatLabel = new QLabel(repeatString);
repeatLabel->setBuddy(mRepeat);
grid->addWidget(repeatLabel, row, 1);
grid->addWidget(mRepeat, row++, 2);
grid->addWidget(mRepeatError, row++, 2);
}
if (enable_quality_bar) {
grid->addWidget(_quality_bar_label, row, 1);
grid->addWidget(_quality_bar, row++, 2);
}
/* Set up the show password action */
- const QIcon visibilityIcon = QIcon::fromTheme(QLatin1String("visibility"));
- const QIcon hideIcon = QIcon::fromTheme(QLatin1String("hint"));
+ 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);
connect(mVisiActionEdit, SIGNAL(triggered()), this, SLOT(toggleVisibility()));
} else
#endif
{
if (!mVisibilityTT.isNull()) {
mVisiCB = new QCheckBox(mVisibilityTT);
connect(mVisiCB, SIGNAL(toggled(bool)), this, SLOT(toggleVisibility()));
grid->addWidget(mVisiCB, row++, 1, 1, 2, Qt::AlignLeft);
}
}
hbox->addLayout(grid, 1);
mainLayout->addLayout(hbox);
mainLayout->addStretch(1);
mainLayout->addWidget(buttons);
auto capsLockWatcher = new CapsLockWatcher{this};
connect(capsLockWatcher, &CapsLockWatcher::stateChanged,
this, [this] (bool locked) {
mCapsLockHint->setVisible(locked);
});
connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget *)),
this, SLOT(focusChanged(QWidget *, QWidget *)));
connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)),
this, SLOT(checkCapsLock()));
checkCapsLock();
#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
}
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(icon());
setError(QString());
}
QString PinEntryDialog::description() const
{
return _desc->text();
}
void PinEntryDialog::setError(const QString &txt)
{
if (!txt.isNull()) {
_icon->setPixmap(icon(QStyle::SP_MessageBoxCritical));
}
_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->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);
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;
}
}
// make Ok the default button unless we have a repeat input field and
// the first input field has focus now; this allows us to move the focus
// to the repeat input field when the user presses Return in the first
// input field; otherwise, the dialog would "press" Ok when it receives
// the Return key press
_ok->setDefault(!mRepeat || now != _edit);
}
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::fromTheme(QLatin1String("hint")));
+ 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::fromTheme(QLatin1String("visibility")));
+ 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();
}
}
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"
diff --git a/qt/pinentryrc.qrc b/qt/pinentryrc.qrc
new file mode 100644
index 0000000..6ffab99
--- /dev/null
+++ b/qt/pinentryrc.qrc
@@ -0,0 +1,9 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+<qresource>
+ <file>icons/document-encrypt.png</file>
+ <file>icons/hint.svg</file>
+ <file>icons/password-generate.svg</file>
+ <file>icons/visibility.svg</file>
+</qresource>
+</RCC>
diff --git a/qt/qrc_pinentry.cpp b/qt/qrc_pinentry.cpp
deleted file mode 100644
index 6ab2129..0000000
--- a/qt/qrc_pinentry.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-** Resource object code
-**
-** Created: Wed Feb 17 23:35:02 2010
-** by: The Resource Compiler for Qt version 4.4.3
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include <QtCore/qglobal.h>
-
-static const unsigned char qt_resource_data[] = {
- // /home/marc/KDE/src/gnupg-backend/pinentry/qt4/document-encrypt.png
- 0x0,0x0,0x7,0x2b,
- 0x89,
- 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
- 0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
- 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88,
- 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x5,0x31,0x0,0x0,0x5,0x31,
- 0x1,0xb7,0xed,0x28,0x52,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,
- 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61,
- 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x6,0xa8,0x49,0x44,
- 0x41,0x54,0x78,0xda,0xd5,0x59,0x4b,0x6c,0x55,0x45,0x18,0xfe,0x67,0xce,0x7d,0xf5,
- 0xfd,0xc0,0x82,0xb1,0xd,0xb,0xdd,0x11,0x34,0x46,0xd1,0xd,0x1b,0x42,0x4c,0x48,
- 0x31,0xb4,0x68,0x52,0x16,0xb8,0x31,0xae,0x4c,0xec,0x92,0x85,0xa9,0x8b,0x6e,0x8c,
- 0xb2,0x60,0xa9,0x21,0xee,0x5c,0xdb,0xf8,0x58,0xb9,0xa1,0x6d,0x60,0x61,0x42,0xb4,
- 0xe0,0x2,0x41,0xd,0x8,0xd1,0xb6,0x94,0x36,0x5c,0xfb,0xa6,0xbd,0xf7,0x9e,0x73,
- 0xc6,0xef,0xfb,0x73,0x99,0x73,0xe3,0xc5,0x40,0xd3,0x9e,0x5b,0x99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0x90,0x65,0x44,
- 0x43,0x58,0xe0,0x15,0x81,0xb0,0x12,0x58,0x86,0x1a,0xde,0x81,0xcc,0x6,0xec,0x43,
- 0xe2,0x1d,0x95,0x58,0x97,0x6b,0x1,0x89,0x56,0x10,0x6c,0xc5,0x73,0x4b,0x9f,0x2e,
- 0xc4,0x9b,0xc,0xad,0x74,0x8,0x50,0xa9,0x28,0x22,0x2,0x71,0x84,0x33,0x12,0x39,
- 0xc6,0x32,0x89,0x19,0x82,0x4a,0x60,0xdc,0xa2,0xaf,0x74,0x1,0x84,0x90,0xce,0x13,
- 0xb1,0x44,0x92,0xc1,0x12,0x23,0xb1,0xe5,0xd7,0x1d,0xd6,0xc6,0x80,0xc3,0x1c,0xde,
- 0xe1,0x46,0x0,0xae,0x16,0xe9,0x10,0xb0,0x96,0xd6,0x73,0x30,0x25,0x3e,0x8a,0x8f,
- 0x84,0xb4,0x96,0xe8,0x4c,0x95,0x0,0x3e,0xc,0x38,0x6b,0x34,0x74,0x38,0x19,0x83,
- 0x44,0x88,0xe1,0x80,0xd6,0xd5,0x57,0x23,0x90,0xc7,0x32,0x40,0x42,0xc,0x68,0x1d,
- 0xa8,0x0,0xbc,0xd9,0x2,0xd6,0xa6,0xe4,0x1,0xdf,0x9c,0xc4,0x80,0x8b,0x61,0xb5,
- 0xc0,0xd1,0x60,0x0,0x65,0xa4,0x16,0x57,0xc3,0x1a,0xc7,0x2e,0x43,0x88,0xc4,0x54,
- 0x5a,0x8c,0x5,0xec,0x63,0x5c,0x3,0x5,0x2f,0x3a,0x1a,0xc2,0x71,0x4d,0x6,0x32,
- 0x20,0x68,0x98,0xd4,0x3c,0xe0,0xc3,0xa8,0xea,0x7f,0xc8,0x90,0xa,0x78,0x44,0x40,
- 0x88,0xb9,0x58,0x17,0x92,0x26,0x63,0x5f,0x9f,0xc4,0xa8,0x53,0xac,0x5f,0x6b,0xa2,
- 0x8,0x88,0x51,0x9d,0x1c,0x40,0x19,0x81,0x19,0x90,0xb6,0x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x5b,0x25,0xfd,0xf6,0x14,0x12,0x48,0xe1,0x97,0x7a,0x5f,0xce,0x32,0x40,
- 0xf0,0x18,0x58,0x2f,0x13,0x18,0x2f,0x89,0xfa,0xe6,0xaa,0x88,0xbd,0x4c,0x10,0x3d,
- 0x94,0x8f,0x41,0x48,0x9d,0x6b,0x9,0x50,0xe9,0xa0,0xaa,0x74,0x96,0x72,0x87,0x61,
- 0xab,0x8a,0x85,0x3b,0x88,0xa,0x50,0x66,0xff,0xbf,0x3c,0x60,0xeb,0x91,0x58,0xfd,
- 0x31,0xb0,0x89,0xe2,0xa,0xa9,0xb3,0xb4,0x87,0x7f,0xe,0xeb,0x3d,0x50,0xef,0x1d,
- 0xc2,0xfd,0x4b,0xe1,0x7f,0x0,0xd8,0x6e,0xc6,0xdd,0x5d,0xd6,0xb,0x18,0x0,0x0,
- 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
-};
-
-static const unsigned char qt_resource_name[] = {
- // document-encrypt.png
- 0x0,0x14,
- 0x8,0xbf,0x25,0x67,
- 0x0,0x64,
- 0x0,0x6f,0x0,0x63,0x0,0x75,0x0,0x6d,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x2d,0x0,0x65,0x0,0x6e,0x0,0x63,0x0,0x72,0x0,0x79,0x0,0x70,0x0,0x74,0x0,0x2e,
- 0x0,0x70,0x0,0x6e,0x0,0x67,
-};
-
-static const unsigned char qt_resource_struct[] = {
- // :
- 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
- // :/document-encrypt.png
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
-
-};
-
-QT_BEGIN_NAMESPACE
-
-extern bool qRegisterResourceData
- (int, const unsigned char *, const unsigned char *, const unsigned char *);
-
-extern bool qUnregisterResourceData
- (int, const unsigned char *, const unsigned char *, const unsigned char *);
-
-QT_END_NAMESPACE
-
-
-int QT_MANGLE_NAMESPACE(qInitResources_pinentry)()
-{
- QT_PREPEND_NAMESPACE(qRegisterResourceData)
- (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
- return 1;
-}
-
-Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_pinentry))
-
-int QT_MANGLE_NAMESPACE(qCleanupResources_pinentry)()
-{
- QT_PREPEND_NAMESPACE(qUnregisterResourceData)
- (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
- return 1;
-}
-
-Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_pinentry))
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Dec 23, 1:14 PM (47 m, 28 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
90/51/7c2a8e99b6f3557f9d0ca8dfd6de
Attached To
rP Pinentry
Event Timeline
Log In to Comment