Commit 56d65ed3 authored by Yann Garcia's avatar Yann Garcia
Browse files

Review Pki Test System

parent 58663d0c
......@@ -25,9 +25,7 @@ module LibItsHttp_BinaryMessageBodyTypes {
type union BinaryBody {
// TODO Add here your custom variants
// InnerEcRequest innerEcRequest, Move to PkiPort
// InnerEcResponse innerEcResponse,
Ieee1609Dot2Data ieee1609dot2_data
Ieee1609Dot2Data ieee1609dot2_data,
octetstring raw
} with {
variant ""
......
module LibItsHttp_Functions {
// LibCommon
import from LibCommon_Time all;
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Pics all;
import from LibItsHttp_TestSystem all;
function f_init_default_headers_list(
out HeaderLines p_headers
) {
p_headers[0] := { c_header_host, { PICS_HEADER_HOST } };
p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } };
p_headers[2] := { c_header_content_length, { "0" } };
p_headers[3] := { c_header_connection, { "keep-alive" } };
p_headers[4] := { c_header_pragma, { "no-cache" } };
p_headers[5] := { c_header_cache_control, { "no-cache" } };
} // End of function f_init_default_headers_list
group http_preambles {
/**
* @desc Setups default configuration
* @param p_certificateId The certificate identifier the TA shall use in case of secured IUT
*/
function f_cfUp(
in charstring p_certificateId
) runs on HttpComponent /* TITAN TODO: system HttpTestAdapter */ {
map(self:httpPort, system:httpPort);
f_connect4SelfOrClientSync();
} // End of function f_cfUp
} // End of group http_preambles
function f_remove_headears_list(
in charstring_list p_headers_to_remove,
inout HeaderLines p_headers
) {
// Sanity checks
if (lengthof(p_headers_to_remove) == 0) {
return;
} else if (lengthof(p_headers) == 0) {
return;
}
for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) {
group http_postambles {
/**
* @desc Deletes default configuration
*/
function f_cfDown() runs on HttpComponent /* TITAN TODO: system HttpTestAdapter */ {
for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) {
if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) {
p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it
}
} // End of 'for' statement
} // End of 'for' statement
} // End of function f_init_default_headers_list
unmap(self:httpPort, system:httpPort);
f_disconnect4SelfOrClientSync();
} // End of function f_cfDown
} // End of group http_postambles
group http_headers {
function f_init_default_headers_list(
out HeaderLines p_headers
) {
p_headers[0] := { c_header_host, { PICS_HEADER_HOST } };
p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } };
p_headers[2] := { c_header_content_length, { "0" } };
p_headers[3] := { c_header_connection, { "keep-alive" } };
p_headers[4] := { c_header_pragma, { "no-cache" } };
p_headers[5] := { c_header_cache_control, { "no-cache" } };
} // End of function f_init_default_headers_list
function f_remove_headears_list(
in charstring_list p_headers_to_remove,
inout HeaderLines p_headers
) {
// Sanity checks
if (lengthof(p_headers_to_remove) == 0) {
return;
} else if (lengthof(p_headers) == 0) {
return;
}
for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) {
for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) {
if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) {
p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it
}
} // End of 'for' statement
} // End of 'for' statement
} // End of function f_init_default_headers_list
} // End of group http_headers
} // End of module LibItsHttp_Functions
......@@ -49,7 +49,7 @@ module LibItsPki_Templates {
} // End of template m_enrolmentRequest
template (present) EtsiTs102941DataContent mw_enrolmentResponse(
template (present) InnerEcResponse p_enrolmentResponse
template (present) InnerEcResponse p_enrolmentResponse := ?
) := {
enrolmentResponse := p_enrolmentResponse
} // End of template mw_enrolmentResponse
......
......@@ -28,31 +28,44 @@ module LibItsPki_TestSystem {
import from EtsiTs102941MessagesItss language "ASN.1:1997" all;
import from EtsiTs103097Module language "ASN.1:1997" all;
// LibItsHttp
import from LibItsHttp_TestSystem all;
// LibItsSecurity
import from LibItsSecurity_TestSystem all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
// LibItsHttp
import from LibItsHttp_TestSystem all;
type port PkiPort message {
inout InnerEcRequest, InnerEcResponse;
}
type component ItsPkiSystem {
port HttpPort httpPort;
port PkiPort pkiPort;
} // End of component ItsPkiSystem
type component ItsPkiSystemItss extends ItsPkiSystem {
type component ItsPkiHttpSystem extends HttpTestAdapter{
} // End of component ItsPkiHttpSystem
type component ItsPkiItssSystem extends ItsPkiSystem {
port LibItsGeoNetworking_TestSystem.AdapterControlPort acPort;
port LibItsGeoNetworking_TestSystem.UpperTesterPort utPort;
port GeoNetworkingPort geoNetworkingPort;
} // End of component ItsPkiSystemItss
} // End of component ItsPkiItssSystem
type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc {
port HttpPort httpPort;
port PkiPort pkiPort;
var Certificate vc_eaCertificate; /** Test Adapter EA certificate */
} // End of component ItsPki
type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent {
var Certificate vc_eaCertificate; /** Test Adapter EA certificate */
} // End of component ItsPki
type component ItsPkiItss extends ItsGeoNetworking {
port HttpPort httpPort;
port PkiPort pkiPort;
} // End of component ItsPkiItss
} // End of module LibItsPki_TestSystem
......@@ -2359,6 +2359,9 @@ module LibItsSecurity_Functions {
*/
external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring;
external function fx_signWithEcdsaNistp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring;
external function fx_signWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring;
/**
* @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature
* @param p_toBeSignedSecuredMessage The data to be signed
......
......@@ -1005,6 +1005,11 @@ module LibItsSecurity_Templates {
requestedCertificate := *
} // End of template mw_headerInfo_gn
template (omit) HeaderInfo m_headerInfo_inner_ec_request(
in template (value) Psid p_psid := c_its_aid_GN,
in template (value) Time64 p_generationTime
) modifies m_ieee1609Dot2_headerInfo := {};
} // End of group headerFields
group signatures {
......
Supports Markdown
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