diff options
author | Kidong Kim <kd0228.kim@samsung.com> | 2012-08-22 13:44:01 +0900 |
---|---|---|
committer | Kidong Kim <kd0228.kim@samsung.com> | 2012-08-22 13:44:01 +0900 |
commit | 6cf8de4970660cd0ae40fa00fe49c36cb75aa2ef (patch) | |
tree | 2dd889f701d2671bdbb51c3768efaa4e8fc2103a /server/src/ss_server_ipc.c | |
parent | 703f4f8dd9069e4436e848688e50c79de14d03ac (diff) | |
download | secure-storage-6cf8de4970660cd0ae40fa00fe49c36cb75aa2ef.tar.gz secure-storage-6cf8de4970660cd0ae40fa00fe49c36cb75aa2ef.tar.bz2 secure-storage-6cf8de4970660cd0ae40fa00fe49c36cb75aa2ef.zip |
source code open - secure-storageHEADsubmit/master/20120920.1511082.0_alphamaster2.0alpha
Diffstat (limited to 'server/src/ss_server_ipc.c')
-rw-r--r-- | server/src/ss_server_ipc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/server/src/ss_server_ipc.c b/server/src/ss_server_ipc.c index 95112dd..e1de270 100644 --- a/server/src/ss_server_ipc.c +++ b/server/src/ss_server_ipc.c @@ -1,7 +1,7 @@ /* * secure storage * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd All Rights Reserved * * Contact: Kidong Kim <kd0228.kim@samsung.com> * @@ -119,9 +119,11 @@ int make_key_file() int random_dev = -1; int i = 0; char tmp_key[1]; - char key[16] = {0, }; + char key[33]; char* key_path = NULL; + memset(key, 0x00, 33); + key_path = get_key_file_path(); if(key_path == NULL) { @@ -136,16 +138,16 @@ int make_key_file() return 0; } - while(i < 16) + while(i < 32) { read(random_dev, tmp_key, 1); - if((tmp_key[0] < '!') || (tmp_key[0] > '~')) - continue; - - key[i] = tmp_key[0]; - i++; + if((tmp_key[0] >= '!') && (tmp_key[0] <= '~')) { + key[i] = tmp_key[0]; + i++; + } } +SLOGI("key = [%s], [%d]\n", key, strlen(key)); if(!(fp_key = fopen(key_path, "w"))) { |