Loading ItsPki_TestCases.ttcn +14 −11 Original line number Diff line number Diff line Loading @@ -57,13 +57,15 @@ module ItsPki_TestCases { import from LibItsSecurity_Pixits all; import from LibItsSecurity_Pics all; // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Templates all; import from LibItsHttp_BinaryTemplates all; import from LibItsHttp_Functions all; import from LibItsHttp_TestSystem all; import from LibItsHttp_Pics all; // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Templates all; import from LibHttp_Functions all; import from LibHttp_TestSystem all; import from LibHttp_Pics all; // LibHttp import from LibHttp_BinaryTemplates all; // LibItsPki import from LibItsPki_TypesAndValues all; Loading Loading @@ -14494,7 +14496,7 @@ module ItsPki_TestCases { /** * @desc Await for DC/CTL/CRL request and provides "CERT_IUT_A_RCA", "CERT_TS_A_AA", "CERT_TS_A_EA" certificates * It simulates the ETSI point of certificates distribution * Usage: curl 'http://192.168.1.43/ctl' --header 'Content-Type: application/x-its-ctl' --header 'Content-Text: ca_request' --output ctl.oer * Usage: curl 'http://192.168.1.43/dc/getctl/{hasehedid8}' --header 'Content-Type: application/x-its-ctl' --header 'Content-Text: ca_request' --output ctl.oer */ testcase TC_PKI_PLTF_RCV_BV_01() runs on ItsPkiHttp system ItsPkiHttpSystem { // Local variables Loading Loading @@ -14657,9 +14659,10 @@ module ItsPki_TestCases { ) { tc_wait.stop; log("*** " & testcasename() & ": INFO: Invalid request received ***"); log(v_request); f_init_default_headers_list(-, "ca_response", v_headers); f_http_send(v_headers, m_http_response(m_http_response_ko_no_body(v_headers))); v_response := m_http_response(m_http_response_400_bad_request(m_http_message_body_html("<!DOCTYPE html><html><body><h1>ETSI ITS PKI Infrastructure L0 simulator</h1><p>Request not supported</p></body></html>"), v_headers)); f_http_send(v_headers, v_response); tc_wait.start; repeat; lib/LibItsPki_Pics.ttcn +2 −2 Original line number Diff line number Diff line Loading @@ -164,12 +164,12 @@ module LibItsPki_Pics { /** * @desc HTTP GET URI for Certificate Trusted List */ modulepar charstring PICS_HTTP_GET_URI_CTL := "/getctl"; modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; /** * @desc HTTP GET URI for Certificate Trusted List */ modulepar charstring PICS_HTTP_GET_URI_CRL := "/getcrl"; modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; /** * @desc HTTP GET URI for Certificate Trusted List Loading lib/LibItsPki_Pixits.ttcn +2 −0 Original line number Diff line number Diff line Loading @@ -63,4 +63,6 @@ module LibItsPki_Pixits { modulepar integer PX_AUTH_MAX_N1 := 10; modulepar integer PX_CTL_SEQUENCE_NUMBER := 2; } // End of module LibItsPki_Pixits lib_system/LibItsPki_Functions.ttcn +33 −28 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ module LibItsPki_Functions { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; // LibHelpers import from LibHelpers_Functions all; // LibIts import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; import from Ieee1609Dot2 language "ASN.1:1997" all; Loading Loading @@ -50,13 +53,15 @@ module LibItsPki_Functions { import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Templates all; import from LibItsHttp_BinaryTemplates all; import from LibItsHttp_Functions all; import from LibItsHttp_TestSystem all; import from LibItsHttp_Pics all; // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Templates all; import from LibHttp_Functions all; import from LibHttp_TestSystem all; import from LibHttp_Pics all; // LibHttp import from LibHttp_BinaryTemplates all; // LibItsPki import from LibItsPki_TypesAndValues all; Loading Loading @@ -3756,7 +3761,7 @@ module LibItsPki_Functions { log("f_build_ctl: v_ctl_commands= ", v_ctl_commands); // Build the main data structure v_time := f_getCurrentTime() / 1000;/*in seconds*/ p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(v_time + 30 * 86400/*30 days in seconds*/, 1, v_ctl_commands)); p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(v_time + 30 * 86400/*30 days in seconds*/, PX_CTL_SEQUENCE_NUMBER, v_ctl_commands)); log("<<< f_build_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); } // End of function f_build_ctl Loading Loading @@ -5663,60 +5668,60 @@ module LibItsPki_Functions { altstep a_await_dc_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_dc_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_dc_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_dc_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_dc_http_request_from_iut altstep a_await_ctl_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_ctl_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_ctl_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_ctl_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_ctl_http_request_from_iut altstep a_await_crl_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_crl_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_crl_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_crl_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_crl_http_request_from_iut altstep a_await_cpoc_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_cpoc_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_cpoc_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_cpoc_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_cpoc_http_request_from_iut altstep a_await_any_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_any_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_any_http_request_from_iut: Received message on httpEcPort"); } } // End of altstep a_await_any_http_request_from_iut Loading lib_system/LibItsPki_TestSystem.ttcn +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ module LibItsPki_TestSystem { // LibItsSecurity import from LibItsSecurity_TestSystem all; // LibItsHttp import from LibItsHttp_TestSystem all; // LibHttp import from LibHttp_TestSystem all; group portDefinitions { Loading Loading
ItsPki_TestCases.ttcn +14 −11 Original line number Diff line number Diff line Loading @@ -57,13 +57,15 @@ module ItsPki_TestCases { import from LibItsSecurity_Pixits all; import from LibItsSecurity_Pics all; // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Templates all; import from LibItsHttp_BinaryTemplates all; import from LibItsHttp_Functions all; import from LibItsHttp_TestSystem all; import from LibItsHttp_Pics all; // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Templates all; import from LibHttp_Functions all; import from LibHttp_TestSystem all; import from LibHttp_Pics all; // LibHttp import from LibHttp_BinaryTemplates all; // LibItsPki import from LibItsPki_TypesAndValues all; Loading Loading @@ -14494,7 +14496,7 @@ module ItsPki_TestCases { /** * @desc Await for DC/CTL/CRL request and provides "CERT_IUT_A_RCA", "CERT_TS_A_AA", "CERT_TS_A_EA" certificates * It simulates the ETSI point of certificates distribution * Usage: curl 'http://192.168.1.43/ctl' --header 'Content-Type: application/x-its-ctl' --header 'Content-Text: ca_request' --output ctl.oer * Usage: curl 'http://192.168.1.43/dc/getctl/{hasehedid8}' --header 'Content-Type: application/x-its-ctl' --header 'Content-Text: ca_request' --output ctl.oer */ testcase TC_PKI_PLTF_RCV_BV_01() runs on ItsPkiHttp system ItsPkiHttpSystem { // Local variables Loading Loading @@ -14657,9 +14659,10 @@ module ItsPki_TestCases { ) { tc_wait.stop; log("*** " & testcasename() & ": INFO: Invalid request received ***"); log(v_request); f_init_default_headers_list(-, "ca_response", v_headers); f_http_send(v_headers, m_http_response(m_http_response_ko_no_body(v_headers))); v_response := m_http_response(m_http_response_400_bad_request(m_http_message_body_html("<!DOCTYPE html><html><body><h1>ETSI ITS PKI Infrastructure L0 simulator</h1><p>Request not supported</p></body></html>"), v_headers)); f_http_send(v_headers, v_response); tc_wait.start; repeat;
lib/LibItsPki_Pics.ttcn +2 −2 Original line number Diff line number Diff line Loading @@ -164,12 +164,12 @@ module LibItsPki_Pics { /** * @desc HTTP GET URI for Certificate Trusted List */ modulepar charstring PICS_HTTP_GET_URI_CTL := "/getctl"; modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; /** * @desc HTTP GET URI for Certificate Trusted List */ modulepar charstring PICS_HTTP_GET_URI_CRL := "/getcrl"; modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; /** * @desc HTTP GET URI for Certificate Trusted List Loading
lib/LibItsPki_Pixits.ttcn +2 −0 Original line number Diff line number Diff line Loading @@ -63,4 +63,6 @@ module LibItsPki_Pixits { modulepar integer PX_AUTH_MAX_N1 := 10; modulepar integer PX_CTL_SEQUENCE_NUMBER := 2; } // End of module LibItsPki_Pixits
lib_system/LibItsPki_Functions.ttcn +33 −28 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ module LibItsPki_Functions { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; // LibHelpers import from LibHelpers_Functions all; // LibIts import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; import from Ieee1609Dot2 language "ASN.1:1997" all; Loading Loading @@ -50,13 +53,15 @@ module LibItsPki_Functions { import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Templates all; import from LibItsHttp_BinaryTemplates all; import from LibItsHttp_Functions all; import from LibItsHttp_TestSystem all; import from LibItsHttp_Pics all; // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Templates all; import from LibHttp_Functions all; import from LibHttp_TestSystem all; import from LibHttp_Pics all; // LibHttp import from LibHttp_BinaryTemplates all; // LibItsPki import from LibItsPki_TypesAndValues all; Loading Loading @@ -3756,7 +3761,7 @@ module LibItsPki_Functions { log("f_build_ctl: v_ctl_commands= ", v_ctl_commands); // Build the main data structure v_time := f_getCurrentTime() / 1000;/*in seconds*/ p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(v_time + 30 * 86400/*30 days in seconds*/, 1, v_ctl_commands)); p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(v_time + 30 * 86400/*30 days in seconds*/, PX_CTL_SEQUENCE_NUMBER, v_ctl_commands)); log("<<< f_build_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); } // End of function f_build_ctl Loading Loading @@ -5663,60 +5668,60 @@ module LibItsPki_Functions { altstep a_await_dc_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_dc_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_dc_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_dc_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_dc_http_request_from_iut altstep a_await_ctl_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_ctl_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_ctl_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_ctl_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_ctl_http_request_from_iut altstep a_await_crl_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_crl_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_crl_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_crl_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_crl_http_request_from_iut altstep a_await_cpoc_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_cpoc_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { log("a_await_cpoc_http_request_from_iut: Received message on httpEcPort"); [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_cpoc_http_request_from_iut: Received message on httpCaPort"); } } // End of altstep a_await_cpoc_http_request_from_iut altstep a_await_any_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response out HttpMessage p_request ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { log("a_await_any_http_request_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_response { [PICS_MULTIPLE_END_POINT] httpCaPort.receive(p_http_message) -> value p_request { log("a_await_any_http_request_from_iut: Received message on httpEcPort"); } } // End of altstep a_await_any_http_request_from_iut Loading
lib_system/LibItsPki_TestSystem.ttcn +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ module LibItsPki_TestSystem { // LibItsSecurity import from LibItsSecurity_TestSystem all; // LibItsHttp import from LibItsHttp_TestSystem all; // LibHttp import from LibHttp_TestSystem all; group portDefinitions { Loading