#include "ocsp_service_callbacks.h"
#include <callback_api.h>
+#include <dpl/log/log.h>
namespace RPC {
void OcspServiceCallbacks::checkAccess(SocketConnection * connector){
int response = 0;
Try {
+ int handle;
+ connector->read(&handle);
+ LogDebug("handle : " << handle);
connector->write(response);
} Catch (SocketConnection::Exception::SocketConnectionException){
LogError("Socket Connection write error");
static WrtSecurity::Communication::Client *communicationClient = NULL;
wrt_ocsp_return_t wrt_ocsp_initialize(void){
+#ifdef __SUPPORT_OCSP__
if (NULL != communicationClient) {
LogError("wrt_ocsp_api already initialized");
return WRT_OCSP_INTERNAL_ERROR;
LogError("Can't connect to daemon");
return WRT_OCSP_INTERNAL_ERROR;
}
+#endif
LogInfo("Initialized");
return WRT_OCSP_OK;
}
wrt_ocsp_return_t wrt_ocsp_shutdown(void){
+#ifdef __SUPPORT_OCSP__
if (NULL == communicationClient) {
LogError("wrt_ocsp_api not initialized");
return WRT_OCSP_INTERNAL_ERROR;
}
delete communicationClient;
communicationClient = NULL;
+#endif
LogInfo("Shutdown");
return WRT_OCSP_OK;
}
}
int intResponse;
- Try {
+#ifdef __SUPPORT_OCSP__
+ Try {
communicationClient->call(WrtSecurity::OcspServerApi::CHECK_ACCESS_METHOD(),
handle,
&intResponse);
} Catch (WrtSecurity::Communication::Client::Exception::SecurityCommunicationClientException) {
LogError("Problem with connection to daemon");
return WRT_OCSP_INTERNAL_ERROR;
- }
+ }
+#endif
+ intResponse = 0;
(*status) = static_cast<wrt_ocsp_widget_verification_status_t>(intResponse);
LogInfo("Widget verified with response " << intResponse);
return WRT_OCSP_OK;