1. 11 Jan, 2022 1 commit
  2. 25 Aug, 2021 1 commit
  3. 18 Aug, 2021 3 commits
  4. 16 Aug, 2021 1 commit
  5. 12 Aug, 2021 7 commits
    • Ingo Klöcker's avatar
      qt: Make pinentry compile again with QT_NO_ACCESSIBILITY · 141b5776
      Ingo Klöcker authored
      * qt/accessibility.cpp, qt/accessibility.h: New.
      * qt/Makefile.am (pinentry_qt_SOURCES): Add new files.
      * qt/main.cpp (qt_cmd_handler): Use new Accessibility helpers.
      * qt/pinentryconfirm.cpp (PinentryConfirm::PinentryConfirm): Use new
      Accessibility helpers.
      * qt/pinentrydialog.cpp (PinEntryDialog::setDescription,
      PinEntryDialog::setError, PinEntryDialog::setOkText,
      PinEntryDialog::setCancelText, PinEntryDialog::setQualityBar,
      PinEntryDialog::setGenpinLabel, PinEntryDialog::setCapsLockHint,
      PinEntryDialog::setConstraintsOptions): Use new Accessibility helpers.
      (PinEntryDialog::textChanged, PinEntryDialog::checkCapsLock): Guard
      code using accessibility features with #ifndef QT_NO_ACCESSIBILITY.
      
      GnuPG-bug-id: 5543
      141b5776
    • Ingo Klöcker's avatar
      qt: Always make passphrase visible after generating it · e0b4e552
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::generatePin): Trigger
      visibility action or check visibility checkbox.
      --
      
      Now the generated passphrase is also made visible if the visibility
      checkbox instead of the visibility action exists.
      
      GnuPG-bug-id: 5517
      e0b4e552
    • Ingo Klöcker's avatar
      qt: Prevent possible crash when generating pin · 146fc044
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::toggleVisibility): Check
      visibility action for nullptr.
      --
      
      This crash occurs if the visibility checkbox is created instead of the
      visibility action of the password input field. This happens if the
      icons for the visibility action cannot be found.
      146fc044
    • Ingo Klöcker's avatar
      qt: Change calculation of end of selection when enabling formatting · 1349fb7b
      Ingo Klöcker authored
      * qt/pinlineedit.cpp (PinLineEdit::Private::formattedSelection):
      Do not include trailing separator in selection.
      --
      
      GnuPG-bug-id: 5517
      1349fb7b
    • Ingo Klöcker's avatar
      qt: Fix calculation of end of selection when disabling formatting · 1ae88d75
      Ingo Klöcker authored
      * qt/pinlineedit.cpp (PinLineEdit::Private::unformattedSelection):
      Fix calculation.
      --
      
      GnuPG-bug-id: 5517
      1ae88d75
    • Ingo Klöcker's avatar
      qt: Remove checkbox for passphrase formatting · 06190adb
      Ingo Klöcker authored
      * qt/main.cpp (qt_cmd_handler): Pass changed formatted passphrase
      options to the dialog.
      * qt/pinentrydialog.h (PinEntryDialog): Add field mFormatPassphrase.
      Remove field mFormattedPassphraseCB.
      (enum PinEntryDialog::FormattedPassphraseMode): Remove.
      (struct PinEntryDialog::FormattedPassphraseOptions): Remove fields
      mode, label, tooltip. Add field formatPassphrase.
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
      mFormatPassphrase.
      (PinEntryDialog::setFormattedPassphrase): Set mFormatPassphrase.
      Update widgets.
      (PinEntryDialog::toggleFormattedPassphrase): Use mFormatPassphrase
      instead of state of removed checkbox.
      --
      
      This simplifies the formatted passphrase feature by removing the
      possibility to enable/disable the formatting on the fly. Formatting
      is now controlled exclusively by a configuration option.
      
      GnuPG-bug-id: 5553, 5517
      06190adb
    • Ingo Klöcker's avatar
      Make passphrase formatting a simple flag · c42c6371
      Ingo Klöcker authored
      * pinentry/pinentry.h (struct pinentry): Remove fields
      formatted_passphrase_label, formatted_passphrase_tt.
      * pinentry/pinentry.c (pinentry_reset): Remove free'ing of removed
      fields.
      (option_handler): Treat option "formatted-passphrase" as simple flag.
      Remove options "formatted-passphrase-label", "formatted-passphrase-tt".
      --
      
      GnuPG-bug-id: 5553, 5517
      c42c6371
  6. 11 Aug, 2021 6 commits
    • Ingo Klöcker's avatar
      qt: Add missing header files to sources · 990afda6
      Ingo Klöcker authored
      * qt/Makefile.am (pinentry_qt_SOURCES): Add header files.
      --
      
      This ensures that 'make dist' includes all needed files.
      
      GnuPG-bug-id: 4950, 5517
      990afda6
    • Ingo Klöcker's avatar
      qt: Add logging category · 3086964f
      Ingo Klöcker authored
      * qt/pinentry_debug.cpp, qt/pinentry_debug.h: New.
      * qt/Makefile.am (pinentry_qt_SOURCES): Add new files.
      * qt/main.cpp (main): Use logging category for debug messages.
      --
      
      The logging category allows enabling or disabling logging of messages
      of certain types. By default, only warnings and more severe messages
      are enabled.
      
      GnuPG-bug-id: 3659
      3086964f
    • Ingo Klöcker's avatar
      qt: Fix crash when setting repeat error · d71d890e
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::setRepeatErrorText): Check
      for nullptr.
      --
      
      This fixes a crash if pinentry is used for something other than asking
      for a new password.
      
      GnuPG-bug-id: 5543
      Fixes-commit: 8acf47ea
      d71d890e
    • Ingo Klöcker's avatar
      qt: Change type and title of "Passwords do not match" notification · b8f1d2cc
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::onAccept): Make notification
      an "information". Use repeat error text as title.
      --
      
      This makes the type of the messagebox consistent with the messagebox
      used for password constraint violations. Additionally, it replaces
      the untranslated title with the translated repeat error text (for lack
      of a better translated text).
      
      GnuPG-bug-id: 5543
      b8f1d2cc
    • Ingo Klöcker's avatar
      qt: Avoid HTML markup in accessible descriptions and names · 639725b6
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::setFormattedPassphrase,
      PinEntryDialog::setConstraintsOptions):
      Set accessible descriptions and accessible names without HTML markup.
      --
      
      We use HTML markup for some tooltips and labels for nicer display. To
      prevent screen readers from reading this HTML markup we need to set
      the accessible description (takes precedent over the tooltip) and the
      accessible name (takes precedent over label text) to texts without
      HTML markup. (Note: For the label text Qt automatically tries to
      remove HTML markup when asked for the description, but for consistency
      and better control over the result we do it explicitly.)
      
      GnuPG-bug-id: 5543
      639725b6
    • Ingo Klöcker's avatar
      qt: Select generated password explicitly after giving focus to input · 70b14b29
      Ingo Klöcker authored
      qt/pinentrydialog.cpp (PinEntryDialog::generatePin): Select text in
      input field.
      --
      
      Giving the keyboard input focus to the input field does not always
      seem to select the generated password automatically. Explicitly
      selecting the password after giving focus makes sure the password
      is always selected.
      
      GnuPG-bug-id: 5543
      70b14b29
  7. 10 Aug, 2021 1 commit
    • Ingo Klöcker's avatar
      qt: Make the generate password action accessible · 42c0d3ee
      Ingo Klöcker authored
      * qt/pinentrydialog.h (PinEntryDialog): Remove unused field mGenerateTT.
      Remove field mGenerateActionEdit. Add field mGenerateButton.
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
      new field. Set up new push button.
      (PinEntryDialog::setGenpinLabel): Set accessible name and update
      visibility of new push button.
      (PinEntryDialog::setGenpinLabel): Set tooltip of new push button.
      (PinEntryDialog::setGenpinLabel): Update visibility of new push button.
      (PinEntryDialog::generatePin): Focus password input field.
      --
      
      This change makes the "Generate password" functionality accessible
      via keyboard and screen reader.
      
      GnuPG-bug-id: 5543
      42c0d3ee
  8. 09 Aug, 2021 1 commit
    • Ingo Klöcker's avatar
      qt: Improve accessibility when entering new password · 8acf47ea
      Ingo Klöcker authored
      * qt/pinentrydialog.h (PinEntryDialog): Change type of field
      mRepeatError from QString to QLabel*.
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
      mRepeatError. Add widget for "entered passwords do not match"
      error. Do not make the Ok button the default button. Connect to
      returnPressed signal of (first) password input field.
      (PinEntryDialog::focusChanged): Update default state of Ok button.
      (PinEntryDialog::textChanged): Remove code disabling the Ok button
      and setting a tooltip.
      (PinEntryDialog::setRepeatErrorText): Set text of "entered passwords
      do not match" widget.
      (PinEntryDialog::onAccept): Show error if entered passwords do not
      match.
      --
      
      Accessibility when asking for a new password is improved by:
      * Move focus from first password input field to second password input
      field when Return is pressed while first password input field has
      focus. Previously, nothing happened (unless first and second password
      matched).
      * Show an error notification, if entered passwords do not match,
      instead of disabling the Ok button and setting a tooltip.
      
      If the platform requested accessibility information, then we use a
      more intrusive message box for notifying the user that the entered
      passwords do not match. This is a workaround because at least the
      GNOME screen reader ignores the warning label that we make visible.
      It also ignores our other warning labels, so this is probably only
      a temporary workaround.
      
      GnuPG-bug-id: 5543
      8acf47ea
  9. 06 Aug, 2021 1 commit
    • Andre Heinecke's avatar
      qt: Mask caps lock toggle bit on windows · e5d4738a
      Andre Heinecke authored
      * qt/capslock_win.cpp (capsLockState): Mask toggle bit.
      
      --
      Checking for equality had the effect that depending on wether or
      not the key was pressed the caps lock warning could go out of
      sync with the keyboard indication of capslock.
      
      GnuPG-Bug-Id: 4950
      e5d4738a
  10. 02 Aug, 2021 5 commits
    • Ingo Klöcker's avatar
      qt: Try harder to find out whether we are running in a GUI session · 956ee260
      Ingo Klöcker authored
      * qt/main.cpp (main): Check more environment variables on Unix systems.
      --
      
      QGuiApplication checks all of those environment variables to figure out
      whether it is running under X11 or Wayland.
      
      GnuPG-bug-id: 3659
      956ee260
    • Ingo Klöcker's avatar
      Fix typo. · 0735afa8
      Ingo Klöcker authored
      0735afa8
    • Ingo Klöcker's avatar
      qt: Improve message shown if passphrase does not satisfy constraints · fefd7306
      Ingo Klöcker authored
      qt/pinentrydialog.cpp (PinEntryDialog::checkConstraints): Use
      property-based API of QMessageBox.
      --
      
      Using the property-based API of QMessageBox allows us to use the first
      line of the error message as text and the other lines as "informative
      text". Use the Information icon instead of the Error icon.
      
      GnuPG-bug-id: 5517, 5532
      fefd7306
    • Ingo Klöcker's avatar
      qt: Ensure that malloced strings are free'd · 6191d4f0
      Ingo Klöcker authored
      * qt/main.cpp (qt_cmd_handler): Use unique_malloced_ptr for malloced
      strings.
      * qt/pinentrydialog.cpp (PinEntryDialog::generatePin,
      PinEntryDialog::checkConstraints): Use unique_malloced_ptr for malloced
      strings.
      * qt/util.h: New.
      --
      
      Introducing unique_malloced_ptr<T> simplifies managing malloced strings
      by free'ing them automatically, when unique_malloced_ptr is destroyed.
      Fixes a memory leak in PinEntryDialog::generatePin.
      
      GnuPG-bug-id: 5517
      6191d4f0
    • Ingo Klöcker's avatar
      qt: Cancel timeout on more user interactions · f622321d
      Ingo Klöcker authored
      * qt/pinentrydialog.h, qt/pinentrydialog.cpp
      (PinentryDialog::cancelTimeout): New.
      * qt/pinentrydialog.cpp (PinEntryDialog::onBackspace): Cancel timeout.
      (PinEntryDialog::updateQuality, PinEntryDialog::textChanged): Cancel
      timeout in PinEntryDialog::textChanged instead of
      PinEntryDialog::updateQuality.
      (PinEntryDialog::onAccept): Cancel timeout.
      --
      
      Additionally to canceling the timeout when the user enters something
      into the passphrase input field we also cancel the timeout when the
      user presses Backspace (to disable passphrase echoing) or when the
      user clicks Ok. In particular, this prevents the pinentry dialog from
      being closed while the message that empty passphrases are not allowed
      is shown.
      
      GnuPG-bug-id: 5517, 5532
      f622321d
  11. 28 Jul, 2021 2 commits
    • Ingo Klöcker's avatar
      qt: Check passphrase constraints before accepting passphrase · b0969ef6
      Ingo Klöcker authored
      * qt/main.cpp (qt_cmd_handler): Pass constraints options to the dialog.
      * qt/pinentrydialog.h (PinEntryDialog): Add struct ConstraintsOptions.
      Add enum PassphraseCheckResult. Add fields mEnforceConstraints,
      mConstraintsHint, mConstraintsErrorTitle.
      * qt/pinentrydialog.h, qt/pinentrydialog.cpp
      (PinEntryDialog::setConstraintsOptions, PinEntryDialog::onAccept,
      PinEntryDialog::checkConstraints): New.
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
      new fields. Call onAccept() on click on Ok. Add widget for constraints
      hint.
      (PinEntryDialog::checkCapsLock): Constify variable.
      --
      
      This makes pinentry-qt check whether the entered passphrase satisfies
      the passphrase constraints in case the constraints are enforced by
      gpg-agent. If the constraints are not satisfied the user is informed,
      so that they can modify the passphrase.
      
      GnuPG-bug-id: 5517, 5532
      b0969ef6
    • Ingo Klöcker's avatar
      Add support for passphrase constraints options and checkpin inquiry · 8f5d4532
      Ingo Klöcker authored
      * pinentry/pinentry.h (struct pinentry): Add fields constraints_enforce,
      constraints_hint_short, constraints_hint_long, constraints_error_title.
      * pinentry/pinentry.h, pinentry/pinentry.c (pinentry_inq_checkpin):
      New.
      * pinentry/pinentry.c (pinentry_reset): Take care of the new fields.
      (do_unescape_inplace): New.
      (option_handler): New options "constraints-enforce",
      "constraints-hint-short", "constraints-hint-long",
      "constraints-error-title".
      --
      
      This implements the common pinentry side for checking whether a new
      passphrase satisfies the passphrase constraints.
      
      GnuPG-bug-id: 5517, 5532
      8f5d4532
  12. 26 Jul, 2021 3 commits
    • Ingo Klöcker's avatar
      Mention Caps Lock warning in NEWS file · 134f7551
      Ingo Klöcker authored
      GnuPG-bug-id: 4950
      134f7551
    • Ingo Klöcker's avatar
      qt: Add support for Caps Lock hint on Wayland · 3e803ebf
      Ingo Klöcker authored
      * configure.ac: Check for KF5WaylandClient. Add "-fpic" to CFLAGS.
      Define PINENTRY_QT_WAYLAND if pinentry-qt should use KF5WaylandClient.
      * qt/Makefile.am (BUILT_SOURCES, CLEANFILES, nodist_pinentry_qt_SOURCES):
      Add capslock.moc.
      (pinentry_qt_SOURCES): Add capslock.cpp.
      * qt/capslock.cpp: New.
      * qt/capslock.h (class CapsLockWatcher): New.
      * qt/capslock_p.h: New.
      * qt/capslock_unix.cpp (watchingWayland): New static.
      (capsLockState): Log hint for using CapsLockWatcher on Wayland.
      (CapsLockWatcher::Private::*): New.
      * qt/pinentrydialog.cpp: Include config.h.
      (PinEntryDialog::PinEntryDialog): Set up CapsLockWatcher.
      --
      
      This adds support for showing a warning if Caps Lock is on on Wayland.
      Support for Wayland is optional when building pinentry depending on the
      availability of the KF5WaylandClient library.
      
      GnuPG-bug-id: 4950
      3e803ebf
    • Ingo Klöcker's avatar
      qt: Differentiate unknown Caps Lock state from off state · a074c90c
      Ingo Klöcker authored
      * qt/capslock.h (enum class LockState): New.
      * qt/capslock.h, qt/capslock_unix.cpp, qt/capslock_win.cpp
      (capsLockIsOn, capsLockState): Rename former to latter. Change return
      type to LockState.
      * qt/capslock_unix.cpp (capsLockState): Remove check for qApp.
      * qt/pinentrydialog.cpp (checkCapsLock): Adapt to changed function name
      and return type of capsLockIsOn/capsLockState.
      --
      
      This change allows the pinentry to ignore an unknown state of Caps Lock.
      
      GnuPG-bug-id: 4950
      a074c90c
  13. 22 Jul, 2021 1 commit
    • Ingo Klöcker's avatar
      qt: Fix showing of pinentry window on Wayland · 9dd46926
      Ingo Klöcker authored
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Skip the
      minimize+raise trick on Wayland.
      --
      
      When running on Wayland then the following warning was logged:
      qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
      
      Skipping the minimize+raise calls shows the window on Wayland without
      fancy animation instead of not showing it at all.
      
      GnuPG-bug-id: 5528
      9dd46926
  14. 21 Jul, 2021 2 commits
    • Ingo Klöcker's avatar
      qt: Show hint if Caps Lock is on · 78e4284e
      Ingo Klöcker authored
      * configure.ac: Check for libX11. Define PINENTRY_QT_X11 if pinentry-qt
      should use x11.
      * m4/qt.m4: Check for Qt5X11Extras if libX11 is available.
      * qt/Makefile.am (pinentry_qt_platform_SOURCES): New.
      (pinentry_qt_SOURCES): Add pinentry_qt_platform_SOURCES.
      * qt/capslock.h, qt/capslock_unix.cpp, qt/capslock_win.cpp: New.
      * qt/main.cpp (qt_cmd_handler): Pass caps lock hint to the dialog.
      * qt/pinentrydialog.cpp, qt/pinentrydialog.h
      (PinEntryDialog::setCapsLockHint, PinEntryDialog::keyReleaseEvent,
      PinEntryDialog::checkCapsLock): New.
      * qt/pinentrydialog.h (PinEntryDialog): Use Q_SLOTS instead of slots.
      Add field mCapsLockHint.
      * qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
      new field. Add new widgets to GUI. Connect to applicationStateChanged()
      signal. Call checkCapsLock().
      --
      
      This adds support for showing a warning if Caps Lock is on. This is
      supported on X11 and on Windows.
      
      GnuPG-bug-id: 4950
      78e4284e
    • Ingo Klöcker's avatar
      Add support for Caps Lock hint · 672260f1
      Ingo Klöcker authored
      * pinentry/pinentry.h (struct pinentry): Add field 'default_capshint'.
      * pinentry/pinentry.cpp (pinentry_reset): Take care of this field.
      (option_handler): New option "default-capshint".
      --
      
      GnuPG-bug-id: 4950
      672260f1
  15. 15 Jul, 2021 5 commits