Kleopatra: Display an error on symmetric encryption with too long password
Open, LowPublic

Assigned To
None
Authored By
timegrid
Thu, Jul 2, 3:04 PM

Description

Symmetric encryption in Kleopatra notepad with >255 chars will:

  • not encrypt the content
  • show now error

To reproduce:

  1. Open notepad, enter some text, activate symmetric encryption
  2. Enter >255 chars in pinentry for the symmetric password, e.g.
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
  1. Confirm the password, press OK => content was not encrypted, no error (same state as before sign/encrypt was chosen)

CLI (gpg reports an error):

C:\Users\g10\Desktop\testdata>gpg -vv --status-fd 2 --encrypt --symmetric test.png
gpg: enabled compatibility flags:
[GNUPG:] NEED_PASSPHRASE_SYM 9 3 8
gpg: pinentry launched (8388 qt5 1.3.2 - - - - 0/0 -)
[GNUPG:] PINENTRY_LAUNCHED 8388 qt5 1.3.2 - - - - 0/0 -
gpg: problem with the agent: Not implemented
[GNUPG:] ERROR get_passphrase 69
[GNUPG:] CANCELED_BY_USER
[GNUPG:] FAILURE encrypt 33554531
gpg: test.png: encryption failed: Operation cancelled

Details

Version
vsd-3.4.0-beta1294 @ win10

Event Timeline

timegrid created this task.
timegrid created this object with edit policy "Contributor (Project)".

This looks like an error in the backend or in gpgme. If the backend/gpgme reports that the operation was canceled by the user then we usually don't show any message. In particular, we never show an error message if no error has been reported.

Ok, I'll retag for gpg/gpgme.

If symmetric password length >255 is not supported, it would be nice to be able to feedback this to the user.

I cannot reproduce this with GnuPG 2.2.45-beta27 or GnuPG 2.5.21-beta1 on Linux. Neither on CLI nor with Kleopatra.

After entering the too long passphrase (and repeating it) and pressing OK a second pinentry pops up with error text

Passphrase too long (try 2 of 3)

which is okay.

After entering the too long passphrase (and repeating it) and pressing OK a second time a third pinentry pops up with error text

You have not entered a passphrase!
An empty passphrase is not allowed. (try 1 of 3)

This is obviously a bug.

So, I also see a problem but apparently a different one.

On vsd-3.4.0-beta1294 @ win10 / GnuPG 2.2.54 it's like i described (dialog just closes). I'll wait for the next beta to be sure.
On gpg4win-5.1.0-beta646 @ win11 / GnuPG 2.5.21 the behavior matches your description (too long / empty passphrase).