Kaydet (Commit) 167569bf authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 6a23af75
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment