Bug 88414 - shows fingerprint of last subkey if "fingerprint" is in gpg.conf
Summary: shows fingerprint of last subkey if "fingerprint" is in gpg.conf
Status: RESOLVED FIXED
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: 1.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: bj
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-30 00:48 UTC by Adeodato Simó
Modified: 2005-02-20 12:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adeodato Simó 2004-08-30 00:48:13 UTC
Version:           1.2 (using KDE 3.3.0,  (3.1))
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-9)
OS:                Linux (i686) release 2.6.8-1-686

This is Debian Bug #251342 [http://bugs.debian.org/251342], reported by  Andrea Borgia <andrea@borgia.bo.it>. In short, the problem is:

- if the user has "fingerprint" in his gpg.conf file, when KGpg passes --fingerprint itself to gpg to obtain the public key fingerprint, it will actually display the fingerprint of the last subkey.

This is because (from the gpg manpage): "If this command is given twice, the fingerprints of all secondary keys are listed too." In the original reporter own words:

> I just discovered the culprit is the "fingerprint" option in the 
> configuration file: kgpg simply grabs the last line containing 
> "fingerprint", instead of the first one! Commenting it out changes the 
> data in the properties window, too!

> I guess kgpg should either be changed to grep the first fingerprint or 
> should sanitize the options passed to gpg.

thanks,
Comment 1 bj 2005-02-20 12:42:04 UTC
CVS commit by mardelle: 

Display correct fingerprint if "fingerprint" is in gpg.conf

CCMAIL: 88414-done@bugs.kde.org


  M +2 -2      keyinfowidget.cpp   1.20


--- kdeutils/kgpg/keyinfowidget.cpp  #1.19:1.20
@@ -108,5 +108,5 @@ void KgpgKeyInfo::loadKey(QString Keyid)
 {
 QColor trustColor;
-QString fingervalue;
+QString fingervalue=QString::null;
 FILE *pass;
 char line[200]="";
@@ -269,5 +269,5 @@ QString gpgcmd="gpg --no-tty --no-secmem
 
                 }
-                if (gpgOutput.startsWith("fpr")) {
+                if (gpgOutput.startsWith("fpr") && (fingervalue==QString::null)) {
                         fingervalue=gpgOutput.section(':',9,9);
                         // format fingervalue in 4-digit groups