Red Hat Bugzilla – Bug 724972
gpg-agent does not support utf-8
Last modified: 2015-02-18 08:35:42 EST
+++ This bug was initially created as a clone of Bug #704495 +++
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):
Steps to Reproduce:
Use gpg on a key which contains non-ascii characters in its name.
The output is garbled
The output is clean.
Detected on ScientificLinux 6 but I guess this is also a case on RHEL.
--- Additional comment from email@example.com on 2011-05-13 14:17:14 CEST ---
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?
--- Additional comment from firstname.lastname@example.org on 2011-05-13 18:51:08 CEST ---
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:
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?
--- Additional comment from email@example.com on 2011-05-16 07:45:22 CEST ---
What terminal do you use?
--- Additional comment from firstname.lastname@example.org on 2011-05-16 20:35:54 CEST ---
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)
--- Additional comment from email@example.com on 2011-05-16 20:41:06 CEST ---
I take back local konsole part - in this case dialog box is displayed and my name is displayed correctly.
--- Additional comment from firstname.lastname@example.org on 2011-05-16 21:14:21 CEST ---
The terminal output is handled by pinentry.
--- Additional comment from email@example.com on 2011-05-17 10:17:11 CEST ---
Created attachment 499280 [details]
pinentry-curses garbled output
--- Additional comment from firstname.lastname@example.org on 2011-05-17 10:18:55 CEST ---
I tried the following in pinentry-curses:
OK Your orders please
which resulted in the attached above screen. This seems to confirm that a problem is in pinentry.
--- Additional comment from email@example.com on 2011-07-18 11:10:30 CEST ---
The bug can be reproduced in also in RHEL 6. Thank you for the bugreport.
Created attachment 514695 [details]
Patch fixing the bug
I have prepared a relatively simple patch that solves the problem accoring to my testing. It consists of 2 things:
1. link against libncursesw
2. call setlocale(LC_CTYPE, "") before initialising ncurses
I sent the patch upstream for comments
For posterity, how did you contact upstream? via bug tracker? mailing list? in particular, can you include a reference to that contact here?
Sure, forgot to add it to my previous comment:
FYI, another fix has been committed in upstream:
Any chance to backport it? that may be worth considering if the upstream release cycle is too long...
Sure, just need to carve out some time to work on it.
New upstream version with the fix has been released last week:
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.
(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)
More information and reason for this action is here:
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This message is a notice that Fedora 19 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 19. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 19 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.