Bug 115374 - No PGP keys to encrypt a document listed
Summary: No PGP keys to encrypt a document listed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-01 14:20 UTC by Roman Schleicher
Modified: 2018-09-04 05:13 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Schleicher 2018-02-01 14:20:25 UTC
Hello,

I upgraded to the latest release of LibreOffice 6.0.0.3x64 and GPG4Win 3.0.3 (in this order) on Windows 10 Enterprise 1709 Build 16299.125. Since I already use PGP encryption for my mails with Tunderbird and Enigmail, I wanted to try out this feature in LO Writer.

But when I check the box to encrypt my document and click "save", no PGP key is listed in the following window. I can start either Kleopatra or GPA and there is my key and I can edit or delete it.

In order to solve this problem, I tried (re-)installing GPG4Win multiple times and also deleted the folder

c:\Users\[user]\AppData\Roaming\gnupg\

Still no key is presented when I want to encrypt a document and hoping for a solution. Please feel free to contact me if I can provide any details.

Sincerely,

roman
Comment 1 Thorsten Behrens (allotropia) 2018-02-01 23:15:55 UTC
Three initial questions:
* which path is Gpg4Win installed on your box?
* is it installed system-wide, or just for your user?
* does digital signing work? after saving a file as ODF, go to File->Digital Signatures->Digital Signatures..., then click Sign. Does the following dialog show any OpenPGP keys?
Comment 2 Roman Schleicher 2018-02-02 09:04:39 UTC
* I have multiple drives and GPG4Win is installed on  "e:\Programme\GnuPG\". The system is on drive C. (LibreOffice is here: "e:\Programme\LibreOffice 6\")


* Since I can't choose during installation, I'm not sure if it is user only or not. But I have, as far as I know, two folders related to GPG4Win on my system drive:

c:\Users\[username]\AppData\Roaming\gnupg\
c:\Users\All Users\GNU\


* The dialog is also completly empty, like when I want to encrypt a document on saving.
Comment 3 Thorsten Behrens (allotropia) 2018-02-02 09:34:14 UTC
(In reply to Roman Schleicher from comment #2)
> * I have multiple drives and GPG4Win is installed on  "e:\Programme\GnuPG\".
> The system is on drive C. (LibreOffice is here: "e:\Programme\LibreOffice
> 6\")
> 
> 

Ok, so right now we're cheating a bit for finding the kleopatra
executable on windows - we're expecting that under
C:\\Program Files (x86)\\GNU\\GnuPG

Which explains the 'no key management solution found'. For doing the
actual crypto, that's delegated to gpgme, which IIRC does something
like this (in order):

* check if registry key "HKEY_LOCAL_MACHINE\\Software\\GNU\\GnuPG\\Install Directory" is present (careful, win64 and win32 have different registry trees!)
* check if it's under Program Files, with the following path:
  GNU\\GnuPG\\gpg.exe (calling those functions:
    SHGetSpecialFolderPathA(...CSIDL_PROGRAM_FILES...)
    SHGetSpecialFolderPathA(...CSIDL_PROGRAM_FILESX86...) )
* throwing up arms in despair and giving up

So if your default Windows program directory is indeed e:\\Programme, then the correct path where gpgme would find the binaries would be e:\\Programme\\GNU\\GnuPG\\gpg.exe

Or you could try to set the above registry entry.
Comment 4 Roman Schleicher 2018-02-02 11:27:42 UTC
To clarify something: e:\programme is not my default Windows\Programs folder. It's just another drive (SSD) on which I manually choose to install programs to. In Thunderbird / Enigmail I can manually point to this path so it can find gpg.exe.

The registry key for GnuPG on my system is the following:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GnuPG
and the content of "Install Directory" is "e:\Programme\GnuPG\..\GnuPG". I already tried to make another key ("HKEY_LOCAL_MACHINE\Software\GNU\GnuPG\Install Directory") with both, the same path like above and an absolute path (e:\Programme\GnuPG\bin\) where all the binaries are stored. No success there.

As a last option I used the default install directory for GPG4Win which is "C:\Program Files (x86)\Gpg4win". With this scenario, LO was able to find and use my keys to encrypt a document.

Sidenote:
I don't not, what happend, but today LO reset all my settings as if I deliberately deleted the folder "c:\Users\[username]\AppData\Roaming\LibreOffice\". It's not a big deal but I thought it's worth mentioning.
Comment 5 Thorsten Behrens (allotropia) 2018-02-02 11:45:20 UTC
(In reply to Roman Schleicher from comment #4)
> I already tried to make another key with both, the same path like
> above and an absolute path (e:\Programme\GnuPG\bin\) where all the
> binaries are stored. No success there.
>
Ok, shame -

> As a last option I used the default install directory for GPG4Win which is
> "C:\Program Files (x86)\Gpg4win". With this scenario, LO was able to find
> and use my keys to encrypt a document.
> 
Great, thx a lot for chasing that down to the bottom - the analysis is now pretty complete.

We'll see if we can either get the registry key, or a LibreOffice-wide option to work.
Comment 6 Hans Immel 2018-02-12 11:50:42 UTC
Dasselbe Problem auf meinem Dell Latitude E6430 mit Windows 10 Prof 64bit (16299.214).

In LO "Extras/Optionen/Benutzerdaten/Verschlüsselung/OpenPGP-Signaturschlüssel bzw. OpenPGP Schlüssel zum Verschlüsseln" lassen sich keine meiner Schlüssel auswählen.

Im "Speichern unter" Dialog werden unter "Mit gpg verschlüsseln" meine gpg Zertifikate angezeicht und Dokumente lassen sich verschlüsseln.

Aus Testgründen habe ich für LO speziell ein neues Benutzerprofil angelegt. Trotzdem können unter "Extras/Optionen/Benutzerdaten/Verschlüsselung/OpenPGP-Signaturschlüssel bzw. OpenPGP Schlüssel zum Verschlüsseln" keine ausgewählt und eingestellt werden.

Zur Info: Binaries sind um gpg4win Installationsverzeichnis = "C:\Program Files (x86)\Gpg4win\bin" vorhanden. "gpg" ist korrekt im "path" vorhanden.

reg keys sind vorhanden:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GnuPG
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Gpg4win
Comment 7 Katarina Behrens (Inactive) 2018-02-12 14:31:02 UTC
Maybe those are 2 different problems, Hans does see his GPG keys in
 
File > Save as > Encrypt with GPG (check) > Save 

also in

File > Digital Signatures > Digital Signatures > (save if needed) > Sign Document ...

but not in 

Tools > Options > User Data

While Roman doesn't see his GPG keys at all

Is that right?
Comment 8 Hans Immel 2018-02-13 09:21:15 UTC
yes, that is the case with me
Comment 9 Miklos Vajna 2018-02-23 11:13:32 UTC
Just guessing, isn't the problem that GPGSEInitializer is listed in xmlsecurity/util/xsec_xmlsec.component, but not in xmlsecurity/util/xsec_xmlsec.windows.component?

(I don't have a Windows box with PGP configured to test.)
Comment 10 Commit Notification 2018-02-23 16:12:18 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e2d8e2e0e2248de980f59af15e8b3472c8f56f70

tdf#115374: add GPG SEInitializer service for Windows

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2018-02-23 17:41:07 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6651a8e85824b11395f1c3110afe8dd91bb83375&h=libreoffice-6-0

tdf#115374: add GPG SEInitializer service for Windows

It will be available in 6.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Thorsten Behrens (allotropia) 2018-02-26 22:37:48 UTC
The above should fix Hans' problem - test builds here: https://dev-builds.libreoffice.org/daily/libreoffice-6-0/Win-x86_64@42/
Comment 13 Hans Immel 2018-03-02 14:50:12 UTC
Yep, now I can see list of my keys. Tried it with build libo-60-64_2018-03-01_04.43.15_LibreOfficeDev_6.0.3.0.0_Win_x64.

In stable version (LibreOffice_6.0.2.1_Win_x64) problem persists.

Thanks! Hans
Comment 14 Katarina Behrens (Inactive) 2018-03-02 16:29:55 UTC
> In stable version (LibreOffice_6.0.2.1_Win_x64) problem persists.

The fix prolly didn't make 6.0.2 RC1 cut-off: https://wiki.documentfoundation.org/Releases/6.0.2/RC1 Hopefully final release will have it
Comment 15 Hans Immel 2018-03-29 15:45:18 UTC
(In reply to Katarina Behrens (CIB) from comment #14)
> > In stable version (LibreOffice_6.0.2.1_Win_x64) problem persists.
> 
> The fix prolly didn't make 6.0.2 RC1 cut-off:
> https://wiki.documentfoundation.org/Releases/6.0.2/RC1 Hopefully final
> release will have it

Ok now in 6.0.3.1 (de). I can see and select/set my keys!
Comment 16 Thorsten Behrens (allotropia) 2018-08-06 12:48:56 UTC
Reported as fixed.
Comment 17 Christopher POTTER 2018-09-02 14:03:21 UTC
I have the problem in LO 6.1.0.3 (x64) Windows 10

Best,
Ch. Potter