diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 09:15:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-20 06:49:46 +0000 |
commit | 5c7accf3e1d7bd550611af42d2eea07e590fde2f (patch) | |
tree | ddf4a080765fe3a30b24c95e89ac740462595d06 /xmlsecurity | |
parent | 241cd824fdd4bf02f393633c1e19d24f2f35f1c0 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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<X509Certificate_NssImpl*>(m_xSigningCertificate.get())) + if (auto pCertificate + = comphelper::getFromUnoTunnel<X509Certificate_NssImpl>(m_xSigningCertificate)) { SECKEYPrivateKey* pPrivateKey = SECKEY_CopyPrivateKey(pCertificate->getPrivateKey()); if (pPrivateKey) |