int temp;
ControlShPtr control = Control::create();
RUNNER_ASSERT_MSG(CKM_API_SUCCESS == (temp = control->removeUserData(APP_UID)),
- "Error=" << ErrorToString(temp));
+ "Error=" << ErrorToString(temp));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == (temp = control->unlockUserKey(APP_UID, TEST_PASS)),
+ "Error=" << ErrorToString(temp));
}
// saveKey
RUNNER_CHILD_TEST(TA1750_ocsp_check_positive)
{
- RUNNER_IGNORED_MSG("Fixed in next version of ckm!");
switch_to_storage_ocsp_user(TEST_LABEL);
DBCleanup dbc;
memcpy(buffer.data(), buff.data(), buff.size());
auto pkcs = CKM::PKCS12::create(buffer, CKM::Password());
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != pkcs.get(),
"Error in PKCS12::create()");
auto cert = pkcs->getCertificate();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != cert.get(),
"Error in PKCS12::getCertificate()");
auto key = pkcs->getKey();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != key.get(),
"Error in PKCS12::getKey()");
auto caVector = pkcs->getCaCertificateShPtrVector();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
2 == caVector.size(),
"Wrong size of vector");
// save to the CKM
- int tmp;
CKM::Policy exportable;
CKM::Policy notExportable(CKM::Password(), false);
RUNNER_TEST(TA2010_PKCS_get)
{
DBCleanup dbc;
- int temp;
auto manager = CKM::Manager::create();
// fail - no entry
CKM::Password());
auto cert = obs->m_pkcs->getCertificate();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != cert.get(),
"Error in PKCS12::getCertificate()");
auto key = obs->m_pkcs->getKey();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != key.get(),
"Error in PKCS12::getKey()");
auto caVector = obs->m_pkcs->getCaCertificateShPtrVector();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
2 == caVector.size(),
"Wrong size of vector");
}
check_read_allowed(alias, TEST_DATA);
}
-void check_read_denied(const char* alias)
-{
- // try to read previously saved data - label taken implicitly
- {
- ckmc_raw_buffer_s* buffer = NULL;
- int ret = ckmc_get_data(alias, NULL, &buffer);
- RUNNER_ASSERT_MSG(CKMC_ERROR_PERMISSION_DENIED == ret,
- "App with different label shouldn't have rights to read this data. Error: " << ret);
- ckmc_buffer_free(buffer);
- }
-}
-
void check_read_not_visible(const char* alias)
{
// try to read previously saved data - label taken implicitly
void allow_access_deprecated(const char* alias, const char* accessor, ckmc_access_right_e accessRights)
{
int ret = ckmc_allow_access(alias, accessor, accessRights);
- RUNNER_ASSERT_MSG_BT(CKMC_ERROR_NONE == ret, "Trying to allow access returned: " << ret);
+ RUNNER_ASSERT_MSG(CKMC_ERROR_NONE == ret, "Trying to allow access returned: " << ret);
}
void allow_access(const char* alias, const char* accessor, int permissionMask)
void deny_access(const char* alias, const char* accessor)
{
- int ret = ckmc_deny_access(alias, accessor);
+ int ret = ckmc_set_permission(alias, accessor, CKMC_PERMISSION_NONE);
RUNNER_ASSERT_MSG(CKMC_ERROR_NONE == ret, "Denying access failed. Error: " << ret);
}
{
// data removal should revoke this access
int ret = ckmc_allow_access_by_adm(USER_ROOT, get_label().get(), alias, accessor, accessRights);
- RUNNER_ASSERT_MSG_BT(CKMC_ERROR_NONE == ret, "Trying to allow access returned: " << ret);
+ RUNNER_ASSERT_MSG(CKMC_ERROR_NONE == ret, "Trying to allow access returned: " << ret);
}
void allow_access_by_adm(const char* alias, const char* accessor, int permissionMask)
ckmc_cert_s* create_cert(CertIdx idx) {
size_t size = sizeof(CERT)/sizeof(CERT[0]);
- RUNNER_ASSERT_MSG_BT(idx < size, "Certificate index out of range: " << idx << ">=" << size);
+ RUNNER_ASSERT_MSG(idx < size, "Certificate index out of range: " << idx << ">=" << size);
ckmc_cert_s* cert = NULL;
assert_positive(ckmc_cert_new,
CKMC_FORM_PEM,
&cert);
- RUNNER_ASSERT_MSG_BT(cert != NULL, "Cert is NULL");
+ RUNNER_ASSERT_MSG(cert != NULL, "Cert is NULL");
return cert;
}
policy.password = NULL;
policy.extractable = 1;
- int tmp;
assert_positive(ckmc_save_cert, alias, *cert, policy);
}
ckmc_alias_list_s* tmp = NULL;
assert_positive(ckmc_alias_list_new, strdup(a), &tmp);
aliasList = AliasListPtr(tmp, ckmc_alias_list_all_free);
- RUNNER_ASSERT_MSG_BT(!!aliasList, "Alias list is NULL");
+ RUNNER_ASSERT_MSG(!!aliasList, "Alias list is NULL");
last = aliasList.get();
} else {
assert_positive(ckmc_alias_list_add, last, strdup(a), &last);
- RUNNER_ASSERT_MSG_BT(last != NULL, "Last alias on the list is NULL");
+ RUNNER_ASSERT_MSG(last != NULL, "Last alias on the list is NULL");
}
}
va_end(ap);
ckmc_cert_list_s* tmp = NULL;
assert_positive(ckmc_cert_list_new, c, &tmp);
certList = CertListPtr(tmp, ckmc_cert_list_all_free);
- RUNNER_ASSERT_MSG_BT(!!certList, "Cert list is NULL");
+ RUNNER_ASSERT_MSG(!!certList, "Cert list is NULL");
last = certList.get();
} else {
assert_positive(ckmc_cert_list_add, last, c, &last);
- RUNNER_ASSERT_MSG_BT(last != NULL, "Last cert on the list is NULL");
+ RUNNER_ASSERT_MSG(last != NULL, "Last cert on the list is NULL");
}
}
va_end(ap);
if (!list) {
ckmc_cert_list_s* tmp = NULL;
assert_positive(ckmc_cert_list_new, cert, &tmp);
- RUNNER_ASSERT_MSG_BT(!!tmp, "Cert list is NULL");
+ RUNNER_ASSERT_MSG(!!tmp, "Cert list is NULL");
list = tmp;
} else {
ckmc_cert_list_s* last = list;
while(last->next)
last = last->next;
assert_positive(ckmc_cert_list_add, last, cert, &last);
- RUNNER_ASSERT_MSG_BT(last != NULL, "Last cert on the list is NULL");
+ RUNNER_ASSERT_MSG(last != NULL, "Last cert on the list is NULL");
}
}
if (!list) {
ckmc_alias_list_s* tmp = NULL;
assert_positive(ckmc_alias_list_new, strdup(alias), &tmp);
- RUNNER_ASSERT_MSG_BT(!!tmp, "Alias list is NULL");
+ RUNNER_ASSERT_MSG(!!tmp, "Alias list is NULL");
list = tmp;
} else {
ckmc_alias_list_s* last = list;
while(last->next)
last = last->next;
assert_positive(ckmc_alias_list_add, last, strdup(alias), &last);
- RUNNER_ASSERT_MSG_BT(last != NULL, "Last alias on the list is NULL");
+ RUNNER_ASSERT_MSG(last != NULL, "Last alias on the list is NULL");
}
}
size_t size = list_size(chain);
ckmc_cert_list_all_free(chain);
chain = NULL;
- RUNNER_ASSERT_MSG_BT(size == expected, "Expected chain size: " << expected << " got: " << size);
+ RUNNER_ASSERT_MSG(size == expected, "Expected chain size: " << expected << " got: " << size);
assert_positive(T::createChainWithAlias,
cert,
size = list_size(chain);
ckmc_cert_list_all_free(chain);
chain = NULL;
- RUNNER_ASSERT_MSG_BT(size == expected, "Expected chain size: " << expected << " got: " << size);
+ RUNNER_ASSERT_MSG(size == expected, "Expected chain size: " << expected << " got: " << size);
ckmc_cert_free(cert);
}
m_trustedCerts,
m_system,
&chain);
- RUNNER_ASSERT_MSG_BT(chain == NULL, "Chain is not empty");
+ RUNNER_ASSERT_MSG(chain == NULL, "Chain is not empty");
assert_result(error,
T::createChainWithAlias,
m_system,
&chain);
- RUNNER_ASSERT_MSG_BT(chain == NULL, "Chain is not empty");
+ RUNNER_ASSERT_MSG(chain == NULL, "Chain is not empty");
ckmc_cert_free(cert);
}
RUNNER_TEST(TCCH_0000_init)
{
- int temp;
assert_positive(ckmc_unlock_user_key, 0, "test-pass");
}
RUNNER_TEST(TCCH_9999_deinit)
{
- int temp;
-
assert_positive(ckmc_lock_user_key, 0);
assert_positive(ckmc_remove_user_data, 0);
}
RUNNER_ASSERT_MSG(NULL != ppkcs12->ca_chain, "no chain certificates in PKCS12");
// save to the CKM
- int tmp;
ckmc_policy_s exportable;
exportable.password = NULL;
exportable.extractable = 1;
// fail - no entry
RUNNER_ASSERT_MSG(
- CKMC_ERROR_DB_ALIAS_UNKNOWN == (temp = ckmc_get_pkcs12("i-do-not-exist", &pkcs)),
+ CKMC_ERROR_DB_ALIAS_UNKNOWN == (temp = ckmc_get_pkcs12("i-do-not-exist", NULL, NULL, &pkcs)),
CKMCReadableError(temp));
ckmc_pkcs12_free(pkcs);
pkcs = NULL;
// fail - not exportable
RUNNER_ASSERT_MSG(
- CKMC_ERROR_NOT_EXPORTABLE == (temp = ckmc_get_pkcs12(alias_PKCS_not_exportable, &pkcs)),
+ CKMC_ERROR_NOT_EXPORTABLE == (temp = ckmc_get_pkcs12(alias_PKCS_not_exportable, NULL, NULL, &pkcs)),
CKMCReadableError(temp));
ckmc_pkcs12_free(pkcs);
pkcs = NULL;
// success - exportable
RUNNER_ASSERT_MSG(
- CKMC_ERROR_NONE == (temp = ckmc_get_pkcs12(alias_PKCS_exportable, &pkcs)),
+ CKMC_ERROR_NONE == (temp = ckmc_get_pkcs12(alias_PKCS_exportable, NULL, NULL, &pkcs)),
CKMCReadableError(temp));
RUNNER_ASSERT_MSG(NULL != pkcs->cert, "no certificate in PKCS12");
void assert_result(int expected, F&& func, Args... args)
{
int ret = func(args...);
- RUNNER_ASSERT_MSG_BT(ret == expected, "Expected " << expected << " got: " << ret);
+ RUNNER_ASSERT_MSG(ret == expected, "Expected " << expected << " got: " << ret);
}
template <typename F, typename... Args>
{
int temp;
auto control = CKM::Control::create();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->removeUserData(14)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->resetUserPassword(14, "simple-password")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->resetUserPassword(14, "something")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->unlockUserKey(14, "test-pass")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->lockUserKey(14)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_BAD_REQUEST == (temp = control->resetUserPassword(14, "something")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->removeUserData(14)),
"Error=" << CKM::ErrorToString(temp));
}
{
int temp;
auto control = CKM::Control::create();
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->unlockUserKey(20, "test-pass")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->changeUserPassword(20, "test-pass", "new-pass")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->lockUserKey(20)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = control->unlockUserKey(20, "incorrect-password")),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = control->removeUserData(20)),
"Error=" << CKM::ErrorToString(temp));
}
buffer == buffer2,
"Data corrupted");
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->getData("data2", CKM::Password("Password"), buffer)),
"The wrong password should be ignored because non was used in saveData. Error=" << CKM::ErrorToString(temp));
}
CKM::RawBuffer buffer1(binData1.begin(), binData1.end());
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->saveData("data4", buffer1, CKM::Policy("CorrectPassword"))),
"Error=" << CKM::ErrorToString(temp));
CKM::RawBuffer buffer;
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->getData("data4", CKM::Password("CorrectPassword"), buffer)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
buffer == buffer1,
"Data corrupted");
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getData("data4", CKM::Password("WrongPassword"), buffer)),
"Error=" << CKM::ErrorToString(temp));
}
EMPTY_CERT_VECTOR,
true,
certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
"Error=" << CKM::ErrorToString(tmp));
RUNNER_ASSERT_MSG(
"Wrong size of certificate chain.");
tmp = manager->getCertificateChain(cert, certVector, EMPTY_CERT_VECTOR, true, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
RUNNER_ASSERT_MSG(
3 == certChain.size(),
RUNNER_ASSERT_MSG(NULL != cert1.get(), "Certificate should not be empty");
tmp = manager->getCertificateChain(cert, aliasVector, EMPTY_ALIAS_VECTOR, true, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
"Error=" << CKM::ErrorToString(tmp));
RUNNER_ASSERT_MSG(
aliasVector.push_back(full_address);
tmp = manager->getCertificateChain(cert, aliasVector, EMPTY_ALIAS_VECTOR, true, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
3 == certChain.size(),
"Wrong size of certificate chain.");
}
RUNNER_ASSERT_MSG(NULL != cert1.get(), "Certificate should not be empty");
tmp = manager->getCertificateChain(cert, EMPTY_CERT_VECTOR, EMPTY_CERT_VECTOR, true, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
"Error=" << CKM::ErrorToString(tmp));
RUNNER_ASSERT_MSG(
"Wrong size of certificate chain.");
tmp = manager->getCertificateChain(cert, certVector, EMPTY_CERT_VECTOR, true, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
3 == certChain.size(),
"Wrong size of certificate chain.");
EMPTY_ALIAS_VECTOR,
true,
certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
"Error=" << CKM::ErrorToString(tmp));
RUNNER_ASSERT_MSG(
aliasVector.push_back(alias_PKCS_exportable);
tmp = manager->getCertificateChain(cert, EMPTY_ALIAS_VECTOR, aliasVector, false, certChain);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
// 1(cert) + 1(pkcs12 cert) + 2(pkcs12 chain cert) = 4
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
4 == certChain.size(),
"Wrong size of certificate chain: " << certChain.size());
}
memcpy(buffer.data(), buff.data(), buff.size());
auto pkcs = CKM::PKCS12::create(buffer, CKM::Password());
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
NULL != pkcs.get(),
"Error in PKCS12::create()");
int temp;
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->savePKCS12(alias, pkcs, CKM::Policy(pass1), CKM::Policy(pass2))),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, pkcs)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, CKM::Password(), CKM::Password(), pkcs)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, pass1, CKM::Password(), pkcs)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, CKM::Password(), pass2, pkcs)),
"Error=" << CKM::ErrorToString(temp));
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->getPKCS12(alias, pass1, pass2, pkcs)),
"Error=" << CKM::ErrorToString(temp));
CKM::CertificateShPtr cert;
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_SUCCESS == (temp = manager->getCertificate(alias, pass2, cert)),
"Error=" << CKM::ErrorToString(temp));
CKM::AliasVector certVect;
certVect.push_back(alias);
- RUNNER_ASSERT_MSG_BT(
+ RUNNER_ASSERT_MSG(
CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getCertificateChain(cert, certVect, certVect, true, certChain)),
"Error=" << CKM::ErrorToString(temp));
}
unsigned int attempt, max_attempt, expire_sec;
int ret = security_server_chk_pwd(NULL, &attempt, &max_attempt, &expire_sec);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "");
}
RUNNER_CHILD_TEST(T4011_ADD_DATA)
auto mgr = CKM::Manager::create();
int ret = mgr->saveData(CKM_ALIAS1, BIN_DATA1, CKM::Policy());
- RUNNER_ASSERT_MSG_BT(ret == CKM_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == CKM_API_SUCCESS, "");
}
RUNNER_TEST(T4012_CLOSE_CKM_DB)
auto ctl = CKM::Control::create();
int ret = ctl->lockUserKey(USER_APP);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_CHILD_TEST(T4013_GET_DATA)
// CKM will automaticly unlock with empty password
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_TEST(T4014_UNLOCK_DATABASE_WITH_SECURITY_SERVER)
usleep(PASSWORD_RETRY_TIMEOUT_US);
int ret = security_server_chk_pwd(NULL, &attempt, &max_attempt, &expire_sec);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "");
}
RUNNER_CHILD_TEST(T4015_GET_DATA)
CKM::RawBuffer buffer;
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
- RUNNER_ASSERT_MSG_BT(buffer == BIN_DATA1, "Data mismatch");
+ RUNNER_ASSERT_MSG(buffer == BIN_DATA1, "Data mismatch");
}
RUNNER_TEST_GROUP_INIT(T402_SECURITY_SERVER_PASSWORD_INTEGRATION);
reset_security_server();
int ret = security_server_set_pwd(NULL, PASSWORD1, 10, 10);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "");
}
RUNNER_CHILD_TEST(T4021_ADD_DATA)
auto mgr = CKM::Manager::create();
int ret = mgr->saveData(CKM_ALIAS1, BIN_DATA1, CKM::Policy());
- RUNNER_ASSERT_MSG_BT(ret == CKM_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == CKM_API_SUCCESS, "");
}
RUNNER_TEST(T4022_CLOSE_CKM_DB)
auto ctl = CKM::Control::create();
int ret = ctl->lockUserKey(USER_APP);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
usleep(PASSWORD_RETRY_TIMEOUT_US);
// login with current password to get rid of invalid "NULL" DKEK
ret = security_server_chk_pwd(PASSWORD1, &attempt, &max, &expire);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
ret = ctl->lockUserKey(USER_APP);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_CHILD_TEST(T4023_GET_DATA_NEGATIVE)
CKM::RawBuffer buffer;
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_DB_LOCKED == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_DB_LOCKED == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_TEST(T4024_UNLOCK_DATABASE_WITH_SECURITY_SERVER)
usleep(PASSWORD_RETRY_TIMEOUT_US);
int ret = security_server_chk_pwd(PASSWORD1, &attempt, &max, &expire);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "Error =" << ret);
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "Error =" << ret);
}
RUNNER_CHILD_TEST(T4025_GET_DATA)
CKM::RawBuffer buffer;
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
- RUNNER_ASSERT_MSG_BT(buffer == BIN_DATA1, "Data missmatch");
+ RUNNER_ASSERT_MSG(buffer == BIN_DATA1, "Data missmatch");
}
RUNNER_TEST_GROUP_INIT(T403_SECURITY_SERVER_PASSWORD_INTEGRATION);
reset_security_server();
int ret = security_server_set_pwd(NULL, PASSWORD1, 10, 10);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "");
}
RUNNER_CHILD_TEST(T4031_ADD_DATA)
auto mgr = CKM::Manager::create();
int ret = mgr->saveData(CKM_ALIAS1, BIN_DATA1, CKM::Policy());
- RUNNER_ASSERT_MSG_BT(ret == CKM_API_SUCCESS, "");
+ RUNNER_ASSERT_MSG(ret == CKM_API_SUCCESS, "");
}
RUNNER_TEST(T4032_CLOSE_CKM_DB)
auto ctl = CKM::Control::create();
int ret = ctl->lockUserKey(USER_APP);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
usleep(PASSWORD_RETRY_TIMEOUT_US);
// login with current password to get rid of invalid "NULL" DKEK
ret = security_server_chk_pwd(PASSWORD1, &attempt, &max, &expire);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
ret = ctl->lockUserKey(USER_APP);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_CHILD_TEST(T4033_GET_DATA_NEGATIVE)
CKM::RawBuffer buffer;
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_ERROR_DB_LOCKED == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_ERROR_DB_LOCKED == ret, "Error=" << CKM::ErrorToString(ret));
}
RUNNER_TEST(T4034_UNLOCK_DATABASE_WITH_SECURITY_SERVER)
usleep(PASSWORD_RETRY_TIMEOUT_US);
int ret = security_server_set_pwd(PASSWORD1, PASSWORD2, 10, 10);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
+ RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "Error=" << ret);
}
RUNNER_CHILD_TEST(T4035_GET_DATA)
CKM::RawBuffer buffer;
int ret = mgr->getData(CKM_ALIAS1, CKM::Password(), buffer);
- RUNNER_ASSERT_MSG_BT(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == ret, "Error=" << CKM::ErrorToString(ret));
- RUNNER_ASSERT_MSG_BT(buffer == BIN_DATA1, "Data mismatch");
+ RUNNER_ASSERT_MSG(buffer == BIN_DATA1, "Data mismatch");
}