Block OSCP operations
authorHyunwoo Kim <hwlove.kim@samsung.com>
Fri, 19 Apr 2013 10:49:03 +0000 (19:49 +0900)
committerHyunwoo Kim <hwlove.kim@samsung.com>
Fri, 19 Apr 2013 10:49:08 +0000 (19:49 +0900)
Change-Id: I9be805880feb29aeb1478a70ff21678e797f7a3f
Signed-off-by: Hyunwoo Kim <hwlove.kim@samsung.com>
src/services/ocsp/socket/ocsp_service_callbacks.cpp
wrt_ocsp/src/wrt_ocsp_api.cpp

index 8ff588a..53811b5 100644 (file)
 
 #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");
index 5ab9f85..8c1dd1a 100644 (file)
@@ -30,6 +30,7 @@
 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;
@@ -41,17 +42,20 @@ wrt_ocsp_return_t wrt_ocsp_initialize(void){
         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;
 }
@@ -66,14 +70,17 @@ wrt_ocsp_return_t wrt_ocsp_verify_widget(wrt_ocsp_widget_handle_t handle,
     }
     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;