diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-18 15:27:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-19 11:58:55 +0200 |
commit | 8f208bfc1069b1c2f4a3df17252c7da2b005b5d8 (patch) | |
tree | 1bee2931877a7c3d3a99b53a4dd18aa468a427ca /xmlsecurity/source | |
parent | 09aa8b483076aee791daa324b11c6c390a034d04 (diff) |
tdf#107782 xmlsecurity PDF verify: handle empty X509 certificate
Leaving Signer as an empty reference will do exactly what we want: the
signature will be considered invalid.
(cherry picked from commit 18aa83acfa243741eb4c79a2e11aec6eaf1a9f02)
Change-Id: I25d7cbd260384110173fe953fc24f3dcf6b9acd5
Reviewed-on: https://gerrit.libreoffice.org/37803
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/helper/pdfsignaturehelper.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index 702697a89dd1..9bb6e59d0380 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -76,7 +76,8 @@ uno::Sequence<security::DocumentSignatureInformation> PDFSignatureHelper::GetDoc const SignatureInformation& rInternal = m_aSignatureInfos[i]; security::DocumentSignatureInformation& rExternal = aRet[i]; rExternal.SignatureIsValid = rInternal.nStatus == xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED; - rExternal.Signer = xSecEnv->createCertificateFromAscii(rInternal.ouX509Certificate); + if (!rInternal.ouX509Certificate.isEmpty()) + rExternal.Signer = xSecEnv->createCertificateFromAscii(rInternal.ouX509Certificate); rExternal.PartialDocumentSignature = rInternal.bPartialDocumentSignature; // Verify certificate. |