From 5c7accf3e1d7bd550611af42d2eea07e590fde2f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 13 Dec 2022 09:15:33 +0100 Subject: Use XUnoTunnel instead of dynamic_cast here too ...like in other code accessing X509Certificate_NssImpl. (See the upcoming commit introducing loplugin:unocast on why such dynamic_casts from UNO types are dangerous. Change-Id: I65c8380ef0c3ab34a41142639e0e6fbfb4154b27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144510 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 8872dd96b05a..d130c03723e9 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -813,7 +813,8 @@ xmlSecKeysMngrPtr SecurityEnvironment_NssImpl::createKeysManager() { throw RuntimeException(); // Adopt the private key of the signing certificate, if it has any. - if (auto pCertificate = dynamic_cast(m_xSigningCertificate.get())) + if (auto pCertificate + = comphelper::getFromUnoTunnel(m_xSigningCertificate)) { SECKEYPrivateKey* pPrivateKey = SECKEY_CopyPrivateKey(pCertificate->getPrivateKey()); if (pPrivateKey) -- cgit