Mailing List Archive

Passphrase of GPG-generated key not accepted
Hi,

I have German umlauts (öäü) and other special characters in my password
to increase security. The key itself was created with gpg on a terminal
emulator. This is an example key which raises the same problem:

<sec_key.asc content begins below this line>
************************************************************************
* ACHTUNG: Diese Datei enthält eine Sicherheitskopie Ihres *
* geheimen Schlüssels. *
* Bewahren Sie sie an einem sicheren Ort auf. *
************************************************************************

Der in dieser Datei gesicherte Schlüssel ist:

pub 1024D/EECF083D 2005-08-13 [expires: 2005-09-12]
Schl.-Fingerabdruck = D225 5118 C06B E863 846D BD0E 0072 5D71 EECF 083D
uid Daniel Link (This key is for testing purpose only)
<example@example.net>
sub 2048g/5A4D2532 2005-08-13 [expires: 2005-09-12]


-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.1 (GNU/Linux)

mQGiBEL9j50RBACxrBXPZIcGBk0/Bh2muaRX+cCJ8jHguwUAQGSNGVsL7vSVcpd/
QQpympQ7b0k2dPgiZ9tDfm8SqEu79+YbM7j41GgcbII8MDnaS2xnHJ9dkPTC2Q+G
zdiMwoFqAvk4pWwHve5oP+YhXHflBse40jVHpPf3De/ytzkl12RVKHsAMwCguETv
U0nVNxI2mmOaOcnbDX+O8YkD/RhXCrd1dfb5Z9hCYQw9hfR0Zybgm7Jfafx9jp+d
g67IQyCc5n0MX4JhfTvth9zx+dSquZFIX3uOHsK9kXM56QFZgfi4lFQmYHHmD1l+
cMU+toIHfm1rDFgTMwlJoFh89M2k2BXeZHFvEX/1jFES3/EW4e7iNAbKYhqCJJKN
mgbhBACk2Shb0qJFz1Pczz6uxSiBdkEro/9qa3O/QiD4H8sTnV88xpHjVBHQ9OlO
pZrjlTwakjfrtB3UbS19N9Ae+pSevHDZ31xsoHKuKYtDZtjU3uw251qUT/Av7EnD
+hnvtF/hGZqNeNq6JGZy+45+oD41iEMjGTjt69NCU/0os3XWGLRIRGFuaWVsIExp
bmsgKFRoaXMga2V5IGlzIGZvciB0ZXN0aW5nIHB1cnBvc2Ugb25se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koqRywmZMjTMDI4Y3qtrUwE/Y2G10zTR0S
VQiONkyr/9Ruackte2eYVv67Qmc1f6w90tsE+b6CEtzin2mmg1142FNqhsZC0zga
v+MQl2sDkWfGOecNvealHZ0ddZXnVl8fKGpP1nBF3clBEAdUCTXG9kWkIMf5NuYF
dYd/O1cQ/uTThLWyF1IPAAMFB/sFES/HxNsPumjvaJseUwgd7sn+gsCU1vfyDDn8
T9SkDisdn63gdzc1Of9JlmoKuuy0IyxohCZu15dv8iMpis2gMfcDo4G6JXEo1rK6
KXjlfpnAjTw0DYyGXdpkA1ilktAxKTgmkMG7iUgSfxliOI3lPCLNzrEDpWxXGct8
G4ia6Jqvvl7S+ZozKxejyoK0Qzdd/BlIgz4FwEsQZjXVUfiavBr7sRo7vPRUmse1
D8ZLlQoXNX4nQJt7juqiHiYvNg4kbGQ72/AhCm/GQABtHHZhfUPl66t7Qya6ZA5M
3/OqP0aPOwWE1cOGUMeUQhIpk4xE6BgsCtWw13RZlKOTB5fW/gMDAoupVaWOmiHM
YA1iCtcsuLoM+w0IcLT2mAqmtP0FCVGLFc07Mw560lKKlwOInRwDHso5CWI52slc
ZB/xAeOd5CIS9wmE2ndDCioQ+bg7Da1YnRKITwQYEQIADwUCQv2PvQIbDAUJACeN
AAAKCRAAcl1x7s8IPcLXAJ9+IseRCdo+E2/Ds2c31ByGgt8P8wCglAlBP5XWv08U
9yhwlqWU/8sJMrU=
=yN/i
-----END PGP PRIVATE KEY BLOCK-----ins below this line>
<sec_key.asc content ends here>

It will expire in one month. I think this will be enough time to track
down the problem. If not, please send an email to my email address
_directly_ and I will create a new one as soon as possible. The password
is: K3ineK!nderspielengerneFlöte
As far as I know I've used the ISO-8859-15 character encoding. This
message was also created with that encoding. The version of GPA
installed on my computer is 0.7.0-r2. I use GPG 1.4.1 as you can easily
see from above. The system is Gentoo Linux.

Which encoding does GPA use for backups? The umlaut from "Schlüssel"
which means key isn't displayed correctly (see lines 2, 4 and 9).

