RUNNER_TEST_GROUP_INIT(libwebappenc)
RUNNER_TEST(T01_init) {
- wae_remove_app_dek(TEST_PKGID_1);
- wae_remove_app_dek(TEST_PKGID_2);
+ wae_remove_app_dek(TEST_PKGID_1, WAE_DOWNLOADED_GLOBAL_APP);
+ wae_remove_app_dek(TEST_PKGID_2, WAE_PRELOADED_APP);
}
RUNNER_CHILD_TEST(T02_downloaded_web_app_enc){
unsigned char* encrypted = NULL;
size_t encLen = 0;
- int isPreloaded = 0; // Downloaded
+ wae_app_type_e appType = WAE_DOWNLOADED_GLOBAL_APP;
- ret = wae_encrypt_web_application(pkgId, isPreloaded,
+ ret = wae_encrypt_web_application(pkgId, appType,
(const unsigned char*)plaintext, plaintextLen,
&encrypted, &encLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_encrypt_web_application. ret=" << ret);
unsigned char* decrypted = NULL;
size_t decLen = 0;
- int isPreloaded = 0; // Downloaded
+ wae_app_type_e appType = WAE_DOWNLOADED_GLOBAL_APP;
ret = _read_from_file(DOWNLOADED_ENC_FILE, &encrypted, &encLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: _read_from_file. ret=" << ret);
- ret = wae_decrypt_web_application(pkgId, isPreloaded, encrypted, encLen, &decrypted, &decLen);
+ ret = wae_decrypt_web_application(pkgId, appType, encrypted, encLen, &decrypted, &decLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_decrypt_web_application. ret=" << ret);
- RUNNER_ASSERT_MSG(plaintextLen == decLen,
+ RUNNER_ASSERT_MSG(plaintextLen == decLen,
"FAIL: plaintext_len("<<plaintextLen<<") != decrypted_len(" <<decLen<<")");
RUNNER_ASSERT_MSG(strncmp(plaintext, (char *)decrypted, decLen) == 0,
"FAIL: plaintext("<<plaintext <<") != decrypted("<<(char *)decrypted <<")");
unsigned char* encrypted = NULL;
size_t encLen = 0;
- int isPreloaded = 1; // Preloaded
+ wae_app_type_e appType = WAE_PRELOADED_APP;
- ret = wae_encrypt_web_application(pkgId, isPreloaded,
+ ret = wae_encrypt_web_application(pkgId, appType,
(const unsigned char*)plaintext, plaintextLen,
&encrypted, &encLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_encrypt_web_application. ret=" << ret);
unsigned char* decrypted = NULL;
size_t decLen = 0;
- int isPreloaded = 1; // Preloaded
+ wae_app_type_e appType = WAE_PRELOADED_APP;
ret = _read_from_file(PRELOADED_ENC_FILE, &encrypted, &encLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: _read_from_file. ret=" << ret);
- ret = wae_decrypt_web_application(pkgId, isPreloaded, encrypted, encLen, &decrypted, &decLen);
+ ret = wae_decrypt_web_application(pkgId, appType, encrypted, encLen, &decrypted, &decLen);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_decrypt_web_application. ret=" << ret);
- RUNNER_ASSERT_MSG(plaintextLen == decLen,
+ RUNNER_ASSERT_MSG(plaintextLen == decLen,
"FAIL: plaintext_len("<<plaintextLen<<") != decrypted_len(" <<decLen<<")");
RUNNER_ASSERT_MSG(strncmp(plaintext, (char *)decrypted, decLen) == 0,
"FAIL: plaintext("<<plaintext <<") != decrypted("<<(char *)decrypted <<")");
RUNNER_CHILD_TEST(T07_remove_app_dek) {
int ret = WAE_ERROR_NONE;
- ret = wae_remove_app_dek(TEST_PKGID_1);
+ ret = wae_remove_app_dek(TEST_PKGID_1, WAE_DOWNLOADED_GLOBAL_APP);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_remove_app_dek. ret=" << ret);
-
- ret = wae_remove_app_dek(TEST_PKGID_2);
+
+ ret = wae_remove_app_dek(TEST_PKGID_2, WAE_PRELOADED_APP);
RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_remove_app_dek. ret=" << ret);
}