Commit 0812173c authored by Michał Więckowski's avatar Michał Więckowski Committed by Kishen Maloor

Implementation of server certification simulator

This simulator is created for testing against every CTT server testcase
parent 808e6e09
Pipeline #871 passed with stage
in 6 minutes and 47 seconds
......@@ -501,14 +501,14 @@ factory_presets_cb(size_t device, void *data)
#if defined(OC_SECURITY) && defined(OC_PKI)
char cert[8192];
size_t cert_len = 8192;
if (read_pem("pki_certs/ee.pem", cert, &cert_len) < 0) {
if (read_pem("pki_certs/certification_tests_ee.pem", cert, &cert_len) < 0) {
PRINT("ERROR: unable to read certificates\n");
return;
}
char key[4096];
size_t key_len = 4096;
if (read_pem("pki_certs/key.pem", key, &key_len) < 0) {
if (read_pem("pki_certs/certification_tests_key.pem", key, &key_len) < 0) {
PRINT("ERROR: unable to read private key");
return;
}
......@@ -522,7 +522,8 @@ factory_presets_cb(size_t device, void *data)
}
cert_len = 8192;
if (read_pem("pki_certs/subca1.pem", cert, &cert_len) < 0) {
if (read_pem("pki_certs/certification_tests_subca1.pem", cert, &cert_len) <
0) {
PRINT("ERROR: unable to read certificates\n");
return;
}
......@@ -536,7 +537,8 @@ factory_presets_cb(size_t device, void *data)
}
cert_len = 8192;
if (read_pem("pki_certs/rootca1.pem", cert, &cert_len) < 0) {
if (read_pem("pki_certs/certification_tests_rootca1.pem", cert, &cert_len) <
0) {
PRINT("ERROR: unable to read certificates\n");
return;
}
......@@ -578,6 +580,7 @@ main(void)
.signal_event_loop = signal_event_loop,
.requests_entry = issue_requests };
oc_set_con_res_announced(true);
#ifdef OC_STORAGE
oc_storage_config("./client_certification_tests_creds");
#endif /* OC_STORAGE */
......
......@@ -326,7 +326,7 @@ cloud_send_ping(void)
PRINT("\nEnter receiving endpoint: ");
char addr[256];
SCANF("%255s", addr);
char endpoint_string[256];
char endpoint_string[267];
sprintf(endpoint_string, "coap+tcp://%s", addr);
oc_string_t ep_string;
oc_new_string(&ep_string, endpoint_string, strlen(endpoint_string));
......
-----BEGIN CERTIFICATE-----
MIIDQjCCAuigA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DgXfki7RGNMCIQCdSaL7uuaBFMMj
2lUMi6ePMVcHXpAb9hjH0JcltqnrrA==
-----END CERTIFICATE-----
-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIEzfYYFJmovIz4p3OVTzxWKMyC46osb9Wp6cSwGluWkUoAoGCCqGSM49
AwEHoUQDQgAEMqANRV8VkDojXqmbIgpVjcz1a9P+MSlfsMHg0o96ThYkeJzZsQrz
8JKPM7BGtWeRPeu7hRbYq/S6nunvSQd7Uw==
-----END EC PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIBnTCCAUKgAwIBAgIUfKTxfZOGE/bSAF+l555yrmzbBZYwCgYIKoZIzj0EAwIw
KzEMMAoGA1UEChMDT0NGMRswGQYDVQQDExJURVNUIE9DRiBSb290IENBIDIwIBcN
MTgxMTI5MTY0MTIyWhgPMjA2ODExMjkxNjQxMjJaMCsxDDAKBgNVBAoTA09DRjEb
MBkGA1UEAxMSVEVTVCBPQ0YgUm9vdCBDQSAyMFkwEwYHKoZIzj0CAQYIKoZIzj0D
AQcDQgAED4xusXQP8CojjLCIy3Kc/6oDZUM2CxKiq4RfKi4A2hZ9uOKD1TrirCGh
yVLso63+OQv1Zi6Og9E4SYMDHqvwZKNCMEAwDgYDVR0PAQH/BAQDAgEGMB0GA1Ud
DgQWBBSYuivCP5E741G+c2v1466PlBfNizAPBgNVHRMBAf8EBTADAQH/MAoGCCqG
SM49BAMCA0kAMEYCIQCyF9qhRMdtJhM922E7BrTENwrwrYU9X66zgRtBTuzrVgIh
ANreyj+BcMMLqXLZUSw1Lbb+4fm+/2ETt92RbrZSwXYt
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICdTCCAhygAwIBAgIUPr3tpciWV+hP0ikBe5emvQ42x7gwCgYIKoZIzj0EAwIw
KzEMMAoGA1UEChMDT0NGMRswGQYDVQQDExJURVNUIE9DRiBSb290IENBIDIwIBcN
MTgxMTI5MTY0MTIyWhgPMjA2ODExMjkxNjQxMjJaMDExEzARBgNVBAoTCkVvbnRp
IEluYy4xGjAYBgNVBAMTEVRFU1QgT0NGIFN1YiBDQSAxMFkwEwYHKoZIzj0CAQYI
KoZIzj0DAQcDQgAE/+QunxvMxcRS89wNWKTner7Y3d7P8RqnyTWoLrQgguN7TVt7
hanLa5UdcbN0KK/Td4YmnGAJk/L1c81b1QZWd6OCARQwggEQMDcGCCsGAQUFBwEB
BCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMEQG
A1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9wa2ktY3JsLnN5bWF1dGguY29tL29mZmxp
bmVjYS9PQ0ZSb290Q0EyLmNybDArBgNVHREEJDAipCAwHjEcMBoGA1UEAwwTU1lN
Qy1FQ0MtQ0EtcDI1Ni00NTAdBgNVHQ4EFgQUFlzN4X54xx9HYAJ6LYntFTmxr4Ew
HwYDVR0jBBgwFoAUmLorwj+RO+NRvnNr9eOuj5QXzYswDgYDVR0PAQH/BAQDAgEG
MBIGA1UdEwEB/wQIMAYBAf8CAQAwCgYIKoZIzj0EAwIDRwAwRAIgeo18DmymdPUE
GTNdgjKjd2k6Or8PAtlJi8FjtxVPYh8CIGtOL/pvlne1+pFNM2T36kNNps5tEyj0
Z6LbDXPE4ONe
-----END CERTIFICATE-----
This diff is collapsed.
This diff is collapsed.
......@@ -113,7 +113,7 @@ VPATH=../../messaging/coap/:../../util/:../../api/:../../deps/tinycbor/src/:../.
LIBS?= -lm -pthread -lrt
SAMPLES = server client temp_sensor simpleserver simpleserver_pki simpleclient client_collections_linux introspectionclient\
server_collections_linux server_block_linux client_block_linux smart_home_server_linux multi_device_server multi_device_client smart_lock server_multithread_linux client_multithread_linux client_certification_tests
server_collections_linux server_block_linux client_block_linux server_certification_tests smart_home_server_linux multi_device_server multi_device_client smart_lock server_multithread_linux client_multithread_linux client_certification_tests
ifeq ($(CREATE),1)
EXTRA_CFLAGS += -DOC_COLLECTIONS_IF_CREATE
......@@ -263,6 +263,7 @@ copy_pki_certs:
copy_idd_files:
@cp ../../apps/smart_home_server_linux_IDD.cbor .
@cp ../../apps/server_certification_tests_IDD.cbor .
@cp ../../apps/client_certification_tests_IDD.cbor .
${SRC} ${SRC_COMMON}: $(MBEDTLS_PATCH_FILE)
......@@ -359,6 +360,10 @@ client_block_linux: libiotivity-lite-client.a $(ROOT_DIR)/apps/client_block_linu
server_block_linux: libiotivity-lite-server.a $(ROOT_DIR)/apps/server_block_linux.c
${CC} -o $@ ../../apps/server_block_linux.c libiotivity-lite-server.a -DOC_SERVER ${CFLAGS} ${LIBS}
server_certification_tests: libiotivity-lite-server.a $(ROOT_DIR)/apps/server_certification_tests.c copy_pki_certs copy_idd_files
@mkdir -p $@_creds
${CC} -o $@ ../../apps/server_certification_tests.c libiotivity-lite-client-server.a -DOC_CLIENT -DOC_SERVER ${CFLAGS} ${CFLAGS_CLOUD} ${LIBS}
smart_home_server_linux: libiotivity-lite-server.a $(ROOT_DIR)/apps/smart_home_server_linux.c copy_pki_certs copy_idd_files
@mkdir -p $@_creds
${CC} -o $@ ../../apps/smart_home_server_linux.c libiotivity-lite-server.a -DOC_SERVER ${CFLAGS} ${LIBS}
......@@ -450,7 +455,7 @@ endif
clean:
rm -rf obj $(PC) $(CONSTRAINED_LIBS) $(API_TEST_OBJ_FILES) $(SECURITY_TEST_OBJ_FILES) $(PLATFORM_TEST_OBJ_FILES) $(MESSAGING_TEST_OBJ_FILES) $(UNIT_TESTS) $(STORAGE_TEST_DIR) $(CLOUD_TEST_OBJ_FILES) $(RD_CLIENT_TEST_OBJ_FILES)
rm -rf $(API_TEST_OBJ_DIR)/*.gcda $(SECURITY_TEST_OBJ_DIR)/*.gcda $(PLATFORM_TEST_OBJ_DIR)/*.gcda $(MESSAGING_TEST_OBJ_DIR)/*.gcda
rm -rf pki_certs smart_home_server_linux_IDD.cbor client_certification_tests_IDD.cbor
rm -rf pki_certs smart_home_server_linux_IDD.cbor server_certification_tests_IDD.cbor client_certification_tests_IDD.cbor
cleanall: clean
rm -rf ${all} $(SAMPLES) $(TESTS) ${OBT} ${SAMPLES_CREDS} $(MBEDTLS_PATCH_FILE) *.o
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment