tdf#99327 vcl PDF mscrypto sign: fix SHA-256 OID

The previous OID only worked with NSS as NSS_CMSUtil_MapSignAlgs() has a
hack to accept it, saying Windows 2003 generates such OIDs. Don't depend
on readers of the signature accepting that incorrect OID.

Change-Id: I63e9a363e9e2ad233eeeacea1a354e3190da1ac1
This commit is contained in:
Miklos Vajna
2016-11-22 15:07:54 +01:00
parent 1ed86ee4eb
commit 4234b099f1

View File

@@ -7306,7 +7306,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
aPara.cbSize = sizeof(aPara);
aPara.dwMsgEncodingType = PKCS_7_ASN_ENCODING | X509_ASN_ENCODING;
aPara.pSigningCert = pCertContext;
aPara.HashAlgorithm.pszObjId = const_cast<LPSTR>(szOID_RSA_SHA256RSA);
aPara.HashAlgorithm.pszObjId = const_cast<LPSTR>(szOID_NIST_sha256);
aPara.HashAlgorithm.Parameters.cbData = 0;
aPara.cMsgCert = 1;
aPara.rgpMsgCert = &pCertContext;
@@ -7335,7 +7335,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
aSignerInfo.pCertInfo = pCertContext->pCertInfo;
aSignerInfo.hCryptProv = hCryptProv;
aSignerInfo.dwKeySpec = nKeySpec;
aSignerInfo.HashAlgorithm.pszObjId = const_cast<LPSTR>(szOID_RSA_SHA256RSA);
aSignerInfo.HashAlgorithm.pszObjId = const_cast<LPSTR>(szOID_NIST_sha256);
aSignerInfo.HashAlgorithm.Parameters.cbData = 0;
CMSG_SIGNED_ENCODE_INFO aSignedInfo;