Page MenuHome GnuPG

gpg2/pinentry fails in non-UTF-8 locale
Closed, ResolvedPublic

Description

With many operations, for example simply encrypting a file using a symmetric
cipher, gpg2 fails if it runs in some non-UTF8 locales when asking for a
passphrase. For example, running

env LANG=sv_SE gpg2 -c file

Will result in these error messages:

pinentry-curses: error converting from UTF-8 to ISO-8859-1: Invalid or
incomplete multibyte or wide character
gpg-agent[15300]: command get_passphrase failed: Operation cancelled
gpg: avbruten av användaren
gpg: fel vid skapandet av lösenmening: Invalid passphrase
gpg: symmetric encryption of `file' failed: Invalid passphrase

It does not seem to happen with all non-UTF-8 locales, only some. I haven't
figured out the pattern. The corresponding UTF-8 locale, like sv_SE.utf8 works
fine.

The environment is a Fedora system, with GnuPG 2.0.1.

Details

Due Date
May 30 2007, 2:00 AM
Version
2.0.1

Event Timeline

goeran added a project: Bug Report.
goeran added a subscriber: goeran.

I can't duplicate this with the soon to be released 2.0.4. I did no tests with
older versions, though.

What version of pinentry is this: gtk, gtk2 or qt?

Neither gtk nor qt, I'm trying to run the curses version. (Would it help if I
tried the gtk and/or qt version?)

Are you referring to GnuPG 2.0.4? I have a different version number, 0.7.2, for
the pinentry package than for GnuPG. But this is what I got from Fedora
packages, I haven't looked closer at the upstreams packaging.

Ah okay. ncurses is not that often used.

pinentry and gnupg are separate package, thus two different version numbers.

werner set Due Date to May 15 2007, 2:00 AM.
werner added a subscriber: marcus.

The problem is that gpg2 sends the translated string for "Enter passphrase: " in
ISO8859-1 (?) to the gpg-agent, although we specified that all internal
communication should be in UTF-8. pinentry then tries to translate that string
to ISO8859-1 again, which obviously fails.

Werner: Either we need to specify a communication character set in the assuan
interface, and pass that through all levels, or we need to ensure that gpg sends
UTF-8 no matter what gettext produces. How can we do the latter?

Then this is a bug in gpg2. All internal communication has to be done in utf-8.

werner changed Version from pinentry 0.7.2 to 2.0.1.

Found it. It used PACKAGE, not PACKAGE_GT, thereby using the wrong po file,
messing things up.

2007-05-19 Marcus Brinkmann <marcus@g10code.de>

  • passphrase.c (passphrase_get): Use PACKAGE_GT, not PACKAGE.
marcus added a project: Restricted Project.May 19 2007, 12:52 AM
marcus changed Due Date from May 15 2007, 2:00 AM to May 30 2007, 2:00 AM.
werner removed a project: Restricted Project.