Bug 401933 - Cannot select signing key
Summary: Cannot select signing key
Status: RESOLVED FIXED
Alias: None
Product: kleopatra
Classification: Applications
Component: general (show other bugs)
Version: 3.1.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Andre Heinecke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-09 17:46 UTC by Matthieu Gras
Modified: 2018-12-11 07:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.12.0


Attachments
Screenshot (27.35 KB, image/png)
2018-12-09 17:46 UTC, Matthieu Gras
Details
Screenshot (32.93 KB, image/png)
2018-12-10 13:37 UTC, Matthieu Gras
Details
Second screenshot (21.87 KB, image/png)
2018-12-10 13:38 UTC, Matthieu Gras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Gras 2018-12-09 17:46:05 UTC
Created attachment 116815 [details]
Screenshot

SUMMARY

Version 3.1.3

STEPS TO REPRODUCE
1. Open Application, go to "Notepad" -> "Recipients"
2. Click on "sign as" 

OBSERVED RESULT
Selection list is empty, no keys appear

EXPECTED RESULT
Signing key should be in the list

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Opensuse Leap 15
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.52.0
Qt Version:  5.11.2

ADDITIONAL INFORMATION
I can select the key as the encryption key but not as the signing key
Comment 1 Andre Heinecke 2018-12-10 07:27:46 UTC
This should only happen if your key is disabled / exipred or revoked. Or if you do not have a suitable key:

Do you have an ultimately trusted private OpenPGP key?

If you select "My Certificates" in the keylist, what does it show?

Can you please attach a screenshot of that if it shows your key?


Thanks!
Andre
Comment 2 Matthieu Gras 2018-12-10 13:37:20 UTC
Created attachment 116828 [details]
Screenshot

Sometimes it shows up in 'My certificates' and sometimes it shows up in 'Trusted certificates'. After a reboot I can't even use the key to encrypt the notepad anymore.
Comment 3 Matthieu Gras 2018-12-10 13:38:17 UTC
Created attachment 116829 [details]
Second screenshot
Comment 4 Andre Heinecke 2018-12-10 13:52:22 UTC
There is indeed something very fishy going on here.

From the first screenshot I would have said: Ok. You don't have the private key. Because the key is not bold and you are showing trusted certificates and not "my certificates"

But the second screenshot in contrast shows the "Add email address", "Change passphrase" etc,.. options that are only available if Kleopatra detects that you have the private key. o.O I would not have thought that this is possible.

Did you make the screenshots in two different runs of Kleopatra?

For further analysis please show the command line output of:

