Bug 704495 - gpg-agent does not support utf-8
Summary: gpg-agent does not support utf-8
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pinentry
Version: 6.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Boris Ranto
QA Contact: Martin Žember
: 1191639 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2011-05-13 12:05 UTC by Tomasz Kepczynski
Modified: 2015-07-13 04:14 UTC (History)
8 users (show)

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.
Clone Of:
: 724972 (view as bug list)
Last Closed: 2015-03-30 08:09:22 UTC

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

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0755 normal SHIPPED_LIVE pinentry bug fix update 2015-03-30 12:08:52 UTC

Description Tomasz Kepczynski 2011-05-13 12:05:52 UTC
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 12:17:14 UTC
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 16:51:08 UTC
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 05:45:22 UTC
What terminal do you use?

Comment 5 Tomasz Kepczynski 2011-05-16 18:35:54 UTC
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 18:41:06 UTC
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 19:14:21 UTC
The terminal output is handled by pinentry.

Comment 8 Tomasz Kepczynski 2011-05-17 08:17:11 UTC
Created attachment 499280 [details]
pinentry-curses garbled output

Comment 9 Tomasz Kepczynski 2011-05-17 08:18:55 UTC
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-06 01:32:35 UTC
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 09:10:30 UTC
The bug can be reproduced in also in RHEL 6. Thank you for the bugreport.

Comment 16 Stanislav Ochotnicky 2012-07-04 11:48:32 UTC
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 11:30:08 UTC
*** Bug 1191639 has been marked as a duplicate of this bug. ***

Comment 27 Boris Ranto 2015-02-26 21:00:15 UTC
dist-git commits related to build pinentry-0.7.6-8.el6:

Comment 36 errata-xmlrpc 2015-03-30 08:09:22 UTC
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.