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-18 20:31:09 +0200 |
commit | 18aa83acfa243741eb4c79a2e11aec6eaf1a9f02 (patch) | |
tree | 7be9c71558f8c9b210c50f9a94fa82703cc8fe4c /xmlsecurity/source | |
parent | 419a90a0d3f25087624ef741fb8ebac92caa1a2f (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.
Change-Id: I25d7cbd260384110173fe953fc24f3dcf6b9acd5
Reviewed-on: https://gerrit.libreoffice.org/37770
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
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. |