"-----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
*/
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__);
- }
}
/**
*/
void utc_key_manager_type_cleanup(void)
{
- if(path1) free(path1);
- if(path2) free(path2);
}
/**
assert_eq(ret,CKMC_ERROR_NONE);
ckmc_cert_free(pcert);
- remove(path1);
return 0;
}
ret = ckmc_load_cert_from_file(cert_path, &pcert);
assert_eq(ret,CKMC_ERROR_INVALID_FORMAT);
- remove(path2);
-
return 0;
}
ckmc_cert_free(cert);
ckmc_cert_list_all_free(ca_cert_list);
- remove(path1);
- remove(path2);
-
return 0;
}