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>
This commit is contained in:
Caolán McNamara 2022-03-04 10:31:46 +00:00 committed by Miklos Vajna
parent 272c161cf2
commit f30bc3ccdf

View File

@ -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();
});
}