diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 09:20:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-14 17:24:33 +0000 |
commit | 7666648ab2f420caafa6739cc5bb41d5cc04bf91 (patch) | |
tree | 25bbf34e5ba1efb3a6499cbc52bc87f72e6fc7d7 /xmlsecurity/source | |
parent | 47ff51eabb58c7aca82968dc31c0ca54e3da2661 (diff) |
XUnoTunnel->dynamic_cast in CertificateImpl
Change-Id: I31c03fd894691681401e2ea104ba0d45c95a3c3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145502
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/gpg/CertificateImpl.cxx | 13 | ||||
-rw-r--r-- | xmlsecurity/source/gpg/CertificateImpl.hxx | 7 | ||||
-rw-r--r-- | xmlsecurity/source/gpg/SecurityEnvironment.cxx | 4 |
3 files changed, 2 insertions, 22 deletions
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index a0a08fc807a8..b771c1282fa0 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -193,19 +193,6 @@ sal_Int32 SAL_CALL CertificateImpl::getCertificateUsage() return KeyUsage::DIGITAL_SIGNATURE | KeyUsage::NON_REPUDIATION | KeyUsage::KEY_ENCIPHERMENT | KeyUsage::DATA_ENCIPHERMENT; } -/* XUnoTunnel */ -sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -/* XUnoTunnel extension */ - -const Sequence< sal_Int8>& CertificateImpl::getUnoTunnelId() { - static const comphelper::UnoIdInit theCertificateImplUnoTunnelId; - return theCertificateImplUnoTunnelId.getSeq(); -} - void CertificateImpl::setCertificate(GpgME::Context* ctx, const GpgME::Key& key) { m_pKey = key; diff --git a/xmlsecurity/source/gpg/CertificateImpl.hxx b/xmlsecurity/source/gpg/CertificateImpl.hxx index b6c50cb2ed5c..b0856ca0109f 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.hxx +++ b/xmlsecurity/source/gpg/CertificateImpl.hxx @@ -18,7 +18,6 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/security/CertificateKind.hpp> #include <com/sun/star/security/XCertificate.hpp> @@ -32,7 +31,6 @@ #endif class CertificateImpl : public cppu::WeakImplHelper< css::security::XCertificate, - css::lang::XUnoTunnel, css::lang::XServiceInfo >, public xmlsecurity::Certificate { @@ -76,11 +74,6 @@ public: virtual sal_Int32 SAL_CALL getCertificateUsage() 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(); - /// @see xmlsecurity::Certificate::getSHA256Thumbprint(). virtual css::uno::Sequence<sal_Int8> getSHA256Thumbprint() override; /// @see xmlsecurity::Certificate::getSignatureMethodAlgorithm(). diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx index aff3b68c5ed8..38d0563b161e 100644 --- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx +++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx @@ -203,7 +203,7 @@ Reference< XCertificate > SecurityEnvironmentGpg::createCertificateFromAscii( co sal_Int32 SecurityEnvironmentGpg::verifyCertificate( const Reference< XCertificate >& aCert, const Sequence< Reference< XCertificate > >& /*intermediateCerts*/ ) { - const CertificateImpl* xCert = comphelper::getFromUnoTunnel<CertificateImpl>(aCert); + const CertificateImpl* xCert = dynamic_cast<CertificateImpl*>(aCert.get()); if (xCert == nullptr) { // Can't find the key locally -> unknown owner return security::CertificateValidity::ISSUER_UNKNOWN; @@ -223,7 +223,7 @@ sal_Int32 SecurityEnvironmentGpg::verifyCertificate( const Reference< XCertifica sal_Int32 SecurityEnvironmentGpg::getCertificateCharacters( const Reference< XCertificate >& aCert) { - if (comphelper::getFromUnoTunnel<CertificateImpl>(aCert) == nullptr) + if (dynamic_cast<CertificateImpl*>(aCert.get()) == nullptr) throw RuntimeException(); // we only listed private keys anyway, up in |