From: Mu-Woong Date: Thu, 11 Jun 2015 11:25:32 +0000 (+0900) Subject: Remove dependency to security-server. X-Git-Tag: accepted/tizen/mobile/20150612.070111~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2437eba8a7bb771d5e4f76b8fa26523d7152999;p=platform%2Fcore%2Fcontext%2Fcontext-common.git Remove dependency to security-server. Change-Id: Id548575e5f2ee14a6e7276f222a6b7b9cdd82a3e Signed-off-by: Mu-Woong --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3757f59..ba13fc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ FILE(GLOB_RECURSE SRCS src/*.cpp) MESSAGE("Sources: ${SRCS}") # Dependencies -SET(DEPS "glib-2.0 gio-2.0 json-glib-1.0 dlog capi-base-common security-server") +SET(DEPS "glib-2.0 gio-2.0 json-glib-1.0 dlog capi-base-common") INCLUDE(FindPkgConfig) INCLUDE_DIRECTORIES( diff --git a/packaging/context-common.spec b/packaging/context-common.spec index 277ad0e..3fa053f 100644 --- a/packaging/context-common.spec +++ b/packaging/context-common.spec @@ -12,7 +12,6 @@ BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(capi-base-common) -BuildRequires: pkgconfig(security-server) %description Context-Service Shared Library diff --git a/src/dbus_client.cpp b/src/dbus_client.cpp index 3e63abf..9367cf5 100644 --- a/src/dbus_client.cpp +++ b/src/dbus_client.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -38,29 +37,6 @@ static const gchar introspection_xml[] = " " ""; -static const char* get_security_cookie() -{ - static char *cookie = NULL; - static GMutex cookie_mutex; - ctx::scope_mutex sm(&cookie_mutex); - - if (cookie == NULL) { - int raw_size = security_server_get_cookie_size(); - IF_FAIL_RETURN_TAG(raw_size > 0, NULL, _E, "Invalid cookie size"); - - int ret; - char raw_cookie[raw_size]; - - ret = security_server_request_cookie(raw_cookie, raw_size); - IF_FAIL_RETURN_TAG(ret >= 0, NULL, _E, "Failed to get the security cookie"); - - cookie = g_base64_encode(reinterpret_cast(raw_cookie), raw_size); - IF_FAIL_RETURN_TAG(cookie, NULL, _E, "Failed to encode the cookie"); - } - - return cookie; -} - static void handle_response(const gchar *sender, GVariant *param, GDBusMethodInvocation *invocation) { gint req_id = 0; @@ -170,10 +146,9 @@ int ctx::dbus_client::request( input = EMPTY_JSON_OBJECT; } - const char *cookie = get_security_cookie(); - IF_FAIL_RETURN_TAG(cookie, ERR_OPERATION_FAILED, _E, "Cookie generation failed"); - - GVariant *param = g_variant_new("(isiss)", type, cookie, req_id, subject, input); + /* FIXME: the second param is the security cookie, which is deprected in 3.0. + * We need to completely REMOVE this parameter from the dbus protocol. */ + GVariant *param = g_variant_new("(isiss)", type, "", req_id, subject, input); IF_FAIL_RETURN_TAG(param, ERR_OUT_OF_MEMORY, _E, "Memory allocation failed"); GError *err = NULL; @@ -212,10 +187,9 @@ int ctx::dbus_client::request_with_no_reply( input = EMPTY_JSON_OBJECT; } - const char *cookie = get_security_cookie(); - IF_FAIL_RETURN_TAG(cookie, ERR_OPERATION_FAILED, _E, "Cookie generation failed"); - - GVariant *param = g_variant_new("(isiss)", type, cookie, req_id, subject, input); + /* FIXME: the second param is the security cookie, which is deprected in 3.0. + * We need to completely REMOVE this parameter from the dbus protocol. */ + GVariant *param = g_variant_new("(isiss)", type, "", req_id, subject, input); IF_FAIL_RETURN_TAG(param, ERR_OUT_OF_MEMORY, _E, "Memory allocation failed"); GError *err = NULL;