diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-09-02 12:37:18 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-09-10 09:16:13 +0200 |
commit | 3854dceda7fbda3c579322030b7802a180e959e0 (patch) | |
tree | cebbb4071ad3b83a52f9fb7e255ae3ed2686f476 /xmlsecurity | |
parent | f415c72736d2055ad4704377133d0530d9801293 (diff) |
xmlsecurity: avoid saying OK when the signature is partial
That's reserved for valid signatures (digest match, certificate
validates and the signature covers the whole document).
Also avoid "invalid" in the dialog when the digest matches and the
signature is just incomplete.
This now uses wording which is closer to Acrobat and also uses the same
wording on the infobar and in the dialog.
Change-Id: I26e4781d555b65cf29aa8df2232e286917235dc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101926
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102188
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 46efad443472679b93b282c8e08b807d7e8f1a78)
Conflicts:
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 15 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 5be9bd0d603f..104206ab5c4f 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -551,6 +551,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() size_t nInfos = maSignatureManager.maCurrentSignatureInformations.size(); size_t nValidSigs = 0, nValidCerts = 0; bool bAllNewSignatures = true; + bool bSomePartial = false; if( nInfos ) { @@ -628,7 +629,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() { if (maSignatureManager.mxStore.is()) { - // XML based. + // ZIP based. bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned( aElementsToBeVerified, rInfo, mode); } @@ -640,6 +641,10 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() if( bSigValid ) nValidSigs++; + else + { + bSomePartial = true; + } } Image aImage; @@ -693,8 +698,8 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() bool bShowInvalidState = nInfos && !bAllSigsValid; - m_pSigsInvalidImg->Show( bShowInvalidState ); - m_pSigsInvalidFI->Show( bShowInvalidState ); + m_pSigsInvalidImg->Show( bShowInvalidState && !bSomePartial); + m_pSigsInvalidFI->Show( bShowInvalidState && !bSomePartial); bool bShowNotValidatedState = nInfos && bAllSigsValid && !bAllCertsValid; @@ -703,8 +708,8 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() //bAllNewSignatures is always true if we are not in document mode bool bShowOldSignature = nInfos && bAllSigsValid && bAllCertsValid && !bAllNewSignatures; - m_pSigsOldSignatureImg->Show(bShowOldSignature); - m_pSigsOldSignatureFI->Show(bShowOldSignature); + m_pSigsOldSignatureImg->Show(bShowOldSignature || bSomePartial); + m_pSigsOldSignatureFI->Show(bShowOldSignature || bSomePartial); SignatureHighlightHdl( nullptr ); } diff --git a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui index 958b8359bc80..55ee1f4e6c9b 100644 --- a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui +++ b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui @@ -297,7 +297,7 @@ <property name="can_focus">False</property> <property name="no_show_all">True</property> <property name="hexpand">True</property> - <property name="label" translatable="yes" context="digitalsignaturesdialog|oldsignatureft">Not all parts of the document are signed</property> + <property name="label" translatable="yes" context="digitalsignaturesdialog|oldsignatureft">At least one signature has problems: the document is only partially signed.</property> <property name="xalign">0</property> </object> <packing> @@ -310,7 +310,7 @@ <property name="can_focus">False</property> <property name="no_show_all">True</property> <property name="hexpand">True</property> - <property name="label" translatable="yes" context="digitalsignaturesdialog|notvalidatedft">Certificate could not be validated</property> + <property name="label" translatable="yes" context="digitalsignaturesdialog|notvalidatedft">At least one signature has problems: the certificate could not be validated.</property> <property name="xalign">0</property> </object> <packing> |