summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 0a4d9191f366..dfb81ab177ee 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -573,7 +573,6 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::getCertificate(
uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl::buildCertificatePath( const uno::Reference< XCertificate >& begin ) {
PCCERT_CHAIN_CONTEXT pChainContext ;
PCCERT_CONTEXT pCertContext ;
- const X509Certificate_MSCryptImpl* xcert ;
CERT_ENHKEY_USAGE enhKeyUsage ;
CERT_USAGE_MATCH certUsage ;
@@ -587,7 +586,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
chainPara.RequestedUsage = certUsage ;
uno::Reference< XUnoTunnel > xCertTunnel( begin, uno::UNO_QUERY_THROW ) ;
- xcert = reinterpret_cast<X509Certificate_MSCryptImpl*>(xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ));
+ const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel);
if( xcert == nullptr ) {
throw uno::RuntimeException() ;
}
@@ -755,8 +754,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
SAL_INFO("xmlsecurity.xmlsec", "Start verification of certificate: " << aCert->getSubjectName());
- auto xcert = reinterpret_cast<const X509Certificate_MSCryptImpl*>
- (xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ));
+ const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel);
if( xcert == nullptr ) {
throw uno::RuntimeException() ;
}
@@ -913,10 +911,9 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
sal_Int32 SecurityEnvironment_MSCryptImpl::getCertificateCharacters( const css::uno::Reference< css::security::XCertificate >& aCert ) {
sal_Int32 characters ;
PCCERT_CONTEXT pCertContext ;
- const X509Certificate_MSCryptImpl* xcert ;
uno::Reference< XUnoTunnel > xCertTunnel( aCert, uno::UNO_QUERY_THROW ) ;
- xcert = reinterpret_cast<X509Certificate_MSCryptImpl*>(xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ));
+ const auto* xcert = comphelper::getFromUnoTunnel<X509Certificate_MSCryptImpl>(xCertTunnel);
if( xcert == nullptr ) {
throw uno::RuntimeException() ;
}