Modified key-manager symbol 88/48588/2 accepted/tizen/mobile/20150925.012717 accepted/tizen/tv/20150925.012736 accepted/tizen/wearable/20150925.012742 submit/tizen/20150924.075520 tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 23 Sep 2015 08:52:20 +0000 (17:52 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 23 Sep 2015 08:55:08 +0000 (17:55 +0900)
Change-Id: Iadcff3d5abbe78570705667ada408e2f73962937
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/mobileap-agent.spec
src/mobileap_wifi.c

index 2d593f9..7a6889a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mobileap-agent
 Summary:    Mobile AP daemon for setting tethering environments
-Version:    0.1.91
+Version:    0.1.92
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Flora License
index cd8f463..f2fcbee 100644 (file)
@@ -33,7 +33,7 @@
 #include "mobileap_handler.h"
 #include "mobileap_notification.h"
 
-#define TETHERING_WIFI_PASSPHRASE_STORE_ALIAS "/ tethering_wifi_passphrase"
+#define TETHERING_WIFI_PASSPHRASE_STORE_KEY "tethering_wifi_passphrase"
 
 static int __generate_initial_passphrase(char *passphrase_buf);
 static mobile_ap_error_code_e __get_hide_mode(int *hide_mode);
@@ -167,6 +167,20 @@ static mobile_ap_error_code_e __set_security_type(const char *security_type)
        return MOBILE_AP_ERROR_NONE;
 }
 
+static char *__add_shared_owner_prefix(const char *name)
+{
+       char *ckm_alias = NULL;
+
+        if (name == NULL) {
+                ERR("Invalid parameter\n");
+                return MOBILE_AP_ERROR_INVALID_PARAM;
+        }
+
+        ckm_alias = g_strconcat(ckmc_owner_id_system, ckmc_owner_id_separator, name, NULL);
+
+        return ckm_alias;
+}
+
 static mobile_ap_error_code_e __get_passphrase(char *passphrase,
                unsigned int size, unsigned int *passphrase_len)
 {
@@ -178,8 +192,9 @@ static mobile_ap_error_code_e __get_passphrase(char *passphrase,
        int ret = 0;
        char *password = NULL;
        ckmc_raw_buffer_s *ckmc_buf;
+       char *alias = __add_shared_owner_prefix(TETHERING_WIFI_PASSPHRASE_STORE_KEY);
 
-       ret = ckmc_get_data(TETHERING_WIFI_PASSPHRASE_STORE_ALIAS, password, &ckmc_buf);
+       ret = ckmc_get_data(alias, password, &ckmc_buf);
        if (ret != CKMC_ERROR_NONE) {
                ERR("Fail to get passphrase from key manager : %d\n", ret);
                return MOBILE_AP_ERROR_RESOURCE;
@@ -204,6 +219,7 @@ static mobile_ap_error_code_e __set_passphrase(const char *passphrase, const uns
        }
 
        int ret = 0;
+       char *alias = __add_shared_owner_prefix(TETHERING_WIFI_PASSPHRASE_STORE_KEY);
        ckmc_raw_buffer_s ckmc_buf;
        ckmc_policy_s ckmc_policy;
 
@@ -213,7 +229,7 @@ static mobile_ap_error_code_e __set_passphrase(const char *passphrase, const uns
        ckmc_buf.data = (unsigned char *) passphrase;
        ckmc_buf.size = strlen(passphrase);
 
-       ret = ckmc_save_data(TETHERING_WIFI_PASSPHRASE_STORE_ALIAS, ckmc_buf, ckmc_policy);
+       ret = ckmc_save_data(alias, ckmc_buf, ckmc_policy);
        if (ret != CKMC_ERROR_NONE) {
                ERR("Fail to save the passphrase : %d\n", ret);
                return MOBILE_AP_ERROR_RESOURCE;