summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-02-26 19:25:18 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-03-03 12:47:30 +0100
commit90b725675c2964f4a151d802d9afedd8bc2ae1a7 (patch)
tree3e5396007482ebc77766a4f071c6169907a8ce0a /xmlsecurity
parent5af5ea893bcb8a8eb472ac11133da10e5a604e66 (diff)
xmlsecurity: avoid exception in DigitalSignaturesDialog::getCertificate()
Fallback to PGP if there's no X509 signing certificate because CheckX509Data() failed prevents the dialog from popping up. To avoid confusing the user in this situation, the dialog should show no certificate, which is already the case. Change-Id: I7f382165657f50723ac65a60309567e5b6c5ae1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111664 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 044676688389..e6ca398e3c80 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -723,7 +723,7 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c
xCert = xSecEnv->getCertificate(rInfo.GetSigningCertificate()->X509IssuerName,
xmlsecurity::numericStringToBigInteger(rInfo.GetSigningCertificate()->X509SerialNumber));
}
- if (!xCert.is() && xGpgSecEnv.is())
+ if (!xCert.is() && xGpgSecEnv.is() && !rInfo.ouGpgKeyID.isEmpty())
xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger(u"") );
SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Certificate not found and can't be created!" );