Issue 121505 - Adding a signature to a document already signed by MS Word invalidates the MS Word signature
Summary: Adding a signature to a document already signed by MS Word invalidates the MS...
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2012-12-18 18:45 UTC by chris.rae
Modified: 2012-12-19 03:22 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

File signed by MS Word (result of step 7 in the repro steps) (6.62 KB, application/vnd.oasis.opendocument.text)
2012-12-18 18:45 UTC, chris.rae
no flags Details
A Leisurely Hello-Again Confirmation [zip] (538.98 KB, application/x-zip-compressed)
2012-12-19 00:27 UTC, orcmid
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description chris.rae 2012-12-18 18:45:40 UTC
Created attachment 80045 [details]
File signed by MS Word (result of step 7 in the repro steps)

Using OOo to add a signature to a document that has already been signed by someone in MS Word invalidates the (still-valid) original signature.

Steps (note that a file is attached which allows you to skip steps 1-7):

1) Boot MS Word
2) Hit Escape (Create default document)
3) File -> Info -> Protect Document -> Add a Digital signature
4) Save file as ODF format (.odt)
5) Choose an RSA certificate that uses a SHA1 hash (DSA is fine too)
6) Click Sign
7) Exit MS Word
8) Open document in OOo 
9) Under File menu, click Digital Signatures
10) Notice they're considered valid
11) Now click "Sign Document" button and add a digital signature using a SHA1 cert
12) Observe invalid original signature

It seems that this might be happening because OOo is rewriting the XML for the MS Word signature, but omitting the Type attribute on the Reference element.

This is also filed on LibreOffice (
Comment 1 orcmid 2012-12-19 00:27:24 UTC
Created attachment 80048 [details]
A Leisurely Hello-Again Confirmation [zip]

This is a slow walk through this defect case to gain more clues on what the disconnect is.  There are two ODT documents and a variety of screenshots, in date-time sequence:

 1. HelloAgain.odt is a simple Word 2013 Preview document saved with a digital signature.

 2. SignedFirst.png shows the dialogs that were used in the signing of (1).  Aftersigned.png are two screen shots confirming that signing occurred.  The last shows that signed documents are considered "final" as a safety measure.

 3. HelloAgainInAOO.png shows that a *copy* of HelloAgain.odt, HelloAgain2.odt, is still recognized as signed with a verifiable signature by Apache OpenOffice 3.4.1.  (The renamed copy is to prevent alteration to HelloAgain.odt so it can be compared with later ones.)

 4. AOO-delines.png is fascinating.  AOO 3.4.1 concludes that signatures can't be added because the document does not have an ODF 1.2 digital signature.  (There is no digital signature in ODF 1.1, but implementations had an implementation-dependent one that is not compatible with the ODF 1.2 digital signature.  But that is not what is in HelloAgain2.odt.  Hypothesis: This is an unintended consequence of the manifest:version introduction.)

 5. HelloAgainInLibO.png is HelloAgain2.odt opened in LibreOffice 3.6.4 (any port in a storm).  The document is again recognized as having a verifiable signature.

 6. AddSigLibO.png shows that LibreOffice 3.6.4 does allow adding a signature.

 7. Oops!  After applying the second signature, the first signature is reported as invalid.  This is demonstrated in the three OopsLibO.png screen captures.  The last of those is on attempting to re-open the HelloAgain2.odt after the defective second signing. 

 8. OopsAOO.png reveals that Apache OpenOffice 3.4.1 also sees the double-signing as defective.

 9. OopsMSWPre.png also demonstrates that Microsoft Office Word 2013 Preview fails to notice that HelloAgain2.odt is signed at all.  The document is not opened as read-only or final either.

I can see a significant area for work at the next ODF Plugfest [;<).
Comment 2 orcmid 2012-12-19 03:22:09 UTC
I think we've confirmed the symptoms, now need to figure out what and how many the bugs are.