Commit d19b442a authored by Yann Garcia's avatar Yann Garcia
Browse files

Rename variables & parameters

parent baa1c1f4
......@@ -23,7 +23,7 @@
<listItem>./bin</listItem>
<listItem>./src/bin</listItem>
<listItem>./src/bin/asn1</listItem>
<listItem>C:\OpenSSL-Win64\include</listItem>
<listItem>C:\ProgramFiles\OpenSSL-Win64\include</listItem>
<listItem>C:\npcap-sdk-0.1\Include</listItem>
<listItem>/Users/yann/Documents/wireshark/cygwin64/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++</listItem>
</preprocessorIncludes>
......
......@@ -5,3 +5,4 @@ data/certificates/
data/v3/certificates/
data/v3/temp/
data/v3/xer/
/bin/
......@@ -1149,7 +1149,7 @@ namespace LibItsSecurity__Functions
/**
* \brief Read the specified certificate
* \param p_certificateId the certificate identifier
* \param p_certificate_id the certificate identifier
* \param p_certificate the expected certificate
* \return true on success, false otherwise
*/
......@@ -1181,7 +1181,7 @@ namespace LibItsSecurity__Functions
/**
* \brief Read the specified certificate digest
* \param p_certificateId the certificate identifier
* \param p_certificate_id the certificate identifier
* \param p_digest the expected certificate
* \return true on success, false otherwise
*/
......@@ -1200,7 +1200,7 @@ namespace LibItsSecurity__Functions
/**
* \brief Read the whole-hash of the certificate
* \param p_certificateId the certificate identifier
* \param p_certificate_id the certificate identifier
* \param p_hash the expected certificate
* \return true on success, false otherwise
*/
......@@ -1219,7 +1219,7 @@ namespace LibItsSecurity__Functions
/**
* \brief Read the private keys for the specified certificate
* \param p_certificateId the keys identifier
* \param p_certificate_id the keys identifier
* \param p_signingPrivateKey the signing private key
* \return true on success, false otherwise
*/
......
......@@ -338,6 +338,22 @@ public:
*/
std::string trim(const std::string& p_value, const std::string& p_trim_chars = " \t");
/*!
* \brief Convert the provided string into a list of arguments
* \param[in] p_value The string value
* \param[in] p_separator The separator sequence to use for the spliting process
* \return The item list
* \code{.cc}
* std::string str = "This is a test for spliting a string with a white spave";
* std::vector<std::string> tokens = converter::get_instance().split(str, " ");
* std::clog << "Tokens: " << std::endl;
* for (auto it = tokens.begin(); it != tokens.end(); ++it) {
* std::clog << " " << *it << std::endl;
* }
* \endcode
*/
std::vector<std::string> split(const std::string & p_value, const std::string& p_separator);
/*!
* \brief Convert the provided string into a list of arguments
* \param[in] p_value The string value
......@@ -352,6 +368,6 @@ public:
* \endcode
*/
std::vector<std::string> split_arguments_line(const std::string & p_value);
static const std::string lut;
}; // End of class converter
......@@ -97,7 +97,21 @@ std::string converter::trim(const std::string& str, const std::string& whitespac
return str.substr(strBegin, strRange);
}
std::vector<std::string> converter::split(const std::string & p_value, const std::string& p_separator) {
std::vector<std::string> output;
std::size_t current, previous = 0;
current = p_value.find(p_separator);
while (current != std::string::npos) {
output.push_back(p_value.substr(previous, current - previous));
previous = current + 1;
current = p_value.find(p_separator, previous);
}
output.push_back(p_value.substr(previous, current - previous));
return output;
}
std::vector<std::string> converter::split_arguments_line(const std::string & p_value) {
std::vector<std::string> output;
std::string line = trim(p_value);
......
......@@ -71,6 +71,8 @@ const std::string& params::interface_id = std::string("interface_id");
const std::string& params::server = std::string("server");
const std::string& params::port = std::string("port");
const std::string& params::server_mode = std::string("server_mode");
const std::string& params::local_port = std::string("local_port");
const std::string& params::use_ssl = std::string("use_ssl");
const std::string& params::method = std::string("method");
const std::string& params::uri = std::string("uri");
......
......@@ -12,8 +12,6 @@
#include "LibItsHttp_MessageBodyTypes.hh"
#include "LibItsHttp_XmlMessageBodyTypes.hh"
#include "http_etsi_ieee1609dot2_codec.hh" // FIXME Work-around, to be removed
int http_codec::encode (const LibItsHttp__TypesAndValues::HttpMessage& msg, OCTETSTRING& data)
{
loggers::get_instance().log_msg(">>> http_codec::encode: ", (const Base_Type&)msg);
......@@ -367,7 +365,12 @@ int http_codec::decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValue
// Save the the body length
loggers::get_instance().log("http_codec::decode_header: decoded Content-Length %s", m[2].str().c_str());
_dc.length = std::stoi(m[2].str());
} else if (m[1].str().compare("Transfer-Encoding") == 0) {
if (m[2].str().find("chunked") != std::string::npos) {
_dc.chunked = true;
}
}
return 0;
}
catch(const std::logic_error& e) {
......@@ -377,7 +380,6 @@ int http_codec::decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValue
int http_codec::encode_body(const LibItsHttp__MessageBodyTypes::HttpMessageBody& p_message_body, OCTETSTRING& p_encoding_buffer, const std::string& p_content_type) {
loggers::get_instance().log_msg(">>> http_codec::encode_body: ", (const Base_Type&)p_message_body);
loggers::get_instance().log("http_codec::encode_body: # of codecs=%d - %p", _codecs.size(), this);
// Sanity check
if (p_content_type.empty()) {
......@@ -509,8 +511,29 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
counter += 1;
}
}
loggers::get_instance().log("http_codec::decode_body: Counter=%d", counter);
loggers::get_instance().log("http_codec::decode_body: counter=%d", counter);
body = OCTETSTRING(body.lengthof() - counter, static_cast<const unsigned char*>(body));
if (_dc.chunked) {
// Extract the size of the chunk <chunk size>\r[\n]
counter = 0;
while (counter < body.lengthof()) {
if ((body[counter].get_octet() == '\r') || (body[counter].get_octet() == '\n')) {
break;
}
counter += 1;
} // End of 'while' statement
loggers::get_instance().log("http_codec::decode_body: Chunked: counter=%d", counter);
if (counter < body.lengthof()) { // Skip additional \n
OCTETSTRING os(counter - 1, static_cast<const unsigned char*>(body));
loggers::get_instance().log_msg("http_codec::decode_body: os: ", os);
int len = oct2int(os);
loggers::get_instance().log("http_codec::decode_body: Chunk len: %d", len);
if (body[counter].get_octet() == '\n') {
counter += 1;
}
body = OCTETSTRING(len, counter + static_cast<const unsigned char*>(body));
}
}
loggers::get_instance().log_msg("http_codec::decode_body: Finalised body=", body);
// Check if HTTP message body contains binary characters
for (int i = 0; i < body.lengthof(); i++) {
......@@ -561,12 +584,13 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
// Convert into string
params p;
p["decode_str"] = std::string(static_cast<const unsigned char*>(body), body.lengthof() + static_cast<const unsigned char*>(body));
loggers::get_instance().log("http_codec::decode_body: decode_str: %s", p["decode_str"].c_str());
// Try to identify xml
if (p["decode_str"].find("<?xml version=") != std::string::npos) {
loggers::get_instance().log("http_codec::decode_body: Find xml message");
LibItsHttp__XmlMessageBodyTypes::XmlBody xml_body;
// TODO To be refined adding a string identifier to check which codec to use. E.g. held_code.id() returns "xmlns=\"urn:ietf:params:xml:ns:geopriv:held\">"
if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:geopriv:held\">") != std::string::npos) {
if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:geopriv:held\"") != std::string::npos) {
loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:geopriv:held'");
if (_codecs["held"].get() != nullptr) {
loggers::get_instance().log("http_codec::decode_body: Call 'held_codec'");
......@@ -582,8 +606,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
}
message_body.xml__body() = xml_body;
} else if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:lost1\">") != std::string::npos) {
loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:loat1'");
} else if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:lost1\"") != std::string::npos) {
loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:lost1'");
if (_codecs["lost"].get() != nullptr) {
loggers::get_instance().log("http_codec::decode_body: Call 'lost_codec'");
if (_codecs["lost"]->decode(body, (Record_Type&)xml_body, &p) == -1) {
......@@ -598,7 +622,11 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
}
message_body.xml__body() = xml_body;
}
} else {
loggers::get_instance().warning("http_codec::decode_body: No XML codec found");
xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
message_body.xml__body() = xml_body;
}
} else if (p["decode_str"].find("<html>") != std::string::npos) { // Try to identify HTML
loggers::get_instance().log("http_codec::decode_body: Find html message");
LibItsHttp__MessageBodyTypes::HtmlBody html_body;
......
......@@ -32,9 +32,10 @@ struct encoding_context {
struct decoding_context {
unsigned int length;
unsigned char is_binary;
bool chunked;
decoding_context() { reset(); };
void reset() { length = -1; is_binary = 0x00; };
void reset() { length = -1; is_binary = 0x00; chunked = false; };
};
class http_codec: public codec <
......@@ -46,7 +47,7 @@ LibItsHttp__TypesAndValues::HttpMessage>
std::map<std::string, std::unique_ptr<codec<Record_Type, Record_Type> > > _codecs;
public:
explicit http_codec() : codec<LibItsHttp__TypesAndValues::HttpMessage, LibItsHttp__TypesAndValues::HttpMessage>(), _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
......@@ -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() {
......
......@@ -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.
* <pre>
* 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 {