[snap] Cannot sign a document, gpg keys are not listed

Bug #1772683 reported by Olivier Tilloy
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
LibreOffice
Won't Fix
Medium
libreoffice (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

(initially reported on the forum: https://forum.snapcraft.io/t/libreoffice-snap-missing-features-and-known-bugs/3920/10)

Libreoffice 6.0.4.2 (64, candidate channel).

Steps to reproduce:
 1) snap run libreoffice.writer
 2) write something, then save the document (anywhere) on disk
 3) Open the File menu, then Digital Signatures > Digital Signatures…
 4) in the dialog, click "Sign Document…"

Expected result: your GPG keys are listed

Current result: no keys are listed

Tags: snap
Revision history for this message
Olivier Tilloy (osomon) wrote :

Adding the gpg-keys interface, and exporting GNUPGHOME to $REALHOME/.gnupg in the launcher script helps, but then the keys that are listed have incomplete information:

 - no "issued to" field
 - no "issued by" field
 - the expiration date doesn't match any keys listed in seahorse

This requires further investigation.

Changed in libreoffice (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
description: updated
Revision history for this message
Olivier Tilloy (osomon) wrote :

When trying to sign the current document with one of the listed keys, the operation silently fails.
If I strace the app, I can see that the "gpg --sign --detach" command is issued with the correct key ID. If I run the same command in a snapd shell for libreoffice.writer, I'm seeing the following:

  gpg: can't query passphrase in batch mode
  gpg: skipped "[KEY_ID]": bad passphrase
  gpg: signing failed: bad passphrase

Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
In , Brian (thwaller) wrote :

Created attachment 143245
Digital Signatures window

Ubuntu 18.04 MATE
LibreOffice Version: 6.0.5.2
Build ID: 1:6.0.5~rc2-0ubuntu0.18.04.1~lo1
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: en-US (en_US.UTF-8); Calc: group

OpenPGP does not appear to be working at all. This report appears to be a semi duplication of other reports, but they are only similar and not mentioning Linux, but MacOS and Windows.

1) Go to Tools -> Options -> User Data, under Cryptography there is OpenPGP Signing Key and OpenPGP Encryption Key. Both show "No Key" and the pull down lists nothing more to select, ie. none of my keys appear.

2) Go to File -> Digital Signatures -> Digital Signatures, I an given a window, blank in content, with the options of "Sign Document" and "Start Certificate Manager" [see attached screenshot]. I click to start certificate manager, and from there Seahorse opens and I can see and verify all of the keys and certificates I expect to see and have available to me. So, I click to sign document. I am then asked to select a certificate, and only X.509 options are there.

Unless I am missing something, those are the only places I find to use PGP keys to sign a document. I currently have numerous X.509 certs and PGP keysets on my system, all working properly. I have enigmail, gnupg, seahorse, gpg, and other key management and dev tools installed. I am able to generate and manage keys without issues, and use keys PGP and SSH keys without issue for basic messages, email, remote connectivity, etc. This issue is not new for me to this version, it has been existing for a while. I am reporting now as the need to use came up again and it is still not functional.

Revision history for this message
In , Xiscofauli (xiscofauli) wrote :

Thank you for reporting the bug.
it seems you're using an old version of LibreOffice.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.

Revision history for this message
In , Brian (thwaller) wrote :

My current version is:
Version: 6.1.3.1
Build ID: 1:6.1.3~rc1-0ubuntu0.18.04.1

Nothing has changed in what I reported 3 months ago throughout all of the updates/upgrades received since then.

Revision history for this message
In , Thb-b (thb-b) wrote :

It seems LibreOffice is unable to discover a working gpg setup on your machine. To further troubleshoot this, it would be easiest if you could install a debug-enabled version, e.g. from here:

https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86@87-TDF-dbg/current/

Then run it from a terminal, with the following environment variable set:

export SAL_LOG="+WARN.+INFO.xmlsecurity"

and provide a link to the output (please review for potential private information, the log can be quite verbose).

Revision history for this message
In , Brian (thwaller) wrote :

I would prefer not to do such steps as I use the software. I have this same issue on all laptops I have LibreOffice installed on, and also use GPG on all as well with no issues on Thunderbird, manual signing, file encryption, etc. If LibreOffice cannot find it, there seems to be a bigger issue as the install is all default, nothing changed or modified in any way except for the import and export of keys, and in some cases, a newly generated key.

I am currently using Version: 6.1.5.2, Build ID: 1:6.1.5~rc2-0ubuntu0.18.04.1~lo3 on this laptop which was a fresh install on a new hard disk about 3 months ago. Everything as reported is identical, as well as everything else working just fine.

Is there any way to see any debug into without needing to install a "new" product? It seems odd as if it wants to find gpg, it just needs to look in the default location. I also cannot find any settings on how I might make sure it is looking there.

Revision history for this message
In , Thb-b (thb-b) wrote :

6.1.5~rc2-0ubuntu0.18.04.1~lo3 seems to be a pre-release build provided by the Ubuntu community, so we have no control over how that build is done. It does appear not to be a general problem though with LibreOffice on that system.

For any further insight, we'd need the requested info.

Revision history for this message
Olivier Tilloy (osomon) wrote :

This doesn't seem to work with the deb package either. Tested on cosmic with 6.1.4, and confirmed by Rico.

Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Incomplete
Revision history for this message
In , Brian (thwaller) wrote :

Do you have a working PPA I could install future updates from where the product would be supported? FYI- the link previously provided is not / no longer valid.

I do see this:
https://launchpad.net/df-libreoffice

which then directs at the bottom to where I have installed from:
"LibreOffice packaging for Ubuntu can be found at: https://launchpad.net/~libreoffice"

Revision history for this message
In , Olivier Tilloy (osomon) wrote :

Please note that packages from PPAs are not officially supported, they are a community best effort to provide up-to-date packages on older versions of Ubuntu.
If you're after an officially supported package, you should stick to the (older) version in the Ubuntu repositories.

That said, this bug is being tracked in Ubuntu at https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1772683.

Revision history for this message
In , Thb-b (thb-b) wrote :

Thx for the pointer Olivier - closing then on this side.

Changed in df-libreoffice:
status: Incomplete → Won't Fix
Olivier Tilloy (osomon)
Changed in libreoffice (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

any update on this? I'm on the LO6.3.3 this problem still occurs in 19.04.

Revision history for this message
Marcelo Utida (marcelo-utida) wrote :

Hi, guys.

The same problem occur in Libreoffice 6.3.4.2 in 19.10.

Revision history for this message
bill (bill-zannoni) wrote :

Hi,

I see the same on Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10 on Ubuntu 18.04.

Revision history for this message
Emmanuel (ubuntu-oi) wrote :

I Got the same problem
Xubuntu 18.04
libreoffice 6.0.7.3

I look like libreoffice can't find any agent.
If you go to File / digital signature / digital signature
then "start certificat manager"
Seahorse open but he is empty (no GnuPG Key). But i saw them on thunderbird as exemple.
Then if you create a new PGP Key then process end with an error message :
"Impossible to generate PGP Key" (translation from french, french message is : "Impossible de générer la clé PGP")
"No agent running" (translation from french, french message is : "Pas d'agent en cours d'execution")

Revision history for this message
Sebastian Jentschke (sebastian-jentschke) wrote :

Works in DEB-version, doesn't work in snap (LO 6.4.3.2, Ubuntu 18.04).

Revision history for this message
Andrew Thornton (art27) wrote :

I've discovered that this bug affects the non-snap version of libreoffice on focal too.

https://listarchives.libreoffice.org/global/users/msg54820.html suggests that the problem is likely within the apparmor profile - and that apparmor is preventing libreoffice from accessing .gnupg but I have not attempted to change the profile to see if this fixes things.

Revision history for this message
mvaldez (mario-mariovaldez) wrote :

Andrew Thornton, may that be a different problem? Please see bug #1886092 for the non-snap version report and workaround/fix when Apparmor is the problem.

Revision history for this message
bill (bill-zannoni) wrote :

I have the same problem:
Ubuntu 20.04
LibreOffice (snap) 7.0.2.2

If I use the Appimage provided by LibreOffice (https://www.libreoffice.org/download/appimage/), version standard, fresh, the digital signing works fine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.