Bug 156340 - Document contains macro signed by OpenPGP key can't be enabled and causes operation hanging
Summary: Document contains macro signed by OpenPGP key can't be enabled and causes ope...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/the-rig...
Whiteboard:
Keywords:
Depends on:
Blocks: Digital-Signatures Macro
  Show dependency treegraph
 
Reported: 2023-07-18 01:25 UTC by Franklin Weng
Modified: 2023-11-23 12:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Problematic file with signed signature (12.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-07-18 01:25 UTC, Franklin Weng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franklin Weng 2023-07-18 01:25:39 UTC
Created attachment 188422 [details]
Problematic file with signed signature

https://ask.libreoffice.org/t/the-right-way-to-sign-a-macro/93656

The attachment there (also attached here) is an ods file with a simple macro, signed by the author's OpenPGP key.  He signed the macro but not the file itself.

When I opened it with LibreOffice 7.6.0.1, it asked me if I would trust the signature or not.  If I clicked View Signature, it didn't show the signature, but directly got into the main screen with the macro button there.  But then it told me that the macro was disabled due to Macro Security Settings (I set it to "Medium" - Confirmed required before executing macros from untrusted sources).  

Now a couple of problems here - 
1. In this condition, I couldn't leave LibreOffice.  Either clicked the x button in the upright corner, or selected "Exit LibreOffice" from File menu didn't work.
2. It didn't respond when I click "Show Macros" or hit the macro button ("hello world").
3. In the Tools - Options - Security, when I clicked Macro Security to check, it popped a window saying 

Macro security problem!  
Broken certificate data: 
[a bunch of bogus messages]
com.sun.star.uno.RuntimeException message: "at /home/buildslave/source/libo-core/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx:307"

before showing the Macro security window.

The file is signed by 7.0.4.2.  

Tested by 7.6.0.1:
Version: 7.6.0.1 (X86_64) / LibreOffice Community
Build ID: 776eaf34564cbf3f034a0ba1fd1d5c32ff9ccf1c
CPU threads: 4; OS: Linux 6.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: zh-TW (zh_TW.UTF-8); UI: en-US
Calc: threaded
Comment 1 Franklin Weng 2023-07-18 01:30:22 UTC
I have to manually kill the LibreOffice process from command line to exit LibreOffice.

Also, even I checked to "Always trust macros from this source" and clicked "Enable macros", it still told me that Macros disabled.  But from there, I could check macros and exit LibreOffice.  It still told me Broken certificate data when I clicked Macro Security in Tools - Options - Security, and the next time I open it, it still asked me if I trust the signature or not.
Comment 2 gholk 2023-07-18 11:37:35 UTC
Hey, I am the man ask on ask.libreoffice.
Following is the full libreoffice version text on my linux:

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: x11
Locale: en-US (zh_TW.UTF-8); UI:zh-TW
Debian package version: 1:7.0.4-4+deb11u7
Calc: threaded