gpg --version
gpg2 --version (I'm not sure if in OpenSUSE Leap GnuPG 2 is called gpg or gpg2, please use gpg2 in the following commands if gpg --version shows something like 1.4.x)

gpg -K
echo foo | gpg -sau "your email or keyid"
Comment 5 Matthieu Gras 2018-12-10 14:01:26 UTC
No the screenshots are from the same run.

I. gpg version: 2.2.5

II. gpg -K:
/home/rofl/.gnupg/pubring.kbx
-----------------------------
sec   rsa4096 2018-12-01 [SCA] [expires: 2019-03-11]
      E0EFCD620BE2D9E1246158309BDB38B5A80CF964
uid           [ultimate] Matthieu Gras <grasm@student.ethz.ch>
uid           [ultimate] Matthieu Gras <matthieu.gras@aol.com>
ssb   rsa4096 2018-12-01 [E] [expires: 2020-12-02]


III. echo foo | gpg -sau "grasm@student.ethz.ch":
Opens window to enter passphrase, then outputs:

-----BEGIN PGP MESSAGE-----

owEBaAKX/ZANAwAIAZvbOLWoDPlkAcsKYgBcDnE8Zm9vCokCSgQAAQgANBYhBODv
zWIL4tnhJGFYMJvbOLWoDPlkBQJcDnE8FhxncmFzbUBzdHVkZW50LmV0aHouY2gA
CgkQm9s4tagM+WRfvw/+PGULrsi5K4TZTFlOVTdH9AwXPKwznonuaLMvbzrgDVV3
krWRnzjx0DlRxpNlMzYNm0EbjPWyZGefZlXzY/ClK+NWQ1+6UOUThs/ggjwRwSzf
JeE/MqCwfqlNFnrLT3NC7n7VGvwKOD4lhs+6U0P/sFeTSE23/eOgt86QhwL4p2u5
3WWszLH/MHVg52PhUNLYS50HeqMITW2MUZdo7VG1NQ6yJ/iTk6VjbrK9za/Z/arJ
1hi2q87i7ID9tGsTo8wJMEhQM4q83Ned2thLUbGUu7atmbHPGwsGYOpHu1YB1qnJ
wKEPsAWaDGGoiFhEqbFnM8pe5eL2q9hSPUEwXKO43vPX7GKqLyv+cjFejkPv7SYs
4N0u8ZVlpqiRbLgG82FUJzSOgUkZyYxF/bpUOL+gSoKPBGgq2mG9Vhc8MEgamURH
0HBQHE6XDPy8bljgpx/OI859aV8Zib9qnJvBaPtH2wU1jMVFzQiJ/AtA8FyFLcpK
+DI+yFexJ0l4Goy/DsppGvxvuG45Qbh4ClBBlFIfbXHeU9y8mmlPuIlIE1DE+kXw
uyKylaGDaTxtLQs75e5U2z1LUdIdB778LGjSJjXe6VRedJUR9GA9qKpdyTHImIp7
pZntW9wTfQa+fTB44XrtGmjlSKoOpDQdLdRWq9slb3Usw9tspEe84Z+jplIsdYY=
=NzqR
-----END PGP MESSAGE-----
Comment 6 Matthieu Gras 2018-12-10 14:03:17 UTC
I have exactly the same problem with the same installation on a different laptop and even with a clean user.
Comment 7 Andre Heinecke 2018-12-10 14:19:13 UTC
Honestly,.. I have absolutely no idea how this is possible or what the reason for this could be. :-/ There is nothing special with your key, maybe except for the "Authentication" capability on the primary key but that should be no issue.

My next step here would be to try to reproduce your setup in a virtual machine.

In the meantime you could install GPA which has a "clipboard" which is comparable to Kleopatra's.

As a last question: If you generate a test key in Kleopatra with the defaults does it work then?
Comment 8 Matthieu Gras 2018-12-10 14:28:05 UTC
No even with the default settings I get the exact same behavior. The behavior also isn't really deterministic. If I do 
pkill kleopatra && kleopatra
sometimes everything is fine, sometimes nothing works and sometimes only encryption or only signing work.

The problem is that signing E-Mails in Kmail also doesn't work anymore.
Thank you, maybe I'll have a look at the source code if it's not too convoluted.
Comment 9 Matthieu Gras 2018-12-10 16:23:07 UTC
Found the error:
In libkleo in the file defaultkeyfilter.cpp at line 160 I get 'jump depends on uninitialized value' which is cause by the missing initialization of the field 'mIsDeVs'.
Comment 10 Matthieu Gras 2018-12-10 16:33:23 UTC
Just checked phabricator, the fix I was going to propose is already in upstream.
Comment 11 Andre Heinecke 2018-12-10 17:21:56 UTC
Awesome, thanks for looking into this !

So you have a version that contained my Friday bug (sorry for that) db3fd6ea8c6619da75b9903a90fffc0f9330cf12

But not my Monday fix 98cf4b67ac005832a0ada734ba805e10e51a0319

That is a weird version! Does SUSE Leap just use random git master snapshots?

There was no tag or so in between. I've just checked (to be sure that the fix was properly included in the applications 18.12 branch).

Anyway. Thanks for your efforts trying to help making Kleopatra better! (btw. other contributions are always welcome ;-) )
Comment 12 Andre Heinecke 2018-12-10 17:25:22 UTC
*eats his words*

git tag --contains db3fd6ea8c6619da75b9903a90fffc0f9330cf12
v18.11.80
v18.11.90
git tag --contains 98cf4b67ac005832a0ada734ba805e10e51a0319
^ none

I think v18.11.90 might have been wrongly tagged. I'll check the dates.
Comment 13 Andre Heinecke 2018-12-10 17:30:13 UTC
*expletive*

Totally my fault. I commited the fix to the Applications/18.12 branch but only pushed my master branch.

So locally it showed to be in Applications/18.12 but not in the repo.

I've fixed that now.
Comment 14 Matthieu Gras 2018-12-10 18:02:18 UTC
(In reply to Andre Heinecke from comment #11)
> Awesome, thanks for looking into this !
> 
> So you have a version that contained my Friday bug (sorry for that)
> db3fd6ea8c6619da75b9903a90fffc0f9330cf12
> 
> But not my Monday fix 98cf4b67ac005832a0ada734ba805e10e51a0319
> 
> That is a weird version! Does SUSE Leap just use random git master snapshots?
> 
> There was no tag or so in between. I've just checked (to be sure that the
> fix was properly included in the applications 18.12 branch).
> 
> Anyway. Thanks for your efforts trying to help making Kleopatra better!
> (btw. other contributions are always welcome ;-) )

Stock Leap uses the 5.12 LTS. I'm using the additional (semi-offical) KDE repo, I think my KDE applications are at version 18.11.90.
Comment 15 Andre Heinecke 2018-12-11 07:52:12 UTC
(In reply to Matthieu Gras from comment #14)
> Stock Leap uses the 5.12 LTS. I'm using the additional (semi-offical) KDE
> repo, I think my KDE applications are at version 18.11.90.

We ensured that the final tarball of 18.12.0 won't contain this Bug. It was very close that this would have happened. That is your achievement, so you have saved a lot of users from this Bug. Again, thanks.