[UTC][key-manager][Non-ACR]Remove unnecessary failing code 54/323454/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 28 Apr 2025 13:26:09 +0000 (15:26 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 28 Apr 2025 14:35:49 +0000 (16:35 +0200)
Change-Id: I6e179f866cc806da9a76b27efae68b390ab311ce

src/utc/key-manager/utc-key-manager-type.c

index 63ca2fd01b493a9adb436ae209704a198f956726..ce4fb457a6fbfba67a2fe4a5679286d699e87de1 100755 (executable)
@@ -156,30 +156,6 @@ static const char *TEST_LEAF_CERT =
     "-----END CERTIFICATE-----";
 
 
-static char *file1 = "ckm_test_cert";
-static char *file2 = "ckm_test_cert_2";
-static char *path1 = NULL;
-static char *path2 = NULL;
-
-
-static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
-{
-    if(type == STORAGE_TYPE_INTERNAL)
-    {
-    size_t length = strlen(path) + strlen(file1) + 2;
-        path1 = (char*)malloc(length);
-        memset(path1, 0x00, length);
-        snprintf(path1, length, "%s/%s", path, file1);
-    length = strlen(path) + strlen(file2) + 2;
-        path2 = (char*)malloc(length);
-        memset(path2, 0x00, length);
-        snprintf(path2, length, "%s/%s", path, file2);
-        return false;
-    }
-    return true;
-}
-
-
 /**
  * @function           utc_key_manager_type_startup
  * @description                Called before each test
@@ -188,10 +164,6 @@ static bool __storage_device_supported_cb(int storage_id, storage_type_e type, s
  */
 void utc_key_manager_type_startup(void)
 {
-    if(storage_foreach_device_supported(__storage_device_supported_cb, NULL) != STORAGE_ERROR_NONE)
-    {
-        fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
-    }
 }
 
 /**
@@ -202,8 +174,6 @@ void utc_key_manager_type_startup(void)
  */
 void utc_key_manager_type_cleanup(void)
 {
-    if(path1) free(path1);
-    if(path2) free(path2);
 }
 
 /**
@@ -1327,7 +1297,6 @@ int utc_ckmc_load_cert_from_file_p(void)
     assert_eq(ret,CKMC_ERROR_NONE);
 
     ckmc_cert_free(pcert);
-    remove(path1);
     return 0;
 }
 
@@ -1350,8 +1319,6 @@ int utc_ckmc_load_cert_from_file_n(void)
     ret = ckmc_load_cert_from_file(cert_path, &pcert);
     assert_eq(ret,CKMC_ERROR_INVALID_FORMAT);
 
-    remove(path2);
-
     return 0;
 }
 
@@ -1413,9 +1380,6 @@ int utc_ckmc_load_from_pkcs12_file_p(void)
     ckmc_cert_free(cert);
     ckmc_cert_list_all_free(ca_cert_list);
 
-    remove(path1);
-    remove(path2);
-
     return 0;
 }