In addition GPA crashes when I try to backup a key and not enter a
filename manually but select file and directory (segfault). I tried but
didn't manage to compile from sources with debugging symbols. There's no
configure option and I have no idea which file I have to alter / which
arguments I have to pass to the compiler to do so.

Bye,

Daniel Link
Re: Passphrase of GPG-generated key not accepted [ In reply to ]
Am 13.08.05 08:47 schrieb(en) Daniel Link:
[snip]
> As far as I know I've used the ISO-8859-15 character encoding. This
> message was also created with that encoding. The version of GPA
> installed on my computer is 0.7.0-r2. I use GPG 1.4.1 as you can easily
> see from above. The system is Gentoo Linux.
>
> Which encoding does GPA use for backups? The umlaut from "Schlüssel"
> which means key isn't displayed correctly (see lines 2, 4 and 9).

GPA and other applications based upon the Gtk+-2 library (and all kde
stuff, btw) use utf8 to encode national characters (basically two chars
for german umlauts, as you saw in the outout). As a rule of thumb, if you
use your key primarily via a gui application (i.e. you enter the
passphrase via gpg-agent and pinentry-{gtk2|qt}), I would suggest to
replace the iso8859 encoded passphrase by the same one encoded in utf8. An
other option would be to use utf8 encodings in the standard xterm
environment as well. I covered that problem in a faq about using
encryption with the mua balsa ("I created a key but balsa never accepts my
passphrase?"):
http://home.arcor.de/dralbrecht.dress/balsa/balsa23-secure-mail.html#FAQ

> In addition GPA crashes when I try to backup a key and not enter a
> filename manually but select file and directory (segfault). I tried but
> didn't manage to compile from sources with debugging symbols. There's no

Try to run (assuming you're using bash)

CFLAGS="-O0 -g" ./configure <your cfg options>

rebuild gpa, and then run gpa in gdb. When it crashes, say "bt full" to
get a full trace.

Hth, Albrecht.


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Albrecht Dreß - Johanna-Kirchner-Straße 13 - D-53123 Bonn (Germany)
Phone (+49) 228 6199571 - mailto:albrecht.dress@arcor.de
GnuPG public key: http://home.arcor.de/dralbrecht.dress/pubkey.asc
_________________________________________________________________________
Re: Passphrase of GPG-generated key not accepted [ In reply to ]
> GPA and other applications based upon the Gtk+-2 library (and all kde
> stuff, btw) use utf8 to encode national characters (basically two chars
> for german umlauts, as you saw in the outout). As a rule of thumb, if
> you use your key primarily via a gui application (i.e. you enter the
> passphrase via gpg-agent and pinentry-{gtk2|qt}), I would suggest to
> replace the iso8859 encoded passphrase by the same one encoded in utf8.
> An other option would be to use utf8 encodings in the standard xterm
> environment as well. I covered that problem in a faq about using
> encryption with the mua balsa ("I created a key but balsa never accepts
> my passphrase?"):
> http://home.arcor.de/dralbrecht.dress/balsa/balsa23-secure-mail.html#FAQ

Wouldn't it be a good idea to include character encoding information in
keys? I think so. Many people don't use UTF-8 yet. Demanding such
configuration like you mentioned from all these users sounds
unreasonable to me. Isn't a workaround possible? Since I use GTK+
applications for quite a while now and never experienced similar
problems this would be my solution of choice. Don't ask me about
implementation though.
Changing the key already sent to key servers and several people from my
address book doesn't sound very appealing to me either. Perhaps you'll
beg to differ, but in my opinion an application like GPA should work out
of the box, no matter which encoding.

> CFLAGS="-O0 -g" ./configure <your cfg options>
>
> rebuild gpa, and then run gpa in gdb. When it crashes, say "bt full" to
> get a full trace.

I've used

$ CFLAGS="-O0 -g -O2 -march=pentium4 -fomit-frame-pointer" ./configure \
--prefix=/my/path

to configure, compiled GPA and ran it inside the debugger. Here's what
it said:

<gdb output begins>
(gdb) file /my/path/bin/gpa
Reading symbols from /my/path/bin/gpa...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /my/path/bin/gpa

Program received signal SIGSEGV, Segmentation fault.
0x0805001a in gpa_window_show_centered (widget=0x827b1d8, parent=0x0) at
gtktools.c:47
47 gdk_window_get_origin (parent->window, &parent_x, &parent_y);
(gdb) bt full
#0 0x0805001a in gpa_window_show_centered (widget=0x827b1d8,
parent=0x0) at gtktools.c:47
parent_x = -1209855117
parent_y = 136819160
parent_width = 136819160
parent_height = -1076559632
center_x = 136819160
center_y = 136819512
width = 447
height = 362
child = (GtkWidget *) 0x827b338
#1 0x08050dbf in gpa_get_save_file_name (parent=0xbfd500ac,
title=0xbfd500ac "s\023ã·Ø±'\b¿\001", directory=0x0) at gtktools.c:432
dialog = {window = 0x827b1d8, filename = 0x0}
window = (GtkWidget *) 0x827b1d8
#2 0x08070182 in export_browse (param=0x8108f68) at gpabackupop.c:252
filename = (gchar *) 0x80ef800 "\002"
#3 0xb7b25900 in g_cclosure_marshal_VOID__VOID () from
/usr/lib/libgobject-2.0.so.0
No symbol table info available.
<gdb output ends>

If you need any more information, feel free to ask.

Daniel

PS: Please put your own address in CC and the mailing address' in TO.
This makes replying easier since one doesn't have to manually change the
recipient or choose "Reply to CC" every time. It won't hurt you either,
if you don't tend to answer your own messages.
Re: Passphrase of GPG-generated key not accepted [ In reply to ]
Am 13.08.05 13:41 schrieb(en) Daniel Link:
> Wouldn't it be a good idea to include character encoding information in
> keys? I think so.

RFC 2440, section 3.4 [1] states that "the default character set for text
is the UTF-8 encoding". I am not sure if this applies to the messages only
and not to the key contents, though. The passphrase, however, is just a
"stream of bytes", and no assumption should be made about a "meaning"
(read: encoding and possible translation between different ones) of its
contents.

> Many people don't use UTF-8 yet.

I don't think this is true, at least for all gui applications in the UNIX
world. KDE (read: the qt library) and Gnome2.x (read: Gtk+-2) are
completely and exclusively utf-8. I'm not sure about other popular widget
libs (e.g. Motif & friends), but the general trend seems to use utf8
everywhere, maybe except for terminal apps (i.e. xterm).

> Demanding such configuration like you mentioned from all these users
> sounds unreasonable to me.

If you think about the problems regarding the use of gpg (i.e. entering
the passphrase) in a terminal, I think the better solution is to install
gpg-agent and to use a gui pinentry for this purpose. It (a) removes the
encoding problem (b) provides a *secure* passphrase cache and (c) imho
makes using the various crypto apps a lot easier.

If you don't want to install the whole chain to get the agent running, you
might want to look at seahorse [2] which also provides a (simpler) agent
solution. I don't know how secure it is, though.

> Changing the key already sent to key servers and several people from my
> address book doesn't sound very appealing to me either.

Afaik, changing the passphrase of your *private* key doesn't alter the
contents of the public key in any way. And you don't want to publish your
private key ;-)...

> Perhaps you'll beg to differ, but in my opinion an application like GPA
> should work out of the box, no matter which encoding.

Sure it should! However, I think the problem at this point is mixing the
use of utf8 applications (gpa, pinentry, seahorse, kmail, balsa, evo,
Thunderbird/Enigmail) and iso8859 terminal apps (command line gpg). So,
again, if you just use gpg-agent and pinentry-gtk2, you will *never* run
into trouble!

> $ CFLAGS="-O0 -g -O2 -march=pentium4 -fomit-frame-pointer" ./configure \
^^^ ^^^^^^^^^^^^^^^^^^^^
Just a remark: you should never activate these optimisations if you want
to debug code. On RISC processors (I use a PowerPC), a lot of information
may be lost, which is usually prevented by using -O0...

> (gdb) bt full
> #0 0x0805001a in gpa_window_show_centered (widget=0x827b1d8,
> parent=0x0) at gtktools.c:47
[snipped bt]

Unfortunately, I'm not a gpa developer. Anyone listening out there?

Cheers, Albrecht.

[1] http://www.ietf.org/rfc/rfc2440.txt
[2] http://seahorse.sourceforge.net/

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Albrecht Dreß - Johanna-Kirchner-Straße 13 - D-53123 Bonn (Germany)
Phone (+49) 228 6199571 - mailto:albrecht.dress@arcor.de
GnuPG public key: http://home.arcor.de/dralbrecht.dress/pubkey.asc
_________________________________________________________________________
Re: Passphrase of GPG-generated key not accepted [ In reply to ]
At Sat, 13 Aug 2005 08:47:30 +0200,
Daniel Link <stagger@gmx.net> wrote:
> In addition GPA crashes when I try to backup a key and not enter a
> filename manually but select file and directory (segfault). I tried but
> didn't manage to compile from sources with debugging symbols. There's no
> configure option and I have no idea which file I have to alter / which
> arguments I have to pass to the compiler to do so.

I have applied the following fix.

Thanks,
Marcus

2005-11-07 Marcus Brinkmann <marcus@g10code.de>

* gpabackupop.c (export_browse): Pass ENTRY as parent to
gpa_get_save_file_name.

Index: gpabackupop.c
===================================================================
--- gpabackupop.c (Revision 715)
+++ gpabackupop.c (Arbeitskopie)
@@ -253,7 +253,7 @@
GtkWidget *entry = param;
gchar *filename;

- filename = gpa_get_save_file_name (NULL, _("Backup key to file"), NULL);
+ filename = gpa_get_save_file_name (entry, _("Backup key to file"), NULL);
if (filename)
{
gchar *utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL,


_______________________________________________
Gpa-dev mailing list
Gpa-dev@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gpa-dev