diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-09-02 12:37:18 +0200 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-04-06 14:24:23 +0300 |
commit | 4d54747a206ec7a1a7e7be38be456f89423db2a1 (patch) | |
tree | b5cfe66ff5b1b72631d1778a633ecaf4d040fba9 /xmlsecurity/source | |
parent | 863496186f9548571d9ed7597db9be0404ee63f6 (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.
Conflicts:
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
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)
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 49cf10034603..a965401fcceb 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -558,6 +558,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() size_t nInfos = maSignatureManager.maCurrentSignatureInformations.size(); size_t nValidSigs = 0, nValidCerts = 0; bool bAllNewSignatures = true; + bool bSomePartial = false; if( nInfos ) { @@ -634,7 +635,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() { if (maSignatureManager.mxStore.is()) { - // XML based. + // ZIP based. bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned( aElementsToBeVerified, rInfo, mode); } @@ -646,6 +647,10 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() if( bSigValid ) nValidSigs++; + else + { + bSomePartial = true; + } } Image aImage; @@ -698,8 +703,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; @@ -708,8 +713,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 ); } |