summaryrefslogtreecommitdiff
path: root/srcs/key_manager.c
diff options
context:
space:
mode:
authorKyungwook Tak <k.tak@samsung.com>2016-12-09 11:30:58 +0900
committerKyungwook Tak <k.tak@samsung.com>2016-12-09 11:30:58 +0900
commit3898acb11d7a788f8233620fdf9e6f774a89e2c6 (patch)
tree9594136c8f46a4569a9409f99f6dd383b26cb4bd /srcs/key_manager.c
parent1fcac8945420537f89d24a0e8e52ec99cc432674 (diff)
parent9fddab9e58ccd9acdecdbfcf12770c50feac4d2b (diff)
downloadlibwebappenc-accepted/tizen/3.0.m2/tv/20170104.142125.tar.gz
libwebappenc-accepted/tizen/3.0.m2/tv/20170104.142125.tar.bz2
libwebappenc-accepted/tizen/3.0.m2/tv/20170104.142125.zip
Change-Id: Ic6865eb0a587c50af8b81e929eb007f57c2bd1d0 Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Diffstat (limited to 'srcs/key_manager.c')
-rw-r--r--srcs/key_manager.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/srcs/key_manager.c b/srcs/key_manager.c
index aeee748..ac42db2 100644
--- a/srcs/key_manager.c
+++ b/srcs/key_manager.c
@@ -32,7 +32,6 @@
#define MAX_ALIAS_LEN 256
#define APP_DEK_ALIAS_PFX "APP_DEK_"
-#define APP_DEK_LOADING_DONE_ALIAS "APP_DEKS_LOADING_FINISHED"
#define APP_DEK_KEK_ALIAS "WAE_APP_DEK_KEK"
static int _to_wae_error(int key_manager_error)
@@ -203,66 +202,6 @@ static void _get_alias(const char *name, UNUSED wae_app_type_e type, UNUSED bool
name);
}
-static void _get_dek_loading_done_alias(char *alias, size_t buff_len)
-{
- snprintf(alias, buff_len, "%s%s%s",
- ckmc_owner_id_system,
- ckmc_owner_id_separator,
- APP_DEK_LOADING_DONE_ALIAS);
-}
-
-bool is_app_deks_loaded_in_key_manager()
-{
- char alias[MAX_ALIAS_LEN] = {0, };
-
- _get_dek_loading_done_alias(alias, sizeof(alias));
-
- ckmc_raw_buffer_s *buf = NULL;
- int ret = _to_wae_error(ckmc_get_data(alias, NULL, &buf));
-
- ckmc_buffer_free(buf);
-
- switch (ret) {
- case WAE_ERROR_NONE:
- return true;
- case WAE_ERROR_NO_KEY:
- WAE_SLOGI("app dek loading isn't done yet");
- return false;
- default:
- WAE_SLOGE("Failed to get dek loading flag data from key-manager. ret(%d)", ret);
- return false;
- }
-}
-
-int set_app_deks_loaded_to_key_manager()
-{
- unsigned char dummy_data[1] = {0};
- ckmc_raw_buffer_s buf;
- buf.data = dummy_data;
- buf.size = sizeof(dummy_data);
-
- ckmc_policy_s policy;
- policy.password = NULL;
- policy.extractable = true;
-
- char alias[MAX_ALIAS_LEN] = {0, };
- _get_dek_loading_done_alias(alias, sizeof(alias));
-
- int ret = _to_wae_error(ckmc_save_data(alias, buf, policy));
- if (ret == WAE_ERROR_KEY_EXISTS)
- ret = WAE_ERROR_NONE;
-
- return ret;
-}
-
-int clear_app_deks_loaded_from_key_manager()
-{
- char alias[MAX_ALIAS_LEN] = {0, };
- _get_dek_loading_done_alias(alias, sizeof(alias));
-
- return _to_wae_error(ckmc_remove_alias(alias));
-}
-
int save_to_key_manager(const char *name, const char *pkg_id, wae_app_type_e type,
const crypto_element_s *ce)
{