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 -#include +#include #include #include +#include #include #include #include @@ -683,6 +684,12 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted( if (!aSignatureManager.init()) return false; uno::Reference xCert = aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor.RawData); + + auto pAuthor = dynamic_cast(xAuthor.get()); + auto pCert = dynamic_cast(xCert.get()); + if (pAuthor && pCert) + return pCert->getSHA256Thumbprint() == pAuthor->getSHA256Thumbprint(); + return xCert->getSHA1Thumbprint() == xAuthor->getSHA1Thumbprint(); }); }