diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-07-10 10:26:40 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-07-10 15:47:37 +0200 |
commit | 30f857246e9cea6c1879d52801dcb24c75b45d42 (patch) | |
tree | 07a8abc28ef4f17a2b67a2380b60a8edc986a400 /xmlsecurity | |
parent | 820bd4b3b64a5746599c48c729037a959ff61c84 (diff) |
Related tdf#108977 Fix crash when vieweing non-existing certificate
gpg4libre
Change-Id: If72c2ee818b67b48753ee293de4f02b4832b9d96
Reviewed-on: https://gerrit.libreoffice.org/39743
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 6 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc | 1 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.src | 5 |
3 files changed, 11 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 37d0608d66c7..69a9a7d4ec60 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -724,13 +724,17 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() sal_uInt16 nSelected = (sal_uInt16) reinterpret_cast<sal_uIntPtr>( m_pSignaturesLB->FirstSelected()->GetUserData() ); const SignatureInformation& rInfo = maSignatureManager.maCurrentSignatureInformations[ nSelected ]; uno::Reference<security::XCertificate> xCert = getCertificate(rInfo); - uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert); if ( xCert.is() ) { + uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert); ScopedVclPtrInstance<CertificateViewer> aViewer(this, xSecEnv, xCert, false); aViewer->Execute(); } + else + { + ScopedVclPtrInstance<InfoBox>(nullptr, XsResId(STR_XMLSECDLG_NO_CERT_FOUND))->Execute(); + } } } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc index 4998defb3238..c56c26da96d1 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc @@ -28,6 +28,7 @@ #define STR_XMLSECDLG_QUERY_REALLYREMOVE (RID_DIGITALSIGNATUREDLG_START + 2) #define STR_XMLSECDLG_SIGNING_FAILED (RID_DIGITALSIGNATUREDLG_START + 3) #define STR_XMLSECDLG_NO_CERT_MANAGER (RID_DIGITALSIGNATUREDLG_START + 4) +#define STR_XMLSECDLG_NO_CERT_FOUND (RID_DIGITALSIGNATUREDLG_START + 5) #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src index 2d4b4e0fb38e..a01f7d1a33b6 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src @@ -51,4 +51,9 @@ String STR_XMLSECDLG_NO_CERT_MANAGER Text [ en-US ] = "Could not find any certificate manager."; }; +String STR_XMLSECDLG_NO_CERT_FOUND +{ + Text [ en-US ] = "Could not find the certificate."; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |