diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-01-16 12:10:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-16 21:54:00 +0100 |
commit | f9839a5b74963e881f914ffe3a9b36029ded3585 (patch) | |
tree | 5396faca0c33d30fa3b6d65e2302b8173f99a614 /xmlsecurity | |
parent | 0fbc3a1a90a649bc6353aca9fe3332556961f1a5 (diff) |
tdf#115011 don't crash on non-existent gpg support
Change-Id: I90679472898648ccf0811c67c17f7bad41d4e347
Reviewed-on: https://gerrit.libreoffice.org/47984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 03afd4b72431a0dc197891d41fb7bf2419858380)
Reviewed-on: https://gerrit.libreoffice.org/47994
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 195c74ec5c3e..8c65aa2944fd 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -683,7 +683,7 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c uno::Reference<security::XCertificate> xCert; //First we try to get the certificate which is embedded in the XML Signature - if (!rInfo.ouX509Certificate.isEmpty()) + if (xSecEnv.is() && !rInfo.ouX509Certificate.isEmpty()) xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate); else { //There must be an embedded certificate because we use it to get the @@ -696,9 +696,9 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c } //In case there is no embedded certificate we try to get it from a local store - if (!xCert.is()) + if (!xCert.is() && xSecEnv.is()) xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xmlsecurity::numericStringToBigInteger( rInfo.ouX509SerialNumber ) ); - if (!xCert.is()) + if (!xCert.is() && xGpgSecEnv.is()) xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger("") ); SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Certificate not found and can't be created!" ); |