RUNNER_TEST(T1511_insert_data)
{
- auto certee = TestData::getTestCertificate(TestData::MBANK);
- auto certim = TestData::getTestCertificate(TestData::SYMANTEC);
+ auto certee = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_LEAF);
+ auto certim = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_IM);
CKM::Alias certeeAlias("CertEE");
CKM::Alias certimAlias("CertIM");
{
ScopedAccessProvider ap(TEST_LABEL);
ap.applyAndSwithToUser(USER_TEST+1, GROUP_APP);
- auto certee = TestData::getTestCertificate(TestData::MBANK);
+ auto certee = TestData::getTestCertificate(TestData::THIRD_PARTY_LEAF);
auto manager = CKM::Manager::create();
size_t current_aliases_num = count_aliases(ALIAS_CERT);
using namespace std;
+namespace TestData {
namespace {
-typedef map<TestData::certificateID, pair<string, CKM::CertificateShPtr>> CertMap;
+
+enum RawCertificateID {
+ // test certificates
+ TEST_ROOT_CA = 0, // TEST_ROOT_CA, expires 2035
+ TEST_IM_CA, // TEST_IM_CA, signed by TEST_ROOT_CA, expires 2035
+ TEST_LEAF, // TEST_LEAF, signed by TEST_IM_CA, expires 2035
+
+ // third party
+ EQUIFAX, // EQUIFAX (root CA), expires 22 Aug 2018
+ GEOTRUST, // GEOTRUST, signed by EQUIFAX, expires 21 Aug 2018
+ GIAG2, // GIAG2, signed by GEOTRUST, expires 31 Dec 2016
+ GOOGLE_COM, // GOOGLE_COM, signed by GIAG2, expires 13 Jan 2016
+
+ // ocsp available chain on third party
+ SYMANTEC, // SYMANTEC, signed by VERISIGN, expires 30 Oct 2023
+ MBANK, // MBANK, signed by SYMANTEC, expires 04 Feb 2016
+
+ // footer - last element in the set
+ NO_CERT
+};
+
+typedef map<RawCertificateID, pair<string, CKM::CertificateShPtr>> CertMap;
CKM::CertificateShPtr createCert(const string& cert) {
CKM::RawBuffer buffer_cert(cert.begin(), cert.end());
return cptr;
}
+RawCertificateID toRawCertificateID(certificateID id)
+{
+ switch (id) {
+ case certificateID::TEST_ROOT_CA: return RawCertificateID::TEST_ROOT_CA;
+ case certificateID::TEST_IM_CA: return RawCertificateID::TEST_IM_CA;
+ case certificateID::TEST_LEAF: return RawCertificateID::TEST_LEAF;
+
+ case certificateID::THIRD_PARTY_ROOT_CA: return RawCertificateID::EQUIFAX;
+ case certificateID::THIRD_PARTY_IM_CA1: return RawCertificateID::GEOTRUST;
+ case certificateID::THIRD_PARTY_IM_CA2: return RawCertificateID::GIAG2;
+ case certificateID::THIRD_PARTY_LEAF: return RawCertificateID::GOOGLE_COM;
+
+ case certificateID::OCSP_AVAILABLE_IM: return RawCertificateID::SYMANTEC;
+ case certificateID::OCSP_AVAILABLE_LEAF: return RawCertificateID::MBANK;
+
+ case certificateID::NO_CERT: return RawCertificateID::NO_CERT;
+ default: throw std::invalid_argument("Invalid raw certificat ID!");
+ }
+}
+
CertMap initializeTestCerts()
{
CertMap cm;
"qMn7nf7taidDKLO2T4bhujztnTYOhhaXKgPy7AtZ28N2wvX96VyAPB/vrchGmyBK\n"
"kOg11TpPdNDkhb1J4ZCh2gupDg==\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::TEST_ROOT_CA] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::TEST_ROOT_CA] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// TEST_IM_CA, signed by TEST_ROOT_CA, expires 2035
"SLoHQ9s1i7Zyb7HU6UAaqMOz15LBkyAqtNyJcO2p7Q/p5YK0xfD4xisI5qXucqVm\n"
"F2obL5qJSTN/RQ==\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::TEST_IM_CA] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::TEST_IM_CA] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// TEST_LEAF, signed by TEST_IM_CA, expires 2035
"Zj/T1JkYXKkEwZU6nAR2jdZp3EP9xj3o15V/tyFcXHx6l8NTxn4cJb+Xe4VquQJz\n"
"6ON7PVe0ABN/AlwVQiFE\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::TEST_LEAF] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::TEST_LEAF] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// GIAG2, signed by GEOTRUST, expires 31 Dec 2016
"WOH7sf6coaPo/ck/9Ndx3L2MpBngISMjVROPpBYCCX65r+7bU2S9cS+5Oc4wt7S8\n"
"VOBHBw==\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::GIAG2] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::GIAG2] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// MBANK, signed by SYMANTEC, expires 04 Feb 2016
"aFmUlsB1C6YFMqVPRfHuxyPUb2zjw+ll7UStQxuSSTpwBmW1g/dIhtle9+o8i3z2\n"
"WJAT38TP3mPw8SUWLbgGyih6bsB6eBxFEM5awP60XXjZfVAmoVLlj9oWYNQrZLwk\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::MBANK] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::MBANK] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// SYMANTEC, signed by VERISIGN, expires 30 Oct 2023
"LwfORELEC5n+5p/8sHiGUW3RLJ3GlvuFgrsEL/digO9i2n/2DqyQuFa9eT/ygG6j\n"
"2bkPXToHHZGThkspTOHcteHgM52zyzaRS/6htO7w+Q==\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::SYMANTEC] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::SYMANTEC] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// GEOTRUST, signed by EQUIFAX, expires 21 Aug 2018
"NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W\n"
"b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::GEOTRUST] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::GEOTRUST] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// EQUIFAX, (root CA), expires 22 Aug 2018
"7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh\n"
"1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::EQUIFAX] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::EQUIFAX] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
// GOOGLE_COM, *.google.com - signed by GIAG2, expires 13 Jan 2016
"SpLyfbO8eRQkgXPZxau0BMof5tyetyzBe2QQ/OcvAkDUVhwZi2wIBf9rbhWnl2LE\n"
"urbTa3K72M5I58jgb740XezcOQ==\n"
"-----END CERTIFICATE-----\n");
- cm[TestData::GOOGLE_COM] = std::make_pair(raw_base64, createCert(raw_base64));
+ cm[RawCertificateID::GOOGLE_COM] =
+ std::make_pair(raw_base64, createCert(raw_base64));
}
return cm;
}
CertMap TEST_CERTS = initializeTestCerts();
-}
+} // namespace TestData::anonymous
-std::string TestData::getTestCertificateBase64(TestData::certificateID id)
+
+std::string getTestCertificateBase64(certificateID id)
{
- RUNNER_ASSERT_MSG(TEST_CERTS.find(id) != TEST_CERTS.end(), "Unknown certificate index!");
- RUNNER_ASSERT_MSG(TEST_CERTS[id].first.size()>0, "Certificate is empty (should never ever happen)!");
+ auto cert = TEST_CERTS.find(toRawCertificateID(id));
+
+ RUNNER_ASSERT_MSG(cert != TEST_CERTS.end(), "Unknown certificate index!");
- return TEST_CERTS[id].first;
+ auto &certPair = cert->second;
+ RUNNER_ASSERT_MSG(certPair.first.size() > 0, "Certificate is empty!");
+
+ return certPair.first;
}
-CKM::CertificateShPtr TestData::getTestCertificate(certificateID id)
+CKM::CertificateShPtr getTestCertificate(certificateID id)
{
- RUNNER_ASSERT_MSG(TEST_CERTS.find(id) != TEST_CERTS.end(), "Unknown certificate index!");
- RUNNER_ASSERT_MSG(TEST_CERTS[id].second, "Certificate is empty (should never ever happen)!");
+ auto cert = TEST_CERTS.find(toRawCertificateID(id));
+
+ RUNNER_ASSERT_MSG(cert != TEST_CERTS.end(), "Unknown certificate index!");
- return TEST_CERTS[id].second;
+ auto &certPair = cert->second;
+ RUNNER_ASSERT_MSG(certPair.second != nullptr, "Certificate is empty!");
+
+ return certPair.second;
}
+
+} // namespace TestData
{
enum certificateID {
- // test certificates
- TEST_ROOT_CA = 0, // TEST_ROOT_CA, expires 2035
- TEST_IM_CA, // TEST_IM_CA, signed by TEST_ROOT_CA, expires 2035
- TEST_LEAF, // TEST_LEAF, signed by TEST_IM_CA, expires 2035
+ // test certificates which made by us
+ TEST_ROOT_CA = 0,
+ TEST_IM_CA,
+ TEST_LEAF,
// third party
- GIAG2, // GIAG2, signed by GEOTRUST, expires 31 Dec 2016
- MBANK, // MBANK, signed by SYMANTEC, expires 04 Feb 2016
- SYMANTEC, // SYMANTEC, signed by VERISIGN, expires 30 Oct 2023
- GEOTRUST, // GEOTRUST, GeoTrust Global CA - signed by EQUIFAX, expires 21 Aug 2018
- EQUIFAX, // EQUIFAX (root CA), expires 22 Aug 2018
- GOOGLE_COM, // GOOGLE_COM, *.google.com - signed by GIAG2, expires 13 Jan 2016
-
- // footer - last element in the set
+ THIRD_PARTY_ROOT_CA,
+ THIRD_PARTY_IM_CA1,
+ THIRD_PARTY_IM_CA2,
+ THIRD_PARTY_LEAF,
+
+ // ocsp available certificate chain, thirt party
+ OCSP_AVAILABLE_IM,
+ OCSP_AVAILABLE_LEAF,
+
+ // footer
NO_CERT
};
RUNNER_TEST(TA0120_save_cert_already_exists, UserEnv)
{
- test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(MBANK), Policy());
+ test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(OCSP_AVAILABLE_LEAF), Policy());
test_negative(&ManagerAsync::saveCertificate,
CKM_API_ERROR_DB_ALIAS_EXISTS,
"alias",
- getTestCertificate(MBANK),
+ getTestCertificate(OCSP_AVAILABLE_LEAF),
Policy());
}
RUNNER_TEST(TA0150_save_cert_positive, UserEnv)
{
- test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(MBANK), Policy());
+ test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(OCSP_AVAILABLE_LEAF), Policy());
}
RUNNER_TEST(TA0450_remove_cert_positive, UserEnv)
{
- test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(MBANK), Policy());
+ test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(OCSP_AVAILABLE_LEAF), Policy());
test_positive(&ManagerAsync::removeAlias, "alias");
}
{
test_positive(&ManagerAsync::saveCertificate,
"alias",
- getTestCertificate(MBANK),
+ getTestCertificate(OCSP_AVAILABLE_LEAF),
Policy("password"));
test_negative(&ManagerAsync::getCertificate,
CKM_API_ERROR_AUTHENTICATION_FAILED,
RUNNER_TEST(TA0750_get_cert_positive, UserEnv)
{
- test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(MBANK), Policy("password"));
+ test_positive(&ManagerAsync::saveCertificate, "alias", getTestCertificate(OCSP_AVAILABLE_LEAF), Policy("password"));
test_positive(&ManagerAsync::getCertificate, "alias", "password");
}
RUNNER_TEST(TA1050_get_cert_alias_vector_positive, UserEnv)
{
- test_positive(&ManagerAsync::saveCertificate, "alias1", getTestCertificate(MBANK), Policy());
+ test_positive(&ManagerAsync::saveCertificate, "alias1", getTestCertificate(OCSP_AVAILABLE_LEAF), Policy());
test_check_aliases(&ManagerAsync::getCertificateAliasVector, { aliasWithLabelFromSelf("alias1") });
- test_positive(&ManagerAsync::saveCertificate, "alias2", getTestCertificate(SYMANTEC), Policy());
+ test_positive(&ManagerAsync::saveCertificate, "alias2", getTestCertificate(OCSP_AVAILABLE_IM), Policy());
test_check_aliases(&ManagerAsync::getCertificateAliasVector, { aliasWithLabelFromSelf("alias1"),
aliasWithLabelFromSelf("alias2") });
// getCertificateChain
RUNNER_TEST(TA1410_get_certificate_chain_invalid_param, UserEnv)
{
- CertificateShPtr cert = getTestCertificate(MBANK);
- CertificateShPtrVector certv = { getTestCertificate(SYMANTEC) };
+ CertificateShPtr cert = getTestCertificate(OCSP_AVAILABLE_LEAF);
+ CertificateShPtrVector certv = { getTestCertificate(OCSP_AVAILABLE_IM) };
test_no_observer<certChainFn1>(&ManagerAsync::getCertificateChain,
cert,
certv,
RUNNER_TEST(TA1420_get_certificate_chain_negative, UserEnv)
{
- CertificateShPtr cert = getTestCertificate(MBANK);
- CertificateShPtrVector certv = { getTestCertificate(MBANK) };
+ CertificateShPtr cert = getTestCertificate(OCSP_AVAILABLE_LEAF);
+ CertificateShPtrVector certv = { getTestCertificate(OCSP_AVAILABLE_LEAF) };
test_negative<certChainFn1>(&ManagerAsync::getCertificateChain,
CKM_API_ERROR_VERIFICATION_FAILED,
cert,
EMPTY_CERT_VECTOR,
true);
AliasVector aliasv = { "alias" };
- test_positive(&ManagerAsync::saveCertificate, aliasv[0], getTestCertificate(MBANK), Policy());
+ test_positive(&ManagerAsync::saveCertificate, aliasv[0], getTestCertificate(OCSP_AVAILABLE_LEAF), Policy());
test_negative<certChainFn2>(&ManagerAsync::getCertificateChain,
CKM_API_ERROR_VERIFICATION_FAILED,
cert,
RUNNER_TEST(TA1450_get_certificate_chain_positive, UserEnv)
{
- CertificateShPtr cert = getTestCertificate(MBANK);
- CertificateShPtrVector certv = { getTestCertificate(SYMANTEC) };
+ CertificateShPtr cert = getTestCertificate(OCSP_AVAILABLE_LEAF);
+ CertificateShPtrVector certv = { getTestCertificate(OCSP_AVAILABLE_IM) };
test_check_cert_chain<certChainFn1>(&ManagerAsync::getCertificateChain,
3,
cert,
true);
AliasVector aliasv = { "alias" };
- test_positive(&ManagerAsync::saveCertificate, aliasv[0], getTestCertificate(SYMANTEC), Policy());
+ test_positive(&ManagerAsync::saveCertificate, aliasv[0], getTestCertificate(OCSP_AVAILABLE_IM), Policy());
test_check_cert_chain<certChainFn2>(&ManagerAsync::getCertificateChain,
3,
cert,
RUNNER_TEST(TA1720_ocsp_check_negative, UserEnv)
{
- CertificateShPtrVector certv = { getTestCertificate(MBANK), getTestCertificate(MBANK) };
+ CertificateShPtrVector certv = { getTestCertificate(OCSP_AVAILABLE_LEAF), getTestCertificate(OCSP_AVAILABLE_LEAF) };
auto obs = test_positive(&ManagerAsync::ocspCheck, certv);
RUNNER_ASSERT_MSG(obs->m_ocspStatus != CKM_API_OCSP_STATUS_GOOD,
RUNNER_TEST(TA1750_ocsp_check_positive, UserEnv)
{
- CertificateShPtr cert = getTestCertificate(MBANK);
- CertificateShPtrVector certv = { getTestCertificate(SYMANTEC) };
+ CertificateShPtr cert = getTestCertificate(OCSP_AVAILABLE_LEAF);
+ CertificateShPtrVector certv = { getTestCertificate(OCSP_AVAILABLE_IM) };
auto obs = test_positive<certChainFn1>(&ManagerAsync::getCertificateChain,
cert,
certv,
remove_user_data(APP_UID);
ChainVerifierOld cv;
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
- cv.addUntrusted(TestData::GIAG2);
- cv.verifyPositive(TestData::GOOGLE_COM, 3); // including system cert
+ cv.addUntrusted(TestData::THIRD_PARTY_IM_CA2);
+ cv.verifyPositive(TestData::THIRD_PARTY_LEAF, 3); // including system cert
cv.verifyNegative(TestData::TEST_LEAF);
}
remove_user_data(APP_UID);
ChainVerifierOld cv;
- cv.verifyPositive(TestData::GIAG2, 2); // including system cert
+ cv.verifyPositive(TestData::THIRD_PARTY_IM_CA2, 2); // including system cert
}
// check invalid arguments
{
remove_user_data(APP_UID);
- ckmc_cert_s* ca2 = create_cert(TestData::GIAG2);
- ckmc_cert_s* ca1 = create_cert(TestData::GEOTRUST);
+ ckmc_cert_s* ca2 = create_cert(TestData::THIRD_PARTY_IM_CA2);
+ ckmc_cert_s* ca1 = create_cert(TestData::THIRD_PARTY_IM_CA1);
ckmc_cert_list_s* chain = NULL;
// cert
ChainVerifier cv;
cv.enableSystem(false);
- cv.verifyNegative(TestData::EQUIFAX);
+ cv.verifyNegative(TestData::THIRD_PARTY_ROOT_CA);
- cv.addUntrusted(TestData::GIAG2);
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.addUntrusted(TestData::THIRD_PARTY_IM_CA2);
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
}
/*
remove_user_data(APP_UID);
ChainVerifier cv;
- cv.verifyPositive(TestData::GIAG2, 2); // including system cert
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.verifyPositive(TestData::THIRD_PARTY_IM_CA2, 2); // including system cert
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
}
/*
ChainVerifier cv;
cv.addTrusted(TestData::TEST_ROOT_CA);
- cv.verifyPositive(TestData::TEST_IM_CA, 2);// signed by trusted cert (TEST_ROOT_CA)
- cv.verifyPositive(TestData::GIAG2, 2); // signed by system cert (GEOTRUST)
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.verifyPositive(TestData::TEST_IM_CA, 2); // signed by trusted cert (TEST_ROOT_CA)
+ cv.verifyPositive(TestData::THIRD_PARTY_IM_CA2, 2); // signed by system cert (THIRD_PARTY_ROOT_CA)
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
}
RUNNER_TEST(TCCH_0170_get_certificate_chain_no_trusted)
remove_user_data(APP_UID);
ChainVerifier cv;
- cv.addUntrusted(TestData::GIAG2);
- cv.verifyPositive(TestData::GOOGLE_COM,3); // including system cert
+ cv.addUntrusted(TestData::THIRD_PARTY_IM_CA2);
+ cv.verifyPositive(TestData::THIRD_PARTY_LEAF, 3); // including system cert
cv.verifyNegative(TestData::TEST_LEAF);
}
cv.addTrusted(TestData::TEST_ROOT_CA);
cv.addUntrusted(TestData::TEST_IM_CA);
cv.verifyPositive(TestData::TEST_LEAF, 3);
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
}
/*
cv.addTrusted(TestData::TEST_ROOT_CA);
cv.addTrusted(TestData::TEST_IM_CA);
cv.verifyPositive(TestData::TEST_LEAF, 3);
- cv.verifyNegative(TestData::GOOGLE_COM);
+ cv.verifyNegative(TestData::THIRD_PARTY_LEAF);
}
RUNNER_TEST(TCCH_0200_get_certificate_chain_all)
ChainVerifier cv;
cv.enableSystem(true);
cv.addTrusted(TestData::TEST_ROOT_CA);
- cv.addUntrusted(TestData::GEOTRUST);
- cv.addUntrusted(TestData::GIAG2);
+ cv.addUntrusted(TestData::THIRD_PARTY_IM_CA1);
+ cv.addUntrusted(TestData::THIRD_PARTY_IM_CA2);
/*
* In combat conditions this may as well be 3. Because of 2 existing GeoTrust certificates with
* same Subject and Public key one being root ca and the other not there are 2 possible chains
* of trust for this certificate.
*/
- cv.verifyPositive(TestData::GOOGLE_COM,4);
+ cv.verifyPositive(TestData::THIRD_PARTY_LEAF, 4);
cv.verifyNegative(TestData::TEST_LEAF);
}
{
int temp;
- std::string certPem = TestData::getTestCertificateBase64(TestData::GIAG2);
+ std::string certPem = TestData::getTestCertificateBase64(TestData::THIRD_PARTY_LEAF);
char* password = NULL;
ckmc_cert_s *cert2;
{
int temp;
- std::string certPem = TestData::getTestCertificateBase64(TestData::GIAG2);
+ std::string certPem = TestData::getTestCertificateBase64(TestData::THIRD_PARTY_LEAF);
char* password = NULL;
ckmc_cert_s cert;
{
int temp;
- std::string certPem = TestData::getTestCertificateBase64(TestData::GIAG2);
+ std::string certPem = TestData::getTestCertificateBase64(TestData::THIRD_PARTY_LEAF);
char* password = NULL;
ckmc_cert_s *cert2 = NULL;
RUNNER_TEST(T3074_CAPI_ckmc_ocsp_check)
{
- std::string ee = TestData::getTestCertificateBase64(TestData::MBANK);
- std::string im = TestData::getTestCertificateBase64(TestData::SYMANTEC);
+ std::string ee = TestData::getTestCertificateBase64(TestData::OCSP_AVAILABLE_LEAF);
+ std::string im = TestData::getTestCertificateBase64(TestData::OCSP_AVAILABLE_IM);
ckmc_cert_s c_cert;
c_cert.raw_cert = reinterpret_cast<unsigned char *>(const_cast<char *>(ee.c_str()));
RUNNER_TEST(T3094_CAPI_TYPE_CERT)
{
- std::string certPem = TestData::getTestCertificateBase64(TestData::GIAG2);
+ std::string certPem = TestData::getTestCertificateBase64(TestData::THIRD_PARTY_LEAF);
unsigned char *raw_cert = const_cast<unsigned char *>(reinterpret_cast<const unsigned char *>(certPem.c_str()));
unsigned int size = certPem.size();
{
int ret;
- std::string certStr = TestData::getTestCertificateBase64(TestData::MBANK);
+ std::string certStr = TestData::getTestCertificateBase64(TestData::THIRD_PARTY_LEAF);
const char *file_name = "/tmp/ckmc_test_cert.pem";
remove(file_name);
int temp;
auto manager = CKM::Manager::create();
- auto cert = TestData::getTestCertificate(TestData::GIAG2);
+ auto cert = TestData::getTestCertificate(TestData::THIRD_PARTY_LEAF);
CKM::CertificateShPtr cert2;
CKM::Alias alias = "myCert";
{
ScopedDBUnlock unlock(USER_APP, APP_PASS);
- auto cert = TestData::getTestCertificate(TestData::GIAG2);
+ auto cert = TestData::getTestCertificate(TestData::THIRD_PARTY_LEAF);
CKM::Alias alias; //alias is not initialized
int temp;
{
ScopedDBUnlock unlock(USER_APP, APP_PASS);
- auto cert = TestData::getTestCertificate(TestData::GIAG2);
+ auto cert = TestData::getTestCertificate(TestData::THIRD_PARTY_LEAF);
CKM::Alias alias = "iamsomebodyelse alias";
int temp;
RUNNER_TEST(T13129_get_chain)
{
- auto cert = TestData::getTestCertificate(TestData::MBANK);
- auto cert1 = TestData::getTestCertificate(TestData::SYMANTEC);
+ auto cert = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_LEAF);
+ auto cert1 = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_IM);
CKM::CertificateShPtrVector certVector = {cert1};
CKM::CertificateShPtrVector certChain;
RUNNER_TEST(T1313_get_chain_with_alias)
{
- auto cert = TestData::getTestCertificate(TestData::MBANK);
- auto cert1 = TestData::getTestCertificate(TestData::SYMANTEC);
+ auto cert = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_LEAF);
+ auto cert1 = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_IM);
CKM::CertificateShPtrVector certChain;
CKM::AliasVector aliasVector;
RUNNER_TEST(T13141_ocsp_check_valid_chain)
{
- auto cert = TestData::getTestCertificate(TestData::MBANK);
- auto cert1 = TestData::getTestCertificate(TestData::SYMANTEC);
+ auto cert = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_LEAF);
+ auto cert1 = TestData::getTestCertificate(TestData::OCSP_AVAILABLE_IM);
CKM::CertificateShPtrVector certVector = {cert1};
CKM::CertificateShPtrVector certChain;
RUNNER_TEST(T13144_ocsp_check_root)
{
- auto root = TestData::getTestCertificate(TestData::EQUIFAX);
+ auto root = TestData::getTestCertificate(TestData::THIRD_PARTY_ROOT_CA);
CKM::CertificateShPtrVector certVector = {root};
auto manager = CKM::Manager::create();
RUNNER_TEST(T13145_ocsp_check_no_ocsp)
{
- auto root = TestData::getTestCertificate(TestData::EQUIFAX);
- auto ca2 = TestData::getTestCertificate(TestData::GEOTRUST);
- auto ca1 = TestData::getTestCertificate(TestData::GIAG2);
+ auto root = TestData::getTestCertificate(TestData::THIRD_PARTY_ROOT_CA);
+ auto ca2 = TestData::getTestCertificate(TestData::THIRD_PARTY_IM_CA1);
+ auto ca1 = TestData::getTestCertificate(TestData::THIRD_PARTY_IM_CA2);
CKM::CertificateShPtrVector certVector = {ca1, ca2, root};