summaryrefslogtreecommitdiff
path: root/tests/test_certs.cpp
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-02-17 02:31:09 (GMT)
committersangwan.kwon <sangwan.kwon@samsung.com>2016-02-24 06:07:57 (GMT)
commita49b608fe94e1c8f6a16f721a24f605967948867 (patch)
treefde92afc97ee046d865e2a8f7cd906b72b6cf1db /tests/test_certs.cpp
parent18e4ddb82a037b7c31b488ffcd96a36a8f32218c (diff)
downloadcert-checker-a78cda9d14ab153f6cb068ce5dac17f8c5b6ab60.zip
cert-checker-a78cda9d14ab153f6cb068ce5dac17f8c5b6ab60.tar.gz
cert-checker-a78cda9d14ab153f6cb068ce5dac17f8c5b6ab60.tar.bz2
* cert-svc API, key-manager API -> pkgmgr-info API Change-Id: I1c3523dd73041f117fab1c1b0012d25c1535defe Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
Diffstat (limited to 'tests/test_certs.cpp')
-rw-r--r--tests/test_certs.cpp160
1 files changed, 0 insertions, 160 deletions
diff --git a/tests/test_certs.cpp b/tests/test_certs.cpp
index d5750f7..b206ead 100644
--- a/tests/test_certs.cpp
+++ b/tests/test_certs.cpp
@@ -354,164 +354,4 @@ LwfORELEC5n+5p/8sHiGUW3RLJ3GlvuFgrsEL/digO9i2n/2DqyQuFa9eT/ygG6j\
BOOST_REQUIRE(resp == Certs::ocsp_response_t::OCSP_APP_OK);
}
-BOOST_AUTO_TEST_CASE(find_app_signatures_1) {
-
- // App1
- app_t app1("app_id", "pkg_id", 101, {});
- ocsp_urls_t ocsp_urls;
- std::string path1 = std::string(TEST_APP_SIGNATURES_DIR) + std::string("/app1");
-
- find_app_signatures (app1, path1, ocsp_urls);
- BOOST_REQUIRE(app1.signatures.size() == 2);
- // set signatures/certificates in defined oder;
- sort(app1);
-
- app_t origin1("app_id", "pkg_id", 101, {});
- chain_t chain1 = {"MIIClDCCAf2gAwIBAgIGAT4hYbcpMA0GCSqGSIb3DQEBBQUAMIGEMQswCQYD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ZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwb\
-VGl6ZW4gUHVibGljIERpc3RyaWJ1dG9yIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe\
-OTS/3nXvkDEmsFCJIvRlQ3RKDcxdWJJp625pFqHdmoJBdV+x6jl1raGK2Y1sp2Gdvpjc/z92yzAp\
-bE/UVLPh/tRNZPeGhzU4ejDDm7kzdr2f7Ia0U98K+OoY12ucwg7TYNItj9is7Cj4blGfuMDzd2ah\
-2AgnCGlwNwV/pv+uVQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACqJ\
-KO33YdoGudwanZIxMdXuxnnD9R6u72ltKk1S4zPfMJJv482CRGCI4FK6djhlsI4i0Lt1SVIJEed+\
-yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0\
-VhfnkHwPltmrpYVe"};
-
-
- origin1.signatures.push_back(chain1);
- origin1.signatures.push_back(chain2);
- // set signatures/certificates in defined oder;
- sort(origin1);
-
- LogDebug("APP1: " << app1.str() << ", CERTS: " << app1.str_certs());
- LogDebug("ORIG: " << origin1.str() << ", CERTS: " << origin1.str_certs());
-
- BOOST_REQUIRE(app1 == origin1);
-
- // App_2
- app_t app2("app_id", "pkg_id", 102, {});
- std::string path2 = std::string(TEST_APP_SIGNATURES_DIR) + std::string("/app_2");
-
- find_app_signatures (app2, path2, ocsp_urls);
- BOOST_REQUIRE(app2.signatures.size() == 1);
- // set signatures/certificates in defined oder;
- sort(app2);
-
-
- chain_t chain3 = {"MIICmzCCAgQCCQDXI7WLdVZwiTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMCS1IxDjAMBgNV\
-BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE\
-CwwZVGl6Z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hcNMjIxMDI3MTMwMjUwWjCBjzEL\
-MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6\
-ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwb\
-VGl6ZW4gUHVibGljIERpc3RyaWJ1dG9yIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe\
-OTS/3nXvkDEmsFCJIvRlQ3RKDcxdWJJp625pFqHdmoJBdV+x6jl1raGK2Y1sp2Gdvpjc/z92yzAp\
-bE/UVLPh/tRNZPeGhzU4ejDDm7kzdr2f7Ia0U98K+OoY12ucwg7TYNItj9is7Cj4blGfuMDzd2ah\
-2AgnCGlwNwV/pv+uVQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACqJ\
-KO33YdoGudwanZIxMdXuxnnD9R6u72ltKk1S4zPfMJJv482CRGCI4FK6djhlsI4i0Lt1SVIJEed+\
-yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0\
-VhfnkHwPltmrpYVe"};
-
- app_t origin2("app_id", "pkg_id", 102, {});
- origin2.signatures.push_back(chain3);
-
- // set signatures/certificates in defined oder;
- sort(origin2);
-
- BOOST_REQUIRE(app2 == origin2);
-}
-
-BOOST_AUTO_TEST_CASE(find_app_signatures_negative) {
-
- // App1
- app_t app1("app_id", "pkg_id", 101, {});
- ocsp_urls_t ocsp_urls;
- std::string path1 = std::string(TEST_APP_SIGNATURES_DIR) + std::string("/app3");
-
- find_app_signatures (app1, path1, ocsp_urls);
- // signature exists, but contains error - should not be parsed
- BOOST_REQUIRE(app1.signatures.empty());
-}
-
-BOOST_AUTO_TEST_CASE(find_app_signatures_mixed) {
-
- app_t app("app_id", "pkg_id", 101, {});
- ocsp_urls_t ocsp_urls;
- std::string path = std::string(TEST_APP_SIGNATURES_DIR) + std::string("/app4");
-
- find_app_signatures (app, path, ocsp_urls);
- // 2 signatures exist, but one of them contains error - only one should be parsed
- BOOST_REQUIRE(app.signatures.size() == 1);
-
- app_t origin("app_id", "pkg_id", 101, {});
- chain_t chain = {"MIIClDCCAf2gAwIBAgIGAT4hYbcpMA0GCSqGSIb3DQEBBQUAMIGEMQswCQYDVQQGEwJLUjEOMAwG\
-A1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSAwHgYD\
-VQQLDBdUaXplbiBEZXZlbG9wZXIgVGVzdCBDQTEbMBkGA1UEAwwSVGl6ZW4gRGV2ZWxvcGVyIENB\
-MB4XDTEzMDQxOTA4MjA1MloXDTQwMDkwNDA4MjA1MVowgZUxCzAJBgNVBAYTAlBMMREwDwYDVQQI\
-DAhNYXpvdmlhbjEPMA0GA1UEBwwGV2Fyc2F3MQ4wDAYDVQQKDAVTUlBPTDERMA8GA1UECwwIS1NG\
-L1dTU1AxJTAjBgkqhkiG9w0BCQEWFmoua296ZXJza2lAc2Ftc3VuZy5jb20xGDAWBgNVBAMMD0ph\
-bnVzeiBLb3plcnNraTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs0REWSsOn/QyVDSjSTRE\
-0W+LacX4cifRYI16nQi8WJhCAymhOg4UVXUk31Iwta8lOnQvgoce8bR+/dbCzDBmnogq8KXWlEtn\
-Ma3X6Tvz5BZfNy4Zj44G/aK0tJvnBj28h2ZZe545BNNW4zKR4SvNie9uM8v1r16PZaaS0YxOXl0C\
-AwEAATANBgkqhkiG9w0BAQUFAAOBgQCGuwLCcQAAQz2Op83gTl0Pb+f7AinL8d3XGRC8dtFPqSrZ\
-wN3gEEIQxQeYLahEVPAsD1K9aWebbWm/sjpDERKW7hmYvGYz90Z+ocLKdork5XgQWqVGt7qi+pxZ\
-x6VDuNVxDrQtsX/hLf/YBhZJuzs/LSdlErUKQM8fdxvVzbld3w=="};
- origin.signatures.push_back(chain);
-
- BOOST_REQUIRE(app == origin);
-}
-
BOOST_AUTO_TEST_SUITE_END()