Bug 250348 - kgpg shows no key ID in keyring for last key in list
Summary: kgpg shows no key ID in keyring for last key in list
Status: RESOLVED FIXED
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
: 258252 258654 258872 259310 259536 259981 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-06 11:50 UTC by Mathias
Modified: 2013-03-19 21:49 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.5


Attachments
output of gpg -k --with-colons (238 bytes, text/plain)
2010-09-07 13:38 UTC, Mathias
Details
output of gpg -k --with-colons (2) (435 bytes, text/plain)
2010-09-07 13:41 UTC, Mathias
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias 2010-09-06 11:50:56 UTC
Version:           unspecified (using KDE 4.4.5) 
OS:                Linux

kgpg has problems to interpret the keyring properly.

for the key that would be the last in my keyring if using the 'gpg -k' command kgpg shows me a key ID of '5889random usage'.


Reproducible: Always

Steps to Reproduce:
open key list in kgpg / key properties dialog of last generated key.

Actual Results:  
key ID of '5889random usage'

additionally, in the key properties dialog, instead of a fingerprint for this key, kgpg shows me the letters "5889 rand om u sage".


Expected Results:  
expected: the usual hex digits for the ID and the correct fingerprint

the program versions: 
kgpg: 2.3.0
gnupg: 2.0.16-r1 

note: the words "random usage" appear at the end of every gpg command, like this:
gpg -k 
... 
random usage: poolsize=600 mixed=0 polls=0/0 added=0/0 
              outmix=0 getlvl1=0/0 getlvl2=0/0 
secmem usage: 0/32768 bytes in 0 blocks 

the problematic key was the last one in the list gpg -k or gpg -K gives me, so it appears short before the line with "random".
Comment 1 Rolf Eike Beer 2010-09-06 12:50:47 UTC
Could you please attach the output of

gpg -k --with-colons KEYID

Where you replace KEYID with the correct fingerprint of the affected key.
Comment 2 Mathias 2010-09-06 18:56:58 UTC
thanks for your fast reply.

here is the info you requested. sorry, but for privacy reasons I had to change some numbers in the fp and names, hope that doesnt affect the outcome.

~ $ gpg -k --with-colons 4205E835487E46C8
gpg: enabled debug flags: memstat trust extprog assuan
tru::1:1282924547:1337428636:3:1:5
pub:u:3072:1:4205E835487E46C8:1281980131:::u:::scESC:
uid:u::::1281980131::DA93A68C34E9A45358C2735012F4DD8B0FDBD85C::kristian (no.4) <kristian@xmail.li>:
sub:u:3072:1:ED35E69BE4BCBD54:1281980131::::::e:
random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
              outmix=0 getlvl1=0/0 getlvl2=0/0
secmem usage: 0/32768 bytes in 0 blocks


what really confuses me now is that I generated another test key with the same parameters like the problematic one. now this testkey is the last in the list of keys and surprisingly kgpg has no problem to display this one correctly. BUT: the problematic one has still the malformed ID/FP.

and I probably should also mention that I am unable to encrypt to the problematic key using kgpg (although cmdline-gpg does it flawless) and that kgpg can't display the subkey and (only sometimes) pops up an error message saying that it couldn't read pubkey when I close the properties dialog of that key.
Comment 3 Rolf Eike Beer 2010-09-06 21:51:32 UTC
I'm not sure where exactly the line breaks are. Can you please put the output in an attachment so I can feed it into my parser locally? Changing key ids or comments is no problem for the test.
Comment 4 Mathias 2010-09-07 13:38:21 UTC
Created attachment 51384 [details]
output of gpg -k --with-colons

note: if I pipe the output of the command to a file, it doesn't include the lines above and below the key information.
Comment 5 Mathias 2010-09-07 13:41:53 UTC
Created attachment 51385 [details]
output of gpg -k --with-colons (2)

that's why: this time I copied the output as it appears in the console into the txt-file manually.
Comment 6 Rolf Eike Beer 2010-09-07 13:59:55 UTC
So it's the debug flags that seem to confuse things. If you run it as "gpg --debug-level none -k --with-colons" it should not show any debug messages.

I'll go and explicitely disable all debug messages when running gpg as a child of KGpg.

If you would like to test: search for "--fixed-list-mode" in kgpginterface.cpp and append to both lines:

<< "--debug-level" << "none"

before the semicolon.
Comment 7 Rolf Eike Beer 2010-09-07 14:05:12 UTC
SVN commit 1172517 by dakon:

disable all debugging messages from GnuPG subprocesses

They will be ignored in best case anyway and in worst case will confuse the parser.

CCBUG:250348

 M  +1 -1      gpgproc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1172517
Comment 8 Mathias 2010-09-07 14:51:06 UTC
Thank you!
I couldn't test it in the way you proposed since I am too familiar with tweaking packages before compiling (I have to let portage do the work).
But I tested it via changing my ~/.gnupg/gpg.conf (setting debug level to none) and it worked - kgpg displays all keys correctly again. so this bug can be closed as resolved/fixed, right? never did that, but try...
Comment 9 Rolf Eike Beer 2010-09-07 14:57:56 UTC
Nope, I'll close the bug once that has been backported to the 4.5 (and maybe even 4.4) branch. But thanks for confirmation that this works now. I'll do some further testing and then backport the fix.
Comment 10 Alex Merry 2010-10-05 18:13:09 UTC
This completely breaks KGPG with gpg (GnuPG) 1.4.10, which has no --debug-level option.  --debug is a valid option, though.
Comment 11 Rolf Eike Beer 2010-11-30 18:56:59 UTC
*** Bug 258252 has been marked as a duplicate of this bug. ***
Comment 12 Rolf Eike Beer 2010-12-05 10:43:51 UTC
*** Bug 258654 has been marked as a duplicate of this bug. ***
Comment 13 Rolf Eike Beer 2010-12-05 10:45:24 UTC
*** Bug 258872 has been marked as a duplicate of this bug. ***
Comment 14 Rolf Eike Beer 2010-12-05 12:08:06 UTC
SVN commit 1203734 by dakon:

Check the GnuPG version first before setting the default arguments. GnuPG 1.x doesn't know about --debug-level which will cause it to fail.

BUG:250348

 M  +26 -7     gpgproc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1203734
Comment 15 Rolf Eike Beer 2010-12-09 18:43:12 UTC
*** Bug 259310 has been marked as a duplicate of this bug. ***
Comment 16 Rolf Eike Beer 2010-12-12 09:28:41 UTC
*** Bug 259536 has been marked as a duplicate of this bug. ***
Comment 17 Clemens Eisserer 2010-12-12 10:12:49 UTC
when will this be backported to the 4.5 series?
Comment 18 Rolf Eike Beer 2010-12-12 10:59:09 UTC
Next week.
Comment 19 Rolf Eike Beer 2010-12-15 19:52:12 UTC
*** Bug 259981 has been marked as a duplicate of this bug. ***
Comment 20 Rolf Eike Beer 2010-12-16 13:22:35 UTC
SVN commit 1206989 by dakon:

bring the latest fixes and cleanups for gpgproc to 4.5 branch

CCBUG:250348


 M  +30 -11    gpgproc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1206989