[Libreoffice-commits] core.git: vcl/source

Tor Lillqvist tml at collabora.com
Tue Feb 24 05:40:34 PST 2015


 vcl/source/gdi/pdfwriter_impl.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 167569bfea0bfa5f697ed7a25a354537bc97fa53
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Feb 24 15:29:05 2015 +0200

    tdf#84881: NSSCMSAttribute::type can't be null. Must be same as typeTag.oid?
    
    Why is a separate field then needed? Dunno, but probably because the type and
    values fields make up an encoded NSSCMSAttribute. (The comment in <nss/cmst.h>
    says so, but it took a while before I realized what it meant.) The typeTag and
    encoded fields are for NSS internal use or something.
    
    Now Adobe Reader says "The signature includes an embedded timestamp but it is
    invalid". Progress...
    
    Change-Id: I390947db8d414a7ceecc1f67aaeed5fa0f66fe6f

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 222722b..d782bc1 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6950,9 +6950,7 @@ bool PDFWriterImpl::finalizeSignature()
 
         NSSCMSAttribute timestamp;
 
-        timestamp.type.type = siBuffer;
-        timestamp.type.data = NULL;
-        timestamp.type.len = 0;
+        // timestamp.type filled in below
 
         SECItem values[2];
         values[0] = response.timeStampToken;
@@ -6975,11 +6973,13 @@ bool PDFWriterImpl::finalizeSignature()
         }
         typetag.offset = SEC_OID_UNKNOWN; // ???
         typetag.desc = "id-aa-timeStampToken";
-        typetag.mechanism = CKM_INVALID_MECHANISM; // ???
+        typetag.mechanism = CKM_SHA256; // ???
         typetag.supportedExtension = UNSUPPORTED_CERT_EXTENSION; // ???
         timestamp.typeTag = &typetag;
 
-        timestamp.encoded = PR_TRUE;
+        timestamp.type = typetag.oid; // ???
+
+        timestamp.encoded = PR_TRUE; // ???
 
         if (my_NSS_CMSSignerInfo_AddUnauthAttr(cms_signer, &timestamp) != SECSuccess)
         {


More information about the Libreoffice-commits mailing list