summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-13 09:16:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-14 09:30:58 +0000
commit97db783599148e7829a898f7e46764e777500ecc (patch)
tree2f564a867b10af51568ff6a2b4827b8a44f1ff01 /xmlsecurity
parent1af58b5acec4a2de095d86feef05ac4aed3edb8f (diff)
XUnoTunnel->dynamic_cast in SecurityEnvironment_NssImpl
Change-Id: I65b109f8f45c57633ca3983bacf496a65ea02ea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx13
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx9
-rw-r--r--xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx3
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx6
4 files changed, 4 insertions, 27 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 2add74631001..b12a3356d18c 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -151,19 +151,6 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl::getSupportedServiceNa
return seqServiceNames;
}
-/* XUnoTunnel */
-sal_Int64 SAL_CALL SecurityEnvironment_NssImpl::getSomething( const Sequence< sal_Int8 >& aIdentifier )
-{
- return comphelper::getSomethingImpl(aIdentifier, this);
-}
-
-/* XUnoTunnel extension */
-
-const Sequence< sal_Int8>& SecurityEnvironment_NssImpl::getUnoTunnelId() {
- static const comphelper::UnoIdInit theSecurityEnvironment_NssImplUnoTunnelId;
- return theSecurityEnvironment_NssImplUnoTunnelId.getSeq();
-}
-
OUString SecurityEnvironment_NssImpl::getSecurityEnvironmentInformation()
{
OUStringBuffer buff;
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
index 12310372096d..253d3ea1f4e3 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
@@ -29,7 +29,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/xml/crypto/XCertificateCreator.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <mutex>
@@ -47,8 +46,7 @@ class X509Certificate_NssImpl;
class SecurityEnvironment_NssImpl : public ::cppu::WeakImplHelper<
css::xml::crypto::XSecurityEnvironment,
css::xml::crypto::XCertificateCreator,
- css::lang::XServiceInfo,
- css::lang::XUnoTunnel >
+ css::lang::XServiceInfo >
{
private:
@@ -87,11 +85,6 @@ private:
virtual OUString SAL_CALL getSecurityEnvironmentInformation( ) override;
- //Methods from XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
-
- static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
-
/// @throws css::uno::Exception
/// @throws css::uno::RuntimeException
void setCertDb( CERTCertDBHandle* aCertDb ) ;
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
index 6ada0522bcd9..74c80afe1a82 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
@@ -58,8 +58,7 @@ uno::Reference< css::xml::crypto::XXMLSecurityContext > SAL_CALL
uno::Reference< css::xml::crypto::XXMLSecurityContext > xSecCtx = css::xml::crypto::XMLSecurityContext::create( m_xContext );
uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = css::xml::crypto::SecurityEnvironment::create( m_xContext );
- uno::Reference< lang::XUnoTunnel > xSecEnvTunnel(xSecEnv, uno::UNO_QUERY_THROW);
- SecurityEnvironment_NssImpl* pSecEnv = comphelper::getFromUnoTunnel<SecurityEnvironment_NssImpl>(xSecEnvTunnel);
+ SecurityEnvironment_NssImpl* pSecEnv = dynamic_cast<SecurityEnvironment_NssImpl*>(xSecEnv.get());
pSecEnv->setCertDb(pCertHandle);
sal_Int32 n = xSecCtx->addSecurityEnvironment(xSecEnv);
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index 94e84a71b5d8..9b79b79b245b 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -128,11 +128,10 @@ SAL_CALL XMLSignature_NssImpl::generate(
}
//Get Keys Manager
- Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY_THROW ) ;
// the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext
SecurityEnvironment_NssImpl* pSecEnv
- = comphelper::getFromUnoTunnel<SecurityEnvironment_NssImpl>(xSecTunnel);
+ = dynamic_cast<SecurityEnvironment_NssImpl*>(aEnvironment.get());
if( pSecEnv == nullptr )
throw RuntimeException() ;
@@ -219,9 +218,8 @@ SAL_CALL XMLSignature_NssImpl::validate(
Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i);
//Get Keys Manager
- Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY_THROW ) ;
SecurityEnvironment_NssImpl* pSecEnv
- = comphelper::getFromUnoTunnel<SecurityEnvironment_NssImpl>(xSecTunnel);
+ = dynamic_cast<SecurityEnvironment_NssImpl*>(aEnvironment.get());
if( pSecEnv == nullptr )
throw RuntimeException() ;