xmlsecurity/source/gpg/SecurityEnvironment.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7dd0b4c06d380637570e1edbefab5d40a246edf1
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Dec 13 08:23:33 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Dec 19 19:28:12 2022 +0000

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

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<CertificateImpl*>(aCert.get());
+    const CertificateImpl* xCert = 
comphelper::getFromUnoTunnel<CertificateImpl>(aCert);
     if (xCert == nullptr) {
          // Can't find the key locally -> unknown owner
         return security::CertificateValidity::ISSUER_UNKNOWN;

Reply via email to