Bug 76142 - EU-conform digital signatures (XAdES, ASiC container) in Libre Office
Summary: EU-conform digital signatures (XAdES, ASiC container) in Libre Office
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-13 21:50 UTC by Aron Szabo
Modified: 2016-11-12 13:43 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Libre Office document with XAdES-signature (SHA-1 based) (14.24 KB, application/vnd.oasis.opendocument.text)
2014-03-16 13:26 UTC, Aron Szabo
Details
Libre Office document with XAdES-signature (SHA-256 based) (16.96 KB, application/vnd.oasis.opendocument.text)
2014-03-16 13:27 UTC, Aron Szabo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Szabo 2014-03-13 21:50:46 UTC
Topic: How to use EU-conform digital signatures in Libre Office?

Note: I have performed some tests how base XMLDSIG structures of Libre Office can be extended to XAdES (ETSI TS 101 903) structures that can contain e.g. timestamps and revocation data without breaking the processing rules of Libre Office. I found that this is possible, the XML structures can be slightly modified, but - beyond several minor problems - two major, blocking problems occurred: the lack of support stronger crypto agorithms (e.g. SHA-256 for hashing, SHA-256 with RSA for signing) and the matter of 0 byte-sized files (see bug 60700).

Suggested solution: The signature layer of Libre Office is based on Aleksey Sanin's library which uses OpenSSL in the background. Perhaps, it is quite enough if those libraries (libxmlsec.dll, libxmlsec-mscrypto.dll, xmlsecurity.dll, ssleay32.dll) are updated. The recent versions of such libraries support just SHA-1 based operations which must be rejected since 2012-01-01 in a legal case...
Comment 1 Aron Szabo 2014-03-16 13:26:54 UTC
Created attachment 95889 [details]
Libre Office document with XAdES-signature (SHA-1 based)
Comment 2 Aron Szabo 2014-03-16 13:27:30 UTC
Created attachment 95890 [details]
Libre Office document with XAdES-signature (SHA-256 based)
Comment 3 QA Administrators 2015-10-14 19:56:18 UTC Comment hidden (obsolete)
Comment 4 Miklos Vajna 2016-01-25 10:30:07 UTC
One concrete problem from the above report is the lack of sha-256 support. I checked that (at least on Linux) libxmlsec supports sha-256, nss does as well, but the nss backend of libxmlsec does not. I'll fix that.
Comment 5 Commit Notification 2016-01-25 11:13:45 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#76142 libxmlsec: implement SHA-256 support in the NSS backend

It will be available in 5.2.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 6 Commit Notification 2016-01-26 12:40:57 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#76142 libxmlsec: extend SHA-256 support in the NSS backend

It will be available in 5.2.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 7 Commit Notification 2016-01-27 16:28:05 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#76142 libxmlsec: fix xmlSecNssDigestVerify() for SHA-256

It will be available in 5.2.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 8 Commit Notification 2016-02-03 12:36:29 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#76142 libxmlsec: implement SHA-256 support in the mscrypto backend

It will be available in 5.2.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 9 Miklos Vajna 2016-02-03 12:40:24 UTC
Now attachment 95890 [details] opens correctly for me on both Windows and Linux, while previously a dbgutil failed with:

warn:xmlsecurity.xmlsec:2700:1788:xmlsecurity/source/xmlsec/errorcallback.cxx:43: ..\src\transforms.c:1544: xmlSecTransformNodeRead() '' 'xmlSecTransformIdListFindByHref' 1 'href=http://www.w3.org/2001/04/xmlenc#sha256'

on the console.
Comment 10 How can I remove my account? 2016-11-10 14:48:38 UTC
Out of interest, what tool was used to produce the SHA-256 attachment?
Comment 11 Aron Szabo 2016-11-12 13:43:38 UTC
(In reply to Tor Lillqvist from comment #10)
> Out of interest, what tool was used to produce the SHA-256 attachment?

Hi, I used just a PHP-based tool that I developed to create test signatures (mainly malformed signatures for negative tests). Aron