diff options
author | Noel Grandin <noelgrandin@collabora.co.uk> | 2023-01-13 15:30:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 15:52:33 +0000 |
commit | 1fd4e669a99225459fc3b5bf082487c2644ce691 (patch) | |
tree | add1a73010ce2d67bb50aebf4dd5e99e51317efb | |
parent | 817dc69bb6c96f7494510cd45262aae677323a47 (diff) |
XUnoTunnel->dynamic_cast in X509Certificate_MSCryptImpl
Change-Id: If61114df98f4096798281a28ffcdf58168ff7fdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145475
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
3 files changed, 3 insertions, 15 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index cad73681efff..68b29fd2d3c7 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -584,8 +584,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl chainPara.cbSize = sizeof( CERT_CHAIN_PARA ) ; chainPara.RequestedUsage = certUsage ; - uno::Reference< XUnoTunnel > xCertTunnel( begin, uno::UNO_QUERY_THROW ) ; - const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel); + const auto* xcert = dynamic_cast<X509Certificate_MSCryptImpl*>(begin.get()); if( xcert == nullptr ) { throw uno::RuntimeException() ; } @@ -805,11 +804,9 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate( PCCERT_CHAIN_CONTEXT pChainContext = nullptr; PCCERT_CONTEXT pCertContext = nullptr; - uno::Reference< XUnoTunnel > xCertTunnel( aCert, uno::UNO_QUERY_THROW ) ; - SAL_INFO("xmlsecurity.xmlsec", "Start verification of certificate: " << aCert->getSubjectName()); - const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel); + const auto* xcert = dynamic_cast<X509Certificate_MSCryptImpl*>(aCert.get()); if( xcert == nullptr ) { throw uno::RuntimeException() ; } @@ -973,8 +970,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::getCertificateCharacters( const css:: sal_Int32 characters ; PCCERT_CONTEXT pCertContext ; - uno::Reference< XUnoTunnel > xCertTunnel( aCert, uno::UNO_QUERY_THROW ) ; - const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel); + const auto* xcert = dynamic_cast<X509Certificate_MSCryptImpl*>(aCert.get()); if( xcert == nullptr ) { throw uno::RuntimeException() ; } diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 88bf6169bf11..9c671d0c21c0 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -457,9 +457,6 @@ void X509Certificate_MSCryptImpl::setRawCert( Sequence< sal_Int8 > const & rawCe } } -/* XUnoTunnel */ -UNO3_GETIMPLEMENTATION_IMPL(X509Certificate_MSCryptImpl); - static OUString findOIDDescription(char const *oid) { OUString ouOID = OUString::createFromAscii( oid ); diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx index 9bd6a34ce68e..ba02281794f6 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx @@ -30,7 +30,6 @@ #include <cppuhelper/implbase.hxx> #include <comphelper/servicehelper.hxx> #include <com/sun/star/uno/Exception.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/SecurityException.hpp> #include <com/sun/star/security/CertificateKind.hpp> @@ -39,7 +38,6 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper< css::security::XCertificate , - css::lang::XUnoTunnel, css::lang::XServiceInfo > , public xmlsecurity::Certificate { private: @@ -72,9 +70,6 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper< virtual sal_Int32 SAL_CALL getCertificateUsage( ) override; - //Methods from XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(X509Certificate_MSCryptImpl) - /// @see xmlsecurity::Certificate::getSHA256Thumbprint(). virtual css::uno::Sequence<sal_Int8> getSHA256Thumbprint() override; |