Bug 704495 - gpg-agent does not support utf-8
gpg-agent does not support utf-8
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pinentry (Show other bugs)
Unspecified Unspecified
high Severity unspecified
: rc
: ---
Assigned To: Boris Ranto
Martin Žember
: 1191639 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2011-05-13 08:05 EDT by Tomasz Kepczynski
Modified: 2015-07-13 00:14 EDT (History)
8 users (show)

See Also:
Fixed In Version: pinentry-0.7.6-8.el6
Doc Type: Bug Fix
Doc Text:
Cause: The pinentry-curses binary lacked UTF-8 support in some places. Consequence: The output of description text in pinentry getpin command got scrambled. Fix: Do a proper utf-8 translation and compile pinentry against ncursesw that contains the wide char support necessary to fix this. Result: The description field in getpin command is outputted correctly.
Story Points: ---
Clone Of:
: 724972 (view as bug list)
Last Closed: 2015-03-30 04:09:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
garbled output from gpg when asking for password (37.95 KB, image/png)
2011-05-13 08:05 EDT, Tomasz Kepczynski
no flags Details
pinentry-curses garbled output (26.64 KB, image/png)
2011-05-17 04:17 EDT, Tomasz Kepczynski
no flags Details

  None (edit)
Description Tomasz Kepczynski 2011-05-13 08:05:52 EDT
Created attachment 498757 [details]
garbled output from gpg when asking for password

Description of problem:
gnupg2 requires usage of agent to retrieve key passphrase. Console version of this agent doesn't seem to support UTF-8 properly - see the attached screenshot.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Use gpg on a key which contains non-ascii characters in its name.
Actual results:
The output is garbled

Expected results:
The output is clean.

Additional info:
Detected on ScientificLinux 6 but I guess this is also a case on RHEL.
Comment 1 Tomas Mraz 2011-05-13 08:17:14 EDT
I do not think this is a bug in the gnupg2. I suppose there is non-utf8 locale set in the gnupg2 agent environment.

Can you call 'unset GPG_AGENT_INFO' before runing the gpg2 command and test it again?
Comment 3 Tomasz Kepczynski 2011-05-13 12:51:08 EDT
I don't think this is a reason:

triss:~> set | grep GPG

But to make sure I am not missing anything, I tried:

triss:~> unset GPG_AGENT_INFO
triss:~> gpg -d ~/pliki/txt/dane.txt.asc

with exactly the same problem as in the screenshot.

And locale for completness:

triss:~> locale

Now, the problem looks very similar to fault in finger, which also garbled UTF-8 output, this was caused by outputting a string byte by byte with putc instead pushing whole string at once to terminal. Maybe this is the case?
Comment 4 Tomas Mraz 2011-05-16 01:45:22 EDT
What terminal do you use?
Comment 5 Tomasz Kepczynski 2011-05-16 14:35:54 EDT
I can reproduce this on:
- local text console (linux)
- remote linux console (text console + ssh connection)
- local konsole (kde konsole)
- remote konsole (kde konsole + ssh)

konsole identifies itself as xterm (TERM=xterm)
Comment 6 Tomasz Kepczynski 2011-05-16 14:41:06 EDT
I take back local konsole part - in this case dialog box is displayed and my name is displayed correctly.
Comment 7 Tomas Mraz 2011-05-16 15:14:21 EDT
The terminal output is handled by pinentry.
Comment 8 Tomasz Kepczynski 2011-05-17 04:17:11 EDT
Created attachment 499280 [details]
pinentry-curses garbled output
Comment 9 Tomasz Kepczynski 2011-05-17 04:18:55 EDT
I tried the following in pinentry-curses:

gklab-63-001:~> pinentry-curses
OK Your orders please
option lc-ctype=pl_PL.UTF-8
setdesc ąćęłńóśźżĄĆĘŁŃÓŚŹŻ

which resulted in the attached above screen. This seems to confirm that a problem is in pinentry.
Comment 10 RHEL Product and Program Management 2011-07-05 21:32:35 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
Comment 13 Stanislav Ochotnicky 2011-07-18 05:10:30 EDT
The bug can be reproduced in also in RHEL 6. Thank you for the bugreport.
Comment 16 Stanislav Ochotnicky 2012-07-04 07:48:32 EDT
For the record, upstream fixed this[1]. Have yet to look at possible backporting.

[1] http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commitdiff;h=e2b89cbdcba7475047ca3c46fc7d03825355b3ff
Comment 23 Boris Ranto 2015-02-26 06:30:08 EST
*** Bug 1191639 has been marked as a duplicate of this bug. ***
Comment 27 Boris Ranto 2015-02-26 16:00:15 EST
dist-git commits related to build pinentry-0.7.6-8.el6:
Comment 36 errata-xmlrpc 2015-03-30 04:09:22 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.