From ecba128020572966a161899083b7147e2adc5766 Mon Sep 17 00:00:00 2001 From: Giuseppe Castagno Date: Fri, 5 Aug 2016 17:44:25 +0200 Subject: Fix certificate validation interaction This enables the certificate validation when StillReadWriteInteraction::StillReadWriteInteraction interaction handler is used. Certificate validation is needed for Web/WebDAV files. Change-Id: I38cba9fc8b586953477d7df02acfcc8347603220 Reviewed-on: https://gerrit.libreoffice.org/27914 Tested-by: Jenkins Reviewed-by: Giuseppe Castagno --- comphelper/source/misc/stillreadwriteinteraction.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'comphelper/source') diff --git a/comphelper/source/misc/stillreadwriteinteraction.cxx b/comphelper/source/misc/stillreadwriteinteraction.cxx index 8b80d5c5f791..f4fdf76c3ae5 100644 --- a/comphelper/source/misc/stillreadwriteinteraction.cxx +++ b/comphelper/source/misc/stillreadwriteinteraction.cxx @@ -29,14 +29,16 @@ #include +#include + namespace comphelper{ StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler, - const css::uno::Reference< css::task::XInteractionHandler >& xAuthenticationHandler) + const css::uno::Reference< css::task::XInteractionHandler >& xAuxiliaryHandler) : m_bUsed (false) , m_bHandledByMySelf (false) , m_bHandledByInternalHandler(false) - , m_xAuthenticationHandler(xAuthenticationHandler) + , m_xAuxiliaryHandler(xAuxiliaryHandler) { ::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions; ::ucbhelper::InterceptedInteraction::InterceptedRequest aInterceptedRequest; @@ -56,6 +58,11 @@ StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< aInterceptedRequest.Continuation = cppu::UnoType::get(); lInterceptions.push_back(aInterceptedRequest); + aInterceptedRequest.Handle = HANDLE_CERTIFICATEVALIDATIONREQUESTEXCEPTION; + aInterceptedRequest.Request <<= css::ucb::CertificateValidationRequest(); + aInterceptedRequest.Continuation = cppu::UnoType::get(); + lInterceptions.push_back(aInterceptedRequest); + setInterceptedHandler(xHandler); setInterceptions(lInterceptions); } @@ -105,12 +112,13 @@ ucbhelper::InterceptedInteraction::EInterceptionState StillReadWriteInteraction: bAbort = true; } break; + case HANDLE_CERTIFICATEVALIDATIONREQUESTEXCEPTION: case HANDLE_AUTHENTICATIONREQUESTEXCEPTION: { -//use internal authentication dedicated handler and return - if (m_xAuthenticationHandler.is()) +//use internal auxiliary handler and return + if (m_xAuxiliaryHandler.is()) { - m_xAuthenticationHandler->handle(xRequest); + m_xAuxiliaryHandler->handle(xRequest); return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED; } else //simply abort -- cgit