From 7dd0b4c06d380637570e1edbefab5d40a246edf1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 13 Dec 2022 08:23:33 +0100 Subject: Use XUnoTunnel instead of dynamic_cast here too ...like in similar code introduced in the initial 88ac77c0bc21accfd6f5c404217c3c2aaef2d674 "gpg4libre: List and view GPG keys", but which was then apparently forgotten in this code later introduced in 06929219aeb0cb3550bf0cf8b5de7f1164c00a8d "gpg4libre: Show whether pgp keys are trusted or not". (See the upcoming commit introducing loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I6606d0fa0be515a45a190d2da7e16d5b712bfc4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144507 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- xmlsecurity/source/gpg/SecurityEnvironment.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlsecurity/source') diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx index dcddca194762..aff3b68c5ed8 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 = dynamic_cast(aCert.get()); + const CertificateImpl* xCert = comphelper::getFromUnoTunnel(aCert); if (xCert == nullptr) { // Can't find the key locally -> unknown owner return security::CertificateValidity::ISSUER_UNKNOWN; -- cgit