Version: 1.2.2 (using KDE 3.5.9)
Compiler: gcc 4.1
Installed from: Gentoo Packages
Since updating gnupg to version 2.0.10, kgpg fails to parse the key ring.
* error messages about invalid dates on stderr
QDate::setYMD: Invalid date 1137-89-94
QDate::setYMD: Invalid date 1044-97-30
QDate::setYMD: Invalid date 1107-69-30
* keylist does not display any names / e-mail addresses
(Most likely more (all?) functions are broken.)
See also the gentoo bug report:
I'm copy-pasting this from the Gentoo bugzilla, since it contains valuable information...
------- Comment #15 from email@example.com 2009-03-31 01:03 0000 -------
kgpg is not parsing the fixed-list/colon mode of gnupg correctly. In
>=app-crypt/gnupg-2.0.10, --fixed-list-mode became the default when
--with-colons was used, as the output otherwise was not well defined. If you
used --fixed-list-mode already, then the output did NOT change. If you didn't
then the output DID change.
I direct you to gnupg-2.0.9/doc/DETAILS for the output format of
gnupg is not broken. kgpg just fails at parsing because it never used
fixed-list-mode, and now it needs to. It's not limited to kgpg:3.5 either, I
see kgpg-4.2* is broken as well.
Of specific note to whomever goes to fix kgpg:
1. Check the format of timestamps before you try to parse them. There are _3_
valid formats. Unix epoch seconds ("192388500"), ISO8601 full
("19760205T091500") ISO8601 short date ("1976-02-05").
2. The name for the key is not available on the pub record, it must be obtained
from the uid record.
I have created an initial patch today. Please review it carefully if you want to apply it since I am not very experienced with gpg.
I think that I missed something since KGPG may crash when deleting a key but it makes the main window display the correct information.
Created attachment 32685 [details]
Initial patch for KGpg (trunk) with gpg --fixed-list-mode
Thank you for the patch. It fixes the parsing but now the main key is shown as subkey. I'll fix that and commit.
SVN commit 952350 by dakon:
Use --fixed-list-mode for GnuPG key output.
This is the default since GPG 2.0.10 and in general makes the life more easy. Should have been used forever.
Please test if this gives the same results as before and report back so I can backport this.
Thanks to Niels Ole Salscheider for a patch that does the parsing of the new output format.
M +48 -108 kgpginterface.cpp
WebSVN link: http://websvn.kde.org/?view=rev&revision=952350
I can't test the current patch since I only have KGpg 1.2.2 (KDE 3.5.9, Gentoo stable), but I will test a backport if you can provide us with one - my C++ skills are nowhere near good enough.
I tried to apply that pacth against kgpg-3.5.10 at my stable Gentoo system but that failed with :
PATCH COMMAND: patch -p3 -g0 -E --no-backup-if-mismatch < /usr/local/portage/kde-base/kgpg/files/kgpginterface.cpp.patch
patching file kgpg/kgpginterface.cpp
Hunk #1 FAILED at 464.
Hunk #2 FAILED at 514.
Hunk #3 FAILED at 523.
Hunk #4 FAILED at 531.
Hunk #5 FAILED at 551.
Hunk #6 FAILED at 571.
Hunk #7 FAILED at 583.
Hunk #8 FAILED at 591.
Hunk #9 FAILED at 608.
Hunk #10 FAILED at 649.
Hunk #11 FAILED at 657.
Hunk #12 FAILED at 702.
Hunk #13 FAILED at 722.
Hunk #14 FAILED at 738.
Hunk #15 FAILED at 747.
Hunk #16 FAILED at 1482.
16 out of 16 hunks FAILED -- saving rejects to file kgpg/kgpginterface.cpp.rej
Well, yes, it seems kgpg has advanced in the meantime. :)
To the authors of the patch: You could enhance your testing base a lot if you provide a patch for kde 3.5.9 or kde 3.5.10 -- these are the stable versions on Gentoo amd64 and x86, and the Gentoo crowd is fairly willing to experiment with source codes and patches... :)8
Not marking 4.2 stable is a gentoo bug, file it there ;)
Yes, I'll look if I can do a patch fo 3.5, but yesterday was feature freeze for 4.3 (look how much gentoo is behind *g*) so I was busy doing other stuff.
Created attachment 33561 [details]
Some changes for fixed-list-mode with KGpg 1.2.2
I tried to backport this, but honestly, that isn't fun. You can try the patch, maybe this fixes anything. Expaning keys might work now. Everything else is probably still broken.
Please mark that version of KGpg with <=app-crypt/gnupg-2.0.9 in portage. If anyone wants to try fixing this I will help you but I will not dig into this anymore. Sorry, that code is totally different from what is in KDE4 and is scattered over several places. If you want new versions of GnuPG and anything than you should also get a new version of KDE. ;)
The 3.5 patch didn't compile for me under Gentoo amd64:
keyinfowidget.cpp: In member function ‘void KgpgKeyInfo::loadKey(QString)’:
keyinfowidget.cpp:215: error: no matching function for call to ‘KLocale::formatDate(QDateTime&)’
/usr/kde/3.5/include/klocale.h:463: note: candidates are: QString KLocale::formatDate(const QDate&, bool) const
Created attachment 33695 [details]
Some changes for fixed-list-mode with KGpg 1.2.2, version 2
Sorry, that somehow slipped through.
Testing report on the latest patch:
I still get the "QDate::setYMD: Invalid date" errors.
The names, emails, and expiration dates don't show (except the unlimited ones). Creation, ID, trust, and size are ok.
When expanding a key, the signatures as well as the ElGamal subkey appear ok, except that they all show a creation date of 1969-12-31.
It fits with your comment when you provided the first patch: "Expaning keys might work now. Everything else is probably still broken." :)
The commit mentioned in Comment #5 is still not present in kde 4.2.3?
(In reply to comment #14)
> The commit mentioned in Comment #5 is still not present in kde 4.2.3?
Since noone verified that everything works (as requested in comment #5): no.
(In reply to comment #15)
> (In reply to comment #14)
> > The commit mentioned in Comment #5 is still not present in kde 4.2.3?
> Since noone verified that everything works (as requested in comment #5): no.
which kind of makes sense in most cases, but not here where things can only be improved... ah well, compiling kde4 in the background...
I build a VM with Gentoo "unstable" (~amd64). Tested the patch with kgpg 4.2.2 and 4.2.3. It appears to work fine, with one exception. With the patch, kgpg 4.2.2 crashes if I use the keyserver dialog to search for a non-existing key ("lllllinux"). I could not make it crash without the patch.
4.2.3 looks fine, however.
There were some keyserver fixes in 4.2.3 but I still can't see why this patch would have any effect as it doesn't touch any keyserver code. Please send me a complete backtrace (send it directly to me, it does not belong to this bug). Thanks for testing anyway. Backport is on the way.
SVN commit 973317 by dakon:
Use --fixed-list-mode for GnuPG key output.
This is the default since GPG 2.0.10 and in general makes the life more easy.
Should have been used forever. Without this KGpg will not show useful output
when someone uses recent GPG.
Backport of r952350 from trunk
M +48 -108 kgpginterface.cpp
WebSVN link: http://websvn.kde.org/?view=rev&revision=973317
*** Bug 194717 has been marked as a duplicate of this bug. ***
Created attachment 35216 [details]
Improve parsing of fixed list mode
This patch applies to kgpg-3.5.10. I’m not 100% sure it covers all possibilities but at least my kgpg shows sensible information again. :)
Thanks, I'll look into it the next days.
Created attachment 35244 [details]
Some changes for fixed-list-mode with KGpg 1.2.2, version 3
This is an attempt to merge our versions and keep the differences in KeyView::refreshkeylist() smaller. Since I currently can't link the binary it's only compile tested.