xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5c7accf3e1d7bd550611af42d2eea07e590fde2f
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Dec 13 09:15:33 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Dec 20 06:49:46 2022 +0000

    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 <sberg...@redhat.com>

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)

Reply via email to