Bug 153626 - Unable to sign with existing digital signature, and inconsistent UI for digital signature in Writer
Summary: Unable to sign with existing digital signature, and inconsistent UI for digit...
Status: RESOLVED DUPLICATE of bug 152524
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.5.1 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Digital-Signatures
  Show dependency treegraph
 
Reported: 2023-02-15 05:00 UTC by Fonzie
Modified: 2024-02-08 23:24 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 Fonzie 2023-02-15 05:00:56 UTC
Description:
In LibreOffice Writer, go to File -> Digital Signatures -> Digital Signatures... , if I click on Sign Document... button , in the popup "Select X.509 Certificate" window, LibreOffice is able to find my existing GnuPG signature in ~/.gnupg/ , but I was not able to use it to sign a document.

Also there is a seemingly same "Select X.509 Certificate" window in the following two menu path:

File -> Digital Signatures -> Sign Existing PDF... , after selecting a PDF file, click on the "Sign Document..."

File -> Export As -> Export as PDF... , in Digital Signatures tab, click on Select ...

But there is no existing digital signature available in the later two popup window.

Steps to Reproduce:
1. In LibreOffice Writer, go to File -> Digital Signatures -> Digital Signatures...
2. click on Sign Document... button
3. in the popup "Select X.509 Certificate" window, LibreOffice is able to find my existing GnuPG signature in ~/.gnupg/ , but I was not able to use it to sign a document.

Actual Results:
Nothing happened.

Expected Results:
LibreOffice should sign the chosen document with the digital signature selected.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 4; OS: Mac OS X 11.6.8; UI render: default; VCL: osx
Locale: zh-CN (zh_Hans.UTF-8); UI: en-US
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-04-25 15:06:56 UTC
Thanks, hxf.
Which format is the file you are trying to sign?
Comment 2 Fonzie 2023-04-26 13:53:52 UTC
Hi, Stéphane Guillou.

I was trying to sign a PDF file.

I probably tried to sign the odt file which is the source file to generate the PDF file.

Regards, Fonzie.
Comment 3 QA Administrators 2023-04-27 03:24:30 UTC Comment hidden (obsolete)
Comment 4 Stéphane Guillou (stragu) 2023-04-28 11:06:59 UTC
PDFs can only be signed with X.509 certificates, which is why the dialog should hide those OpenPGP signatures. This is expected.

However, if you were not able to sign an ODT file with your GPG key, there's an issue.

Can you please confirm that this fails:
1. Create ODT
2. Save the file
3. Sign it with File > Digital Signatures > Digital Signatures... > Sign Document.

If it does fail, 

I could not reproduce the issue on Linux:

Version: 7.5.3.1 (X86_64) / LibreOffice Community
Build ID: d29ee673721b12c92b3de9b9663473211414f0db
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 5 Alex Thurgood 2023-05-01 16:06:56 UTC
@Fonzle : it has never worked for me, and even previous hacks at getting it to work via the command line don't survive a reboot.

Duplicate of bug 115538.

*** This bug has been marked as a duplicate of bug 115538 ***
Comment 6 Stéphane Guillou (stragu) 2023-05-01 20:46:25 UTC
Alex, it seems the issue here is slightly different: Fonzie can see the signatures, but using them doesn't work.

Also, did you see Dieter's comment in bug 115538, who says they are now also displayed on aarch64 M1 Silicon?
Comment 7 Alex Thurgood 2023-05-02 10:22:02 UTC
@Stéphane, sorry my bad, reset to UNCONF
Comment 8 Alex Thurgood 2023-05-02 10:24:02 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)


> Also, did you see Dieter's comment in bug 115538, who says they are now also
> displayed on aarch64 M1 Silicon?

I saw that, but unfortunately I still can't see any GPG sigs under the General Preferences dropdown menus, nor are they displayed in the digital signature dialog.

Anyway, will comment on that over there, rather than here.
Comment 9 Fonzie 2023-05-31 04:25:52 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> PDFs can only be signed with X.509 certificates, which is why the dialog
> should hide those OpenPGP signatures. This is expected.
> 
> However, if you were not able to sign an ODT file with your GPG key, there's
> an issue.
> 
> Can you please confirm that this fails:
> 1. Create ODT
> 2. Save the file
> 3. Sign it with File > Digital Signatures > Digital Signatures... > Sign
> Document.
> 
> If it does fail, 

Just tried these steps, didn't work. After I chose my GPG signature in step 3, nothing seemed to happen. And under File -> Properties... , the "Digitally signed:" field is still empty.

LibreOffice info:
Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 4; OS: Mac OS X 11.6.8; UI render: default; VCL: osx
Locale: zh-CN (zh_Hans.UTF-8); UI: en-US
Calc: threaded
Comment 10 Heiko Tietze 2023-06-14 12:38:39 UTC
1. brew install gnupg
2. gpg --full-generate-key (4,#13,0,Test,test@test.com...)
3. gpg --list-secret-keys => sec,uid
4. Writer > Save > Sign > Sign Document => pick the key, click sign

=> list remains empty (not sure my key is accepted but no warning either)

I wonder if Fonzie missed #4 (add key per extra dialog), how s/he manages the keys (make sure gpg --list-secret-keys shows your keys), and eventually if my issue is the problem.

(I suggest to separate the "inconsistent UI for digital signature in Writer" part from the topic here.)
Comment 11 steve 2023-07-18 09:15:27 UTC
What is the scope of this bug here? Is the Digital Signatures dialog which opens under File > Digital Signatures > Digital Signatures supposed to show OpenPGP keys? If yes, it already fails at that step.

The fact this dialog was previously called "Select X.509 Certificate" as per initial report, this would suggest to only show S/MIME certs in which case, this bug is WORKSFORME as OP is trying to see their OpenPGP keys.
Comment 12 Alex Thurgood 2024-02-07 07:31:29 UTC
This bug report sounds like a DUP of bu 156352, which is marked as resolved fixed in current master daily build.

@Fonzie : can you give this a try with daily build from at least Feb 7th and report back ?
Comment 13 steve 2024-02-08 12:54:57 UTC
Agreeing, this is a duplicate report. The fix there does not resolve the problem for me, but would be appreciated if you could test and report in https://bugs.documentfoundation.org/show_bug.cgi?id=156352 what behavior you are seeing, Fonzie.

*** This bug has been marked as a duplicate of bug 156352 ***
Comment 14 steve 2024-02-08 23:24:50 UTC
wrong dupe as per https://bugs.documentfoundation.org/show_bug.cgi?id=156352#c30
Adjusting.

*** This bug has been marked as a duplicate of bug 152524 ***