(), _ec(), _dc(), _codecs() { };
- virtual ~http_codec() { _codecs.clear(); };
+ virtual ~http_codec() { };
virtual int encode (const LibItsHttp__TypesAndValues::HttpMessage&, OCTETSTRING& data);
virtual int decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::HttpMessage&, params* params = NULL);
@@ -60,7 +61,7 @@ private:
int decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::HeaderLines& headers);
int decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::HeaderLine& header);
- int decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBodyTypes::HttpMessageBody& message_body, const std::string& p_content_type);
+ int decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBodyTypes::HttpMessageBody& message_body);
int get_line(TTCN_Buffer& buffer, CHARSTRING& to, const bool concatenate_header_lines = false);
}; // End of class http_codec
diff --git a/ccsrc/Protocols/Http/http_layer_factory.hh b/ccsrc/Protocols/Http/http_layer_factory.hh
index bb136e43441d9ee4ca59c65dcd4ee7396bdd24df..b6ebebdf7e377825f63961f0f710fa372ee22d66 100644
--- a/ccsrc/Protocols/Http/http_layer_factory.hh
+++ b/ccsrc/Protocols/Http/http_layer_factory.hh
@@ -23,7 +23,7 @@ class http_layer_factory : public layer_factory {
public: //! \publicsection
/*!
* \brief Default constructor
- * Create a new instance of the udp_layer_factory class
+ * Create a new instance of the http_layer_factory class
* \remark The HTTP layer identifier is HTTP
*/
http_layer_factory() {
diff --git a/ttcn/AtsPki/ItsPki_TestCases.ttcn b/ttcn/AtsPki/ItsPki_TestCases.ttcn
index 5c4683407c0df82da2e05aab142bce8445f11c59..cd902ba23962f06ae0d64b68e2586f9c3f534913 100644
--- a/ttcn/AtsPki/ItsPki_TestCases.ttcn
+++ b/ttcn/AtsPki/ItsPki_TestCases.ttcn
@@ -100,10 +100,10 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_ITSS_ENR_BV_01() runs on ItsMtc /*system ItsPkiItssSystem*/ {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyX;
- var Oct32 v_publicKeyY;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_key_x;
+ var Oct32 v_public_key_y;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var ItsPkiItss v_itss;
var ItsPkiHttp v_ea;
@@ -116,13 +116,13 @@ module ItsPki_TestCases {
// Test component configuration
- if (f_generate_key_pair_nistp256(v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode) == false) {
+ if (f_generate_key_pair_nistp256(v_private_key, v_public_key_x, v_public_key_y, v_public_compressed_key, v_compressed_mode) == false) {
log("*** " & testcasename() & ": FAIL: Failed to setup InnerEcRequest message ***")
setverdict(inconc);
stop;
}
- v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
- v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
+ v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(cc_taCert_A, v_private_key, v_public_compressed_key, v_compressed_mode));
+ v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(cc_taCert_A, v_private_key, v_public_compressed_key, v_compressed_mode));
// Synchronization
f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
@@ -137,7 +137,7 @@ module ItsPki_TestCases {
in charstring p_certificate_id,
in octetstring p_private_key,
in octetstring p_publicKeyCompressed,
- in integer p_compressedMode
+ in integer p_compressed_mode
) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
// Local variables
@@ -147,7 +147,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressedMode);
+ f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressed_mode);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
@@ -161,7 +161,7 @@ module ItsPki_TestCases {
in charstring p_certificate_id,
in octetstring p_private_key,
in octetstring p_publicKeyCompressed,
- in integer p_compressedMode
+ in integer p_compressed_mode
) runs on ItsPkiHttp /*system ItsPkiHttpSystem*/ {
// Local variable
var HttpMessage v_response;
@@ -253,10 +253,10 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_ITSS_ENR_BV_02() runs on ItsMtc /*system ItsPkiItssSystem*/ {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyX;
- var Oct32 v_publicKeyY;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_key_x;
+ var Oct32 v_public_key_y;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var ItsPkiItss v_itss;
var ItsPkiHttp v_ea;
@@ -269,13 +269,13 @@ module ItsPki_TestCases {
// Test component configuration
- if (f_generate_key_pair_nistp256(v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode) == false) {
+ if (f_generate_key_pair_nistp256(v_private_key, v_public_key_x, v_public_key_y, v_public_compressed_key, v_compressed_mode) == false) {
log("*** " & testcasename() & ": FAIL: Failed to setup InnerEcRequest message ***")
setverdict(inconc);
stop;
}
- v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
- v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
+ v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(cc_taCert_A, v_private_key, v_public_compressed_key, v_compressed_mode));
+ v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(cc_taCert_A, v_private_key, v_public_compressed_key, v_compressed_mode));
// Synchronization
f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
@@ -290,7 +290,7 @@ module ItsPki_TestCases {
in charstring p_certificate_id,
in octetstring p_private_key,
in octetstring p_publicKeyCompressed,
- in integer p_compressedMode
+ in integer p_compressed_mode
) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
// Local variables
@@ -300,7 +300,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressedMode);
+ f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressed_mode);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
@@ -314,7 +314,7 @@ module ItsPki_TestCases {
in charstring p_certificate_id,
in octetstring p_private_key,
in octetstring p_publicKeyCompressed,
- in integer p_compressedMode
+ in integer p_compressed_mode
) runs on ItsPkiHttp /*system ItsPkiHttpSystem*/ {
// Local variable
var HttpMessage v_response;
@@ -406,8 +406,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_01() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Oct16 v_encrypted_sym_key;
var Oct16 v_aes_sym_key;
@@ -432,7 +432,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
@@ -521,8 +521,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_02() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Oct16 v_encrypted_sym_key;
var Oct16 v_aes_sym_key;
@@ -547,7 +547,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
@@ -641,8 +641,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_03() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -667,7 +667,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -757,8 +757,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_04() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -783,7 +783,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -818,7 +818,7 @@ module ItsPki_TestCases {
log("*** " & testcasename() & ": LOG: Receive ", v_etsi_ts_102941_data, " ***");
log("*** " & testcasename() & ": DEBUG: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log
if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16))))) {
- if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_publicKeyCompressed, v_compressedMode)) {
+ if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_public_compressed_key, v_compressed_mode)) {
log("*** " & testcasename() & ": PASS: Well-secured EA certificate received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
} else {
@@ -843,7 +843,7 @@ module ItsPki_TestCases {
} // End of testcase TC_SEC_PKI_SND_EA_BV_04
/**
- * @desc Within the headerInfo of the tbsData, the psid shall be set to “secured certificate request” as assigned in
+ * @desc Within the headerInfo of the tbsData, the psid shall be set to “secured certificate request� as assigned in
* ETSI TS 102 965 and the generationTime shall be present.
*
* Pics Selection: PICS_IUT_EA_ROLE
@@ -870,8 +870,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_05() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -896,7 +896,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -931,7 +931,7 @@ module ItsPki_TestCases {
log("*** " & testcasename() & ": LOG: Receive ", v_etsi_ts_102941_data, " ***");
log("*** " & testcasename() & ": DEBUG: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log
if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16))))) {
- if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_publicKeyCompressed, v_compressedMode)) {
+ if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_public_compressed_key, v_compressed_mode)) {
log("*** " & testcasename() & ": PASS: Well-secured EA certificate received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
} else {
@@ -982,8 +982,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_06() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -1008,7 +1008,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1043,7 +1043,7 @@ module ItsPki_TestCases {
log("*** " & testcasename() & ": LOG: Receive ", v_etsi_ts_102941_data, " ***");
log("*** " & testcasename() & ": DEBUG: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log
if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16))))) {
- if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_publicKeyCompressed, v_compressedMode)) {
+ if (f_verify_ea_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, v_public_compressed_key, v_compressed_mode)) {
log("*** " & testcasename() & ": PASS: Well-secured EA certificate received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
} else {
@@ -1094,8 +1094,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_07() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -1120,7 +1120,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1202,8 +1202,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_08() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -1228,7 +1228,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1308,8 +1308,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_09() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -1334,7 +1334,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_inner_ec_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_inner_ec_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1414,8 +1414,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_10() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var Oct16 v_aes_sym_key;
@@ -1440,7 +1440,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_invalid_enrolment_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_invalid_enrolment_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1495,7 +1495,7 @@ module ItsPki_TestCases {
} // End of group enrolment_response
- group authorization_vaidation_response {
+ group authorization_validation_response {
/**
* @desc The AuthorizationValidationResponse message shall be sent by the EA to the AA across the interface
@@ -1524,8 +1524,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_11() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var HeaderLines v_headers;
var HttpMessage v_response;
@@ -1543,7 +1543,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_authorization_validation_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_ieee1609dot2_signed_and_encrypted_data);
+ f_http_build_authorization_validation_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_ieee1609dot2_signed_and_encrypted_data);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1611,8 +1611,8 @@ module ItsPki_TestCases {
testcase TC_SEC_PKI_SND_EA_BV_12() runs on ItsPkiHttp system ItsPkiHttpSystem {
// Local variables
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var HeaderLines v_headers;
var HttpMessage v_response;
@@ -1630,7 +1630,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_http_build_authorization_validation_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_ieee1609dot2_signed_and_encrypted_data);
+ f_http_build_authorization_validation_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_ieee1609dot2_signed_and_encrypted_data);
f_init_default_headers_list(-, "inner_ec_request", v_headers);
httpPort.send(
m_http_request(
@@ -1671,25 +1671,87 @@ module ItsPki_TestCases {
} // End of testcase TC_SEC_PKI_SND_EA_BV_12
- } // End of group authorization_vaidation_response
+ } // End of group authorization_validation_response
} // End of group ea_behavior
group aa_behavior {
group authorization_request {
-
-
- testcase TC_SEC_PKI_SND_AA_BV_00() runs on ItsPkiHttp system ItsPkiHttpSystem {
+
+ /**
+ * @desc Check that the EA/AA is able to decrypt the AuthorizationRequest message using the encryption private key corresponding to the recipient certificate
+ * Check that the EA/AA is able to verify the inner signature
+ * Check that the EA/AA is able to verify the request authenticity using the hmacKey verification
+ * Check that the EA/AA sends the AuthorizationValidationRequest message to the correspondent EA
+ *
+ * Pics Selection: PICS_IUT_COMBINED_EA_AA_ROLE
+ * Initial conditions:
+ * with {
+ * the EA/AA in "operational state"
+ * authorized with the certificate CERT_AA
+ * containing encryptionKey (AA_ENC_PUB_KEY)
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the IUT receives an EtsiTs103097Data message
+ * containing content.encryptedData
+ * containing recipients
+ * containing the instance of RecipientInfo
+ * containing certRecipInfo
+ * containing recipientId
+ * indicating HashedId8 of the certificate CERT_AA
+ * and containing encKey
+ * indicating symmetric key (S_KEY)
+ * encrypted with the private key correspondent to the AA_ENC_PUB_KEY
+ * and containing cyphertext (ENC_DATA)
+ * containing encrypted representation of the EtsiTs103097Data-Signed
+ * containing content.signedData
+ * containing hashId
+ * indicating valid hash algorythm
+ * and containing signer
+ * containing self
+ * and containing tbsData (SIGNED_DATA)
+ * containing payload
+ * containing EtsiTs102941Data
+ * containing content.authorizationRequest
+ * containing publicKeys.verificationKey (V_KEY)
+ * and containing hmacKey (HMAC)
+ * and containing sharedAtRequest
+ * containing keyTag (KEY_TAG)
+ * and containing eaId (EA_ID)
+ ( indicating HashedId8 of the known EA certificate
+ * and containing signature (SIGNATURE)
+ * }
+ * then {
+ * the IUT is able to decrypt the S_KEY
+ * using the private key
+ * corresponding to the AA_ENC_PUB_KEY
+ * and the IUT is able to decrypt the cypthertext ENC_DATA
+ * using the S_KEY
+ * and the IUT is able to verify the signature SIGNATURE over the SIGNED_DATA
+ * using the V_KEY
+ * and the IUT is able to verify integrity of HMAC and KEY_TAG
+ * and the IUT sends the AuthorizationValidationRequest message to the EA
+ * identified by the EA_ID
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS ITS-00546v006 TP BV
+ * @reference ETSI TS 102 941, clause 6.2.3.3.1
+ */
+ testcase TC_SEC_PKI_SND_EA_AA_BV_01() runs on ItsPkiHttp system ItsPkiHttpSystem {
var Oct32 v_private_key_ec;
- var Oct32 v_publicKeyCompressed_ec;
- var integer v_compressedMode_ec;
+ var Oct32 v_public_compressed_key_ec;
+ var integer v_compressed_mode_ec;
var Oct32 v_private_key_at;
- var Oct32 v_publicKeyCompressed_at;
- var integer v_compressedMode_at;
+ var Oct32 v_public_compressed_key_at;
+ var integer p_compressed_mode_at;
var Oct32 v_private_enc_key_at;
- var Oct32 v_publicEncKeyCompressed_at;
- var integer v_compressedEncMode_at;
+ var Oct32 v_public_compressed_enc_key_at;
+ var integer v_compressed_enc_mode_at;
var Oct32 v_request_hash;
var Oct16 v_encrypted_sym_key;
var Oct16 v_aes_sym_key;
@@ -1715,68 +1777,17 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- f_init_default_headers_list(-, "inner_ec_request", v_headers);
- // TODO Create a f_await_http_inner_ec_request_response(v_private_key_ec, v_publicKeyCompressed_ec, v_compressedMode_ec, v_inner_ec_response);
- f_http_build_inner_ec_request(v_private_key_ec, v_publicKeyCompressed_ec, v_compressedMode_ec, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
- httpPort.send(
- m_http_request(
- m_http_request_post(
- PICS_HTTP_POST_URI,
- v_headers,
- m_http_message_body_binary(
- m_binary_body_ieee1609dot2_data(
- v_ieee1609dot2_signed_and_encrypted_data
- )))));
- tc_ac.start;
- alt {
- [] httpPort.receive(
- mw_http_response(
- mw_http_response_ok(
- mw_http_message_body_binary(
- mw_binary_body_ieee1609dot2_data(
- mw_enrolmentResponseMessage(
- mw_encryptedData(
- -,
- mw_SymmetricCiphertext_aes128ccm
- ))))))) -> value v_response {
- tc_ac.stop;
-
- if (f_verify_pki_message(v_private_key_ec, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) {
- log("*** " & testcasename() & ": FAIL: Failed to verify PKI message ***");
- f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
- } else {
- log("*** " & testcasename() & ": LOG: Receive ", v_etsi_ts_102941_data, " ***");
- log("*** " & testcasename() & ": DEBUG: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log
- if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256))))) {
- v_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse;
- log("*** " & testcasename() & ": INFO: Well-secured EA certificate received ***");
- log("v_inner_ec_response= ", v_inner_ec_response);
- f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
- } else {
- log("*** " & testcasename() & ": FAIL: Unexpected message received ***");
- f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
- }
- }
- }
- [] httpPort.receive(
- mw_http_response(
- mw_http_response_ko
- )) {
- tc_ac.stop;
-
- log("*** " & testcasename() & ": FAIL: Unexpected message received ***");
- f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
- }
- [] tc_ac.timeout {
- log("*** " & testcasename() & ": INCONC: Expected message not received ***");
- f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
- }
- } // End of 'alt' statement
+ if (f_await_http_inner_ec_request_response(v_private_key_ec, v_public_compressed_key_ec, v_compressed_mode_ec, v_inner_ec_response) == true) {
+ log("*** " & testcasename() & ": INFO: Enrolment succeed ***");
+ f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
+ } else {
+ log("*** " & testcasename() & ": INCONC: Enrolment failed ***");
+ f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
+ }
// Test Body
- f_http_build_authorization_request(v_inner_ec_response.certificate, v_private_key_ec, v_private_key_at, v_publicKeyCompressed_at, v_compressedMode_at, v_private_enc_key_at, v_publicEncKeyCompressed_at, v_compressedEncMode_at, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_authorization_request(v_inner_ec_response.certificate, v_private_key_ec, v_private_key_at, v_public_compressed_key_at, p_compressed_mode_at, v_private_enc_key_at, v_public_compressed_enc_key_at, v_compressed_enc_mode_at, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_set_headears_list({c_header_content_text}, {"authorization_request"}, v_headers);
- log("v_headers= ", v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
@@ -1825,9 +1836,7 @@ module ItsPki_TestCases {
// Postamble
f_cfHttpDown();
-
- }
-
+ } // End of testcase TC_SEC_PKI_SND_EA_AA_BV_01
/**
* @desc Check that the AA is able to decrypt the AuthorizationRequest message using the encryption private key corresponding to the recipient certificate
@@ -1893,12 +1902,24 @@ module ItsPki_TestCases {
* @reference ETSI TS 102 941, clause 6.2.3.3.1
*/
testcase TC_SEC_PKI_SND_AA_BV_01() runs on ItsPkiHttp system ItsPkiHttpSystem {
- var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_private_key_ec;
+ var Oct32 v_public_compressed_key_ec;
+ var integer v_compressed_mode_ec;
+ var Oct32 v_private_key_at;
+ var Oct32 v_public_compressed_key_at;
+ var integer p_compressed_mode_at;
+ var Oct32 v_private_enc_key_at;
+ var Oct32 v_public_compressed_enc_key_at;
+ var integer v_compressed_enc_mode_at;
var Oct32 v_request_hash;
+ var Oct16 v_encrypted_sym_key;
+ var Oct16 v_aes_sym_key;
+ var Oct16 v_authentication_vector;
+ var Oct12 v_nonce;
+ var octetstring v_salt;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var HeaderLines v_headers;
+ var InnerEcResponse v_inner_ec_response;
var HttpMessage v_response;
var EtsiTs102941Data v_etsi_ts_102941_data;
@@ -1910,16 +1931,14 @@ module ItsPki_TestCases {
}
// Test component configuration
- f_cfHttpUp(
- PICS_TS_CERTIFICATE_ID, // TS role is ITS-S
- PICS_IUT_AA_CERTIFICATE_ID // Peer certificate, IUT
- );
+ f_cfHttpUp(PICS_TS_EA_CERTIFICATE_ID, PICS_TS_AA_CERTIFICATE_ID);
// Test adapter configuration
// Preamble
- // TODO f_http_build_inner_at_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
- f_init_default_headers_list(-, -, v_headers);
+ f_http_build_inner_ec_request(v_private_key_ec, v_public_compressed_key_ec, v_compressed_mode_ec, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_http_build_authorization_request(v_inner_ec_response.certificate, v_private_key_ec, v_private_key_at, v_public_compressed_key_at, p_compressed_mode_at, v_private_enc_key_at, v_public_compressed_enc_key_at, v_compressed_enc_mode_at, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ f_init_default_headers_list(-, "authorization_request", v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
@@ -2024,8 +2043,8 @@ module ItsPki_TestCases {
*/
testcase TC_SEC_PKI_SND_AA_BV_02() runs on ItsPkiHttp system ItsPkiHttpSystem {
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var HeaderLines v_headers;
@@ -2048,7 +2067,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- // TODO f_http_build_inner_at_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ // TODO f_http_build_inner_at_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
@@ -2138,8 +2157,8 @@ module ItsPki_TestCases {
*/
testcase TC_SEC_PKI_SND_AA_BV_03() runs on ItsPkiHttp system ItsPkiHttpSystem {
var Oct32 v_private_key;
- var Oct32 v_publicKeyCompressed;
- var integer v_compressedMode;
+ var Oct32 v_public_compressed_key;
+ var integer v_compressed_mode;
var Oct32 v_request_hash;
var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data;
var HeaderLines v_headers;
@@ -2162,7 +2181,7 @@ module ItsPki_TestCases {
// Test adapter configuration
// Preamble
- // TODO f_http_build_inner_at_request(v_private_key, v_publicKeyCompressed, v_compressedMode, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
+ // TODO f_http_build_inner_at_request(v_private_key, v_public_compressed_key, v_compressed_mode, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash);
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
diff --git a/ttcn/AtsPki/ItsPki_TestControl.ttcn b/ttcn/AtsPki/ItsPki_TestControl.ttcn
index b60cc5e37b45e1bed9a053a474d411d01d80e906..a37222f706c92cd444123acba7adca2bebcb27b9 100644
--- a/ttcn/AtsPki/ItsPki_TestControl.ttcn
+++ b/ttcn/AtsPki/ItsPki_TestControl.ttcn
@@ -12,7 +12,7 @@ module ItsPki_TestControl {
execute(TC_SEC_PKI_ITSS_ENR_BV_01());
}
- if (PICS_IUT_EA_ROLE) {
+ if (PICS_IUT_EA_ROLE or PICS_IUT_COMBINED_EA_AA_ROLE) {
execute(TC_SEC_PKI_SND_EA_BV_01());
execute(TC_SEC_PKI_SND_EA_BV_02());
execute(TC_SEC_PKI_SND_EA_BV_03());
@@ -23,12 +23,17 @@ module ItsPki_TestControl {
execute(TC_SEC_PKI_SND_EA_BV_08());
execute(TC_SEC_PKI_SND_EA_BV_09());
execute(TC_SEC_PKI_SND_EA_BV_10());
+ execute(TC_SEC_PKI_SND_EA_BV_11());
+ execute(TC_SEC_PKI_SND_EA_BV_12());
}
-
- if (PICS_IUT_AA_ROLE) {
- execute(TC_SEC_PKI_SND_AA_BV_01());
- execute(TC_SEC_PKI_SND_AA_BV_02());
- execute(TC_SEC_PKI_SND_AA_BV_03());
+
+ if (PICS_IUT_COMBINED_EA_AA_ROLE) {
+ execute(TC_SEC_PKI_SND_EA_AA_BV_01());
+ }
+ if (PICS_IUT_AA_ROLE) {
+ execute(TC_SEC_PKI_SND_AA_BV_01());
+ execute(TC_SEC_PKI_SND_AA_BV_02());
+ execute(TC_SEC_PKI_SND_AA_BV_03());
}
} // End of 'control' statement
diff --git a/ttcn/LibIts b/ttcn/LibIts
index b745c0b23fc463ff118fc60c06831711651b77ec..b1e9bdd7e3007035abfa808cf21ea00c772aa127 160000
--- a/ttcn/LibIts
+++ b/ttcn/LibIts
@@ -1 +1 @@
-Subproject commit b745c0b23fc463ff118fc60c06831711651b77ec
+Subproject commit b1e9bdd7e3007035abfa808cf21ea00c772aa127
diff --git a/ttcn/TestCodec/TestCodec_Pki.ttcn b/ttcn/TestCodec/TestCodec_Pki.ttcn
index b74b7b826ffbc8863ed8ac21471788209eb057a3..85690cbebde2240e0925db18a6b95be7874af09a 100644
--- a/ttcn/TestCodec/TestCodec_Pki.ttcn
+++ b/ttcn/TestCodec/TestCodec_Pki.ttcn
@@ -641,7 +641,7 @@ module TestCodec_Pki {
setverdict(fail, "f_generate_ec_certificate");
stop;
}
- v_ret := false;//f_generate_inner_at_request(v_cert_iut_a_ea, v_hashed_id8_cert_iut_a_ea, v_ec_certificate, v_private_key, v_public_key_x, v_public_key_y, p_compressedMode, p_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request);
+ v_ret := false;//f_generate_inner_at_request(v_cert_iut_a_ea, v_hashed_id8_cert_iut_a_ea, v_ec_certificate, v_private_key, v_public_key_x, v_public_key_y, p_compressed_mode, p_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request);
if (v_ret == true) {
setverdict(pass);
} else {