summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/component
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-04 10:31:46 +0000
committerMiklos Vajna <vmiklos@collabora.com>2022-03-04 14:26:04 +0100
commitf30bc3ccdfb48356910d64ee4a3dda685b11de93 (patch)
tree1b9b1ed2a98e1445b8d3165c68d6dc327382d2c2 /xmlsecurity/source/component
parent272c161cf24a7bab4920a05cd64f0194a91d148c (diff)
use internal SHA256Thumbprint api
Change-Id: I6a51359af58dbb79b6a0399944030dbcbe97152b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130963 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmlsecurity/source/component')
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 0dbf0877ad1e..990fa5dea739 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -19,9 +19,10 @@
#include <resourcemanager.hxx>
-#include <digitalsignaturesdialog.hxx>
+#include <certificate.hxx>
#include <certificatechooser.hxx>
#include <certificateviewer.hxx>
+#include <digitalsignaturesdialog.hxx>
#include <macrosecurity.hxx>
#include <biginteger.hxx>
#include <strings.hrc>
@@ -683,6 +684,12 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
if (!aSignatureManager.init())
return false;
uno::Reference<css::security::XCertificate> xCert = aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor.RawData);
+
+ auto pAuthor = dynamic_cast<xmlsecurity::Certificate*>(xAuthor.get());
+ auto pCert = dynamic_cast<xmlsecurity::Certificate*>(xCert.get());
+ if (pAuthor && pCert)
+ return pCert->getSHA256Thumbprint() == pAuthor->getSHA256Thumbprint();
+
return xCert->getSHA1Thumbprint() == xAuthor->getSHA1Thumbprint();
});
}