Fix problem, "password is not saved" 25/68225/1
authorkiso.chang <kiso.chang@samsung.com>
Tue, 3 May 2016 05:36:22 +0000 (14:36 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Tue, 3 May 2016 05:37:33 +0000 (14:37 +0900)
- apply auth-fw instead of secure-server

Change-Id: Icdd08cccff6cac28e57d1b168986bced3b6a7cd0
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
include/setting-debug.h
packaging/org.tizen.setting.spec
setting-locktype/CMakeLists.txt
setting-locktype/src/setting-locktype-main.c
setting-locktype/src/setting-locktype.c
setting-password/CMakeLists.txt
setting-password/src/setting-password.c

index c47979fb5e51c420471c89179febab1f05f96f55..25504721d0da2754ca5b9578e45a07e57fd43a1b 100644 (file)
@@ -45,6 +45,8 @@
 
 #define USE_TIMER_UPDATE_TIME_IN_TIME_VIEW
 
+#define SECURITY_SERVER                        1
+
 /* launching */
 #ifdef LAUNCHING_DEBUG_LOG
 #define LAUNCH_SETTING_IN(fmt, arg...) LOG(LOG_DEBUG, "LAUNCH", "[setting:Application:%s:IN]" fmt, __FUNCTION__, ##arg)
index f760a69433ad0e36685b5302a15f5aba54e3d9cd..296839f3e1bbe6172bcb61d13e8d978843bf755d 100755 (executable)
@@ -97,6 +97,7 @@ BuildRequires:  pkgconfig(notification)
 BuildRequires:  pkgconfig(callmgr_client)
 BuildRequires:  pkgconfig(privilege-info)
 #BuildRequires:        pkgconfig(capi-location-manager)
+BuildRequires:  pkgconfig(auth-fw)
 BuildRequires:  libcap-devel
 BuildRequires:  cmake
 BuildRequires:  edje-tools
index aa9ec8a75673e293a49db63d6c8ce74e71c214f3..eaf3089ffe735eccc3cd206528595fbbc218fa16 100755 (executable)
@@ -3,7 +3,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_locktype REQUIRED ecore evas elementary dlog efl-extension json-glib-1.0
-ui-gadget-1 capi-appfw-application appcore-common
+ui-gadget-1 capi-appfw-application appcore-common auth-fw
 deviced pkgmgr-info libtzplatform-config
 )
 
index 3a58ad8b671a6c75bcd8a3975bdfc6d83021d4e6..9cf935c2e48318195874ca3eced8faa68ce44d16 100644 (file)
@@ -30,6 +30,8 @@
 #include <ode.h>
 #endif
 
+#include <auth-passwd.h>
+
 #define TBD 0
 
 static int setting_locktype_main_create(void *cb);
@@ -574,7 +576,8 @@ setting_locktype_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj,
                if (old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD
                        || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
 #if SECURITY_SERVER
-                       int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                       //int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                       int result = auth_passwd_set_passwd(AUTH_PWD_NORMAL,ad->input_pwd, "0000");
                        SETTING_TRACE_DEBUG("set_pwd result : %d", result);
 #endif
 
@@ -634,7 +637,8 @@ setting_locktype_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj,
                if (old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD
                        || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
 #if SECURITY_SERVER
-                       int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                       //int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                       int result = auth_passwd_set_passwd(AUTH_PWD_NORMAL,ad->input_pwd, "0000");
                        SETTING_TRACE_DEBUG("set_pwd result : %d", result);
 #endif
 #if 0
@@ -683,7 +687,8 @@ setting_locktype_main_click_radio_cb(void *data, Evas_Object *obj, void *event_i
                if (old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD
                        || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
 #if SECURITY_SERVER
-                       int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+//                     int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                       int result = auth_passwd_set_passwd(AUTH_PWD_NORMAL,ad->input_pwd, "0000");
                        SETTING_TRACE_DEBUG("set_pwd result : %d", result);
 #endif
 #if 0
@@ -735,7 +740,8 @@ setting_locktype_main_click_radio_cb(void *data, Evas_Object *obj, void *event_i
                        if (old_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD
                                || old_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
 #if SECURITY_SERVER
-                               int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+//                             int result = security_server_set_pwd(ad->input_pwd, "0000", 0, 0);
+                               int result = auth_passwd_set_passwd(AUTH_PWD_NORMAL,ad->input_pwd, "0000");
                                SETTING_TRACE_DEBUG("set_pwd result : %d", result);
 #endif
 #if 0
index 14c9205bc0e3386c6efaad83000fc72705f9e517..b96d179083aa888e8fa97147eb89e305f809ee1e 100644 (file)
@@ -27,6 +27,8 @@
 #include <setting-locktype.h>
 #include <efl_extension.h>
 
+#include <auth-passwd.h>
+
 #define Max_Passwd_View_Type_Len       64
 #ifndef UG_MODULE_API
 #define UG_MODULE_API __attribute__ ((visibility("default")))
@@ -156,8 +158,9 @@ static void *setting_locktype_ug_on_create(ui_gadget_h ug,
                locktypeUG->viewtype = SETTING_LOCKTYPE_VIEWTYPE_RECOVERY;
                vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE);
 #if SECURITY_SERVER
-               int result = security_server_reset_pwd("0000", 0, 0);
-               SETTING_TRACE_DEBUG("reset_pwd result : %d", result);
+//             int result = security_server_reset_pwd("0000", 0, 0);
+//??           int result = auth_passwd_reset_passwd(AUTH_PWD_NORMAL,uid, "0000");
+//             SETTING_TRACE_DEBUG("reset_pwd result : %d", result);
 #endif
        } else {
                locktypeUG->viewtype = SETTING_LOCKTYPE_VIEWTYPE_MAIN;
index c42c88c1f8992d098db8ba17b52464b5a3d54efe..35669eec75dea5b826f5d9fa3ebabb1f1db94dbe 100755 (executable)
@@ -7,7 +7,7 @@ INCLUDE(FindPkgConfig)
 
 pkg_check_modules(pkgs_password REQUIRED evas ecore edje elementary appcore-common
 appcore-efl deviced ecore-imf
-ui-gadget-1 capi-appfw-application tapi dlog
+ui-gadget-1 capi-appfw-application tapi dlog  auth-fw
 notification json-glib-1.0
 libtzplatform-config)
 
index 0e89987e69b4f5d216b75f2b2af3ea833cbb506e..82be36a40dcdd22d695b215d8dfdb30526dd3faf 100644 (file)
@@ -21,6 +21,8 @@
 #include <setting-password.h>
 #include <setting-password-main.h>
 
+#include <auth-passwd.h>
+
 extern void setting_get_pin_lock_info_cb(TapiHandle *handle, int result, void *data, void *user_data);
 
 #ifndef UG_MODULE_API
@@ -63,11 +65,11 @@ void __chk_cur_pw_status(SettingPasswordUG *ad, app_control_h service)
        ad->pw_status = SETTING_PW_STATUS_DEFAULT;
 
 #if SECURITY_SERVER
-       ret = security_server_is_pwd_valid(&attempt, &max_attempt, &expire_sec);
+       ret = auth_passwd_check_passwd_state(AUTH_PWD_NORMAL,&attempt, &max_attempt, &expire_sec);
        SETTING_TRACE_DEBUG("status of password : %d (cur attempt %d, max %d, expire %d", ret, attempt, max_attempt, expire_sec);
 
-       if (ret == SECURITY_SERVER_API_ERROR_NO_PASSWORD) {
-               SETTING_TRACE("security-server has no password!");
+       if (ret == AUTH_PASSWD_API_ERROR_NO_PASSWORD) {
+               SETTING_TRACE("auth fw has no password!");
                ad->pw_status = SETTING_PW_STATUS_EMPTY;
        }
 #endif
@@ -652,7 +654,7 @@ int setting_password_check_password(const char *challenge, unsigned int *remain_
        SETTING_TRACE_DEBUG("check pwd : %s", challenge);
 
 #if SECURITY_SERVER
-       inner_ret = security_server_chk_pwd(challenge, &current_attempt, &max_attempt, &valid_secs);
+       inner_ret = auth_passwd_check_passwd(AUTH_PWD_NORMAL,challenge, &current_attempt, &max_attempt, &valid_secs);
 
        SETTING_TRACE_DEBUG("chk password : %d", inner_ret);
        SETTING_TRACE_SECURE_DEBUG("current_attempt : %d, max_attempt : %d, valid_secs : %d secs", current_attempt, max_attempt, valid_secs);
@@ -660,7 +662,7 @@ int setting_password_check_password(const char *challenge, unsigned int *remain_
        if (valid_sec != NULL)
                *valid_sec = valid_secs;
 
-       if (inner_ret == SECURITY_SERVER_API_SUCCESS) {
+       if (inner_ret == AUTH_PASSWD_API_SUCCESS) {
                ret = SETTING_RETURN_SUCCESS;
        } else {
                if (remain_attempt != NULL) {
@@ -688,9 +690,9 @@ int setting_password_set_password(const char *cur_pwd, const char *new_pwd, void
 
        /* max attempt count will be handled in passwordug for a while. */
        if (ad->pw_status == SETTING_PW_STATUS_EMPTY) {
-               ret = security_server_set_pwd(NULL, new_pwd, 0, 0);
-               SETTING_TRACE_DEBUG("[security_server_set_pwd() + empty current] returns %d, INFINITE", ret);
-               if (ret == SECURITY_SERVER_API_SUCCESS) {
+               ret = auth_passwd_set_passwd(AUTH_PWD_NORMAL,NULL, new_pwd);
+               SETTING_TRACE_DEBUG("[auth_passwd_set_passwd() + empty current] returns %d, INFINITE", ret);
+               if (ret == AUTH_PASSWD_API_SUCCESS) {
 #if 0
                        /* To support key manager */
                        uid_t user = 5000;
@@ -706,9 +708,9 @@ int setting_password_set_password(const char *cur_pwd, const char *new_pwd, void
 
        }
 
-       ret = security_server_set_pwd(cur_pwd, new_pwd, 0, 0);
-       SETTING_TRACE_DEBUG("[security_server_set_pwd()] returns %d, INFINITE", ret);
-       if (ret == SECURITY_SERVER_API_SUCCESS) {
+       ret = auth_passwd_set_passwd(AUTH_PWD_NORMAL,cur_pwd, new_pwd);
+       SETTING_TRACE_DEBUG("[auth_passwd_set_passwd()] returns %d, INFINITE", ret);
+       if (ret == AUTH_PASSWD_API_SUCCESS) {
 #if 0
                ckmc_ret = ckmc_change_user_password(user, cur_pwd, new_pwd);
                SETTING_TRACE("ckmc_change_user_password() returns %d", ckmc_ret);