{
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.");
"Error=" << CKM::ErrorToString(temp));
}
+RUNNER_TEST_GROUP_INIT(T1418_signature_tests);
+
RUNNER_TEST(T14180_init)
{
int temp;
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));
}