Commit e92f57ae authored by Denis Filatov's avatar Denis Filatov
Browse files

Merge branch 'STF525' of https://forge.etsi.org/gitlab/ITS/ITS into STF525

parents 666b151f d51a1e64
......@@ -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/
......@@ -688,6 +688,7 @@ namespace LibItsSecurity__Functions
* \param[out] p__encrypted__sym__key The encrypted AES 128 symmetric key
* \param[out] p__authentication__vector The tag of the encrypted AES 128 symmetric key
* \param[out] p__nonce The nonce vector
* \param[in] p__use__hardcoded__values In debug mode, set to true to use hardcoded values
* \return The original message
* \see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES
* \see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/
......@@ -696,25 +697,26 @@ namespace LibItsSecurity__Functions
// TODO Use common function for both fx__encryptWithEciesxxx and fx__decryptWithEciesxxx function
OCTETSTRING fx__encryptWithEciesNistp256WithSha256(const OCTETSTRING& p__toBeEncryptedSecuredMessage, const OCTETSTRING& p__recipientsPublicKeyCompressed, const INTEGER& p__compressedMode, const OCTETSTRING& p__salt, OCTETSTRING& p__publicEphemeralKeyCompressed, INTEGER& p__ephemeralCompressedMode,OCTETSTRING& p__aes__sym__key, OCTETSTRING& p__encrypted__sym__key, OCTETSTRING& p__authentication__vector, OCTETSTRING& p__nonce, const BOOLEAN& p__use__hardcoded__values) {
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: p__toBeEncryptedSecuredMessage: ", p__toBeEncryptedSecuredMessage);
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: p__recipientsPublicKeyCompressed", p__recipientsPublicKeyCompressed);
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: p__recipientsPublicKeyCompressed: ", p__recipientsPublicKeyCompressed);
loggers::get_instance().log(">>> fx__encryptWithEciesNistp256WithSha256: p__compressedMode: %d", static_cast<int>(p__compressedMode));
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: p__salt", p__salt);
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: p__salt: ", p__salt);
loggers::get_instance().log(">>> fx__encryptWithEciesNistp256WithSha256: p__use__hardcoded__values: %x", static_cast<const boolean>(p__use__hardcoded__values));
// 1. Generate new Private/Public Ephemeral key
std::unique_ptr<security_ecc> ec;
if (!p__use__hardcoded__values) {
if (!static_cast<const boolean>(p__use__hardcoded__values)) {
ec.reset(new security_ecc(ec_elliptic_curves::nist_p_256));
if (ec->generate() == -1) {
loggers::get_instance().warning("fx__encryptWithEciesNistp256WithSha256: Failed to generate ephemeral keys");
return OCTETSTRING(0, nullptr);
}
} else {
ec.reset(new security_ecc(ec_elliptic_curves::nist_p_256, str2oct("EE9CC7FBD9EDECEA41F7C8BD258E8D2E988E75BD069ADDCA1E5A38E534AC6818"), str2oct("5AE3C8D9FE0B1FC7438F29417C240F8BF81C358EC1A4D0C6E98D8EDBCC714017"))); // Private/Public ephemeral keys
ec.reset(new security_ecc(ec_elliptic_curves::nist_p_256, str2oct("0722B39ABC7B6C5301CA0408F454F81553D7FE59F492DBF385B6B6D1F81E0F68"))); // Hardcoded private key
}
// 2. Generate and derive shared secret based on recipient's private keys
security_ecc ec_comp(ec_elliptic_curves::nist_p_256, p__recipientsPublicKeyCompressed, (static_cast<int>(p__compressedMode) == 0) ? ecc_compressed_mode::compressed_y_0 : ecc_compressed_mode::compressed_y_1);
if (p__use__hardcoded__values) {
ec_comp.symmetric_encryption_key(str2oct("A6342013D623AD6C5F6882469673AE33"));
if (static_cast<const boolean>(p__use__hardcoded__values)) { // Set AES encryption key to an harcoded value
ec->symmetric_encryption_key(str2oct("5A4E63B247C714644E85CAC49BD26C81"));
}
if (ec->generate_and_derive_ephemeral_key(encryption_algotithm::aes_128_ccm, ec_comp.public_key_x(), ec_comp.public_key_y(), p__salt) == -1) {
loggers::get_instance().warning("fx__encryptWithEciesNistp256WithSha256: Failed to generate and derive secret key");
......@@ -1147,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
*/
......@@ -1179,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
*/
......@@ -1198,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
*/
......@@ -1217,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
......@@ -79,6 +79,9 @@ public: //! \publicsection
static const std::string& server; //! HTTP server address (e.g. www.etsi.org)
static const std::string& port; //! HTTP server port. Default: 80
static const std::string& use_ssl; //! Set to 1 to use SSL to communicate with the HTTP server. Default: false
static const std::string& server_mode; //! Does the test sytem acting as a server. Default: 0
static const std::string& local_port; //! Local listener port. Default: 80
static const std::string& method; //! HTTP method type. Default: POST
static const std::string& uri; //! HTTP URI value. Default: /
static const std::string& host; //! HTTP Host value. Default: 127.0.0.1
......
......@@ -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);
......
......@@ -72,6 +72,9 @@ 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::use_ssl = std::string("use_ssl");
const std::string& params::server_mode = std::string("server_mode");
const std::string& params::local_port = std::string("local_port");
const std::string& params::method = std::string("method");
const std::string& params::uri = std::string("uri");
const std::string& params::host = std::string("host");
......
......@@ -13,7 +13,7 @@ class TTCN_EncDec;
int geonetworking_codec::encode (const LibItsGeoNetworking__TypesAndValues::GeoNetworkingPdu& msg, OCTETSTRING& data)
{
loggers::get_instance().log_msg(">>> geonetworking_codec::encode: ", (const Base_Type&)msg);
loggers::get_instance().log_msg(">>> geonetworking_codec::encode (1): ", (const Base_Type&)msg);
TTCN_EncDec::clear_error();
TTCN_Buffer encoding_buffer;
......@@ -31,7 +31,7 @@ int geonetworking_codec::encode (const LibItsGeoNetworking__TypesAndValues::GeoN
data = replace(data, _ec.get_length_position(), rpl.lengthof(), rpl);
loggers::get_instance().log_msg("geonetworking_codec::encode: after replace: ", data);
}
loggers::get_instance().log_msg("geonetworking_codec::decode: After encoding: ", data);
loggers::get_instance().log_msg("geonetworking_codec::encode: After encoding: ", data);
loggers::get_instance().log("<<< geonetworking_codec::encode");
return 0;
......@@ -39,8 +39,8 @@ int geonetworking_codec::encode (const LibItsGeoNetworking__TypesAndValues::GeoN
int geonetworking_codec::encode (const LibItsGeoNetworking__TypesAndValues::GnNonSecuredPacket& p_gnNonSecuredPacket, OCTETSTRING& data)
{
loggers::get_instance().log_msg(">>> geonetworking_codec::encode: ", (const Base_Type&)p_gnNonSecuredPacket);
loggers::get_instance().log_msg(">>> geonetworking_codec::encode (2): ", (const Base_Type&)p_gnNonSecuredPacket);
TTCN_EncDec::clear_error();
TTCN_Buffer encoding_buffer;
encode_(p_gnNonSecuredPacket, *p_gnNonSecuredPacket.get_descriptor(), encoding_buffer);
......@@ -104,7 +104,7 @@ int geonetworking_codec::encode_ (const Base_Type& type, const TTCN_Typedescript
}
} else if (std::string(field_descriptor.name).compare("@EtsiTs103097Module.EtsiTs103097Data") == 0) {
const EtsiTs103097Module::EtsiTs103097Data& ieee_1609dot2_data = static_cast<const EtsiTs103097Module::EtsiTs103097Data&>(type);
loggers::get_instance().log_msg("geonetworking_codec::encode_: Encode secured message = ", ieee_1609dot2_data);
loggers::get_instance().log_msg("geonetworking_codec::encode_: Encode secured message= ", ieee_1609dot2_data);
etsi_ts103097_data_codec codec;
OCTETSTRING os;
codec.encode(ieee_1609dot2_data, os);
......
......@@ -175,7 +175,7 @@ void geonetworking_layer::send_data(OCTETSTRING& data, params& params) {
return;
}
}
if (_secured_mode) { // Add signature support
if (_secured_mode) { // Add Security support
if (build_secured_pdu(data, params) != 0) {
return;
}
......@@ -493,7 +493,7 @@ void geonetworking_layer::send_beacon() {
_beacon->encode(*(_beacon->get_descriptor()), encoding_buffer, TTCN_EncDec::CT_RAW);
OCTETSTRING data(encoding_buffer.get_len(), encoding_buffer.get_data());
params params(_params);
if (_secured_mode) { // Apply signature
if (_secured_mode) { // Apply Security
if (build_secured_pdu(data, _params) != 0) {
return;
}
......@@ -1016,6 +1016,11 @@ int geonetworking_layer::build_secured_pdu(OCTETSTRING& data, params& params) {
LibItsGeoNetworking__TypesAndValues::BasicHeader basic_header;
decode_basic_header(data, basic_header);
if (basic_header.nextHeader() == BasicNextHeader::e__securedPacket) { // Already secured (ATS Security test suite/f_sendSecuredGn/Cam/Denm TTCN-3 functions
// Leave data unchanged
loggers::get_instance().log_msg("<<< geonetworking_layer::build_secured_pdu: Leave data unchanged: ", data);
return 0;
}
// Update security mode
unsigned int basic_header_len = 4;// FIXME How to retrive the BasicHeader length basic_header.get_descriptor()->raw->fieldlength / 8;
loggers::get_instance().log("geonetworking_layer::build_secured_pdu: basic_header_len = %d", basic_header_len);
......
......@@ -12,7 +12,7 @@
#include "LibItsHttp_MessageBodyTypes.hh"
#include "LibItsHttp_XmlMessageBodyTypes.hh"
#include "http_etsi_ieee1609dot2_codec.hh" // FIXME Work-around, to be removed
#include "http_etsi_ieee1609dot2_codec.hh"
int http_codec::encode (const LibItsHttp__TypesAndValues::HttpMessage& msg, OCTETSTRING& data)
{
......@@ -367,7 +367,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 +382,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()) {
......@@ -400,7 +404,7 @@ int http_codec::encode_body(const LibItsHttp__MessageBodyTypes::HttpMessageBody&
_codecs["http_its"]->encode((Record_Type&)binary_body.ieee1609dot2__data(), p_encoding_buffer); // TODO Use params
#if !defined(GEMALTO_FIX)
#if defined(GEMALTO_FIX) // Temporary fix to be removed
// GEMALTO Encode in hex string
CHARSTRING buf = oct2str(p_encoding_buffer);
p_encoding_buffer = OCTETSTRING(buf.lengthof(), (const unsigned char*)(static_cast<const char*>(buf)));
......@@ -477,7 +481,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
OCTETSTRING s(decoding_buffer.get_len() - decoding_buffer.get_pos(), decoding_buffer.get_data() + decoding_buffer.get_pos());
loggers::get_instance().log_msg("http_codec::decode_body: raw body=", s);
#if !defined(GEMALTO_FIX)
#if defined(GEMALTO_FIX) // Temporary fix to be removed
// GEMALTO Encode in hex string
if ((s.lengthof() & 0x00000001) == 0x00000001) {
s = int2oct(0, 1) + s;
......@@ -509,8 +513,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 +586,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 +608,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 +624,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);
......
......@@ -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() {
......
......@@ -516,6 +516,7 @@ int security_services::sign_payload(const OCTETSTRING& p_unsecured_gn_payload, O
std::string certificate_id = p_params[params::certificate];
loggers::get_instance().log("security_services::sign_payload: certificate_id = %s", certificate_id.c_str());
if ((unsigned int)(ms - _last_generation_time) >= 1000 * 0.95) { // Need to add certificate
loggers::get_instance().log("security_services::sign_payload: Need to add certificate");
IEEE1609dot2::CertificateBase cert;
if (_security_db->get_certificate(certificate_id, cert) != 0) {
loggers::get_instance().warning("security_services:sign_payload: Failed to secure payload");
......@@ -527,6 +528,7 @@ int security_services::sign_payload(const OCTETSTRING& p_unsecured_gn_payload, O
// Reset send certificate timer
_last_generation_time = ms;
} else {
loggers::get_instance().log("security_services::sign_payload: Add digest");
OCTETSTRING digest;
if (_security_db->get_hashed_id(certificate_id, digest) != 0) {
loggers::get_instance().warning("security_services::sign_payload: Failed to secure payload");
......
......@@ -86,7 +86,7 @@ USER etsi
RUN cd /home/etsi/dev \
&& git clone -b STF525 --recurse-submodules https://forge.etsi.org/gitlab/ITS/ITS.git ./STF525_Its \
&& cd /home/etsi/dev/STF525_Its/ttcn/LibIts \
&& git checkout STF525
&& git checkout STF525 \
&& cd /home/etsi/dev/STF525_Its/scripts \
&& chmod 775 *.bash devenv.bash.* \
&& cd /home/etsi \
......
......@@ -87,23 +87,23 @@ LogEventTypes:= Yes
# time_offset : Time offset, used to skip packets with time offset < time_offset
# save_mode : Set to 1 to save sent packet, 0 otherwise
system.denmPort.params := "DENM(next_header=btpB,header_type=tsb)/BTP(dst_port=2002)/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)"
system.denmPort.params := "DENM(next_header=btpB,header_type=tsb)/BTP(dst_port=2002)/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=eth1,filter=and ether proto 0x8947)"
# DENM UpperTester port based on UDP (ETSI Wlan)
system.utPort.params := "UT_DENM/UDP(dst_ip=172.23.0.1,dst_port=8000)"
system.utPort.params := "UT_DENM/UDP(dst_ip=192.168.56.101)"
[EXECUTE]
#ItsDenm_TestCases.TC_DEN_MSGF_BV_01
ItsDenm_TestCases.TC_DEN_MSGF_BV_01
#ItsDenm_TestCases.TC_DEN_MSGF_BV_02
#ItsDenm_TestCases.TC_DEN_EVGN_BV_03
#ItsDenm_TestCases.TC_DEN_EVGN_BV_04
#ItsDenm_TestCases.TC_DEN_EVUP_BV_01
#ItsDenm_TestCases.TC_DEN_EVUP_BO_04
ItsDenm_TestCases.TC_DEN_EVTR_BV_01
#ItsDenm_TestCases.TC_DEN_EVTR_BV_01
[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
KillTimer := 10.0
LocalAddress := 127.0.0.1
TCPPort := 12001
TCPPort := 12000
NumHCs := 1
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
......@@ -16,10 +17,16 @@ LibItsGeoNetworking_Pics.PICS_GN_LOCAL_GN_ADDR := {
LibItsGeoNetworking_Pixits.PX_GN_UPPER_LAYER := e_btpB
LibItsGeoNetworking_Pixits.PX_NEIGHBOUR_DISCOVERY_DELAY := 2.0
#LibItsHttp_Pics.PICS_HEADER_HOST := "127.0.0.1" #"ptsv2.com"
LibItsHttp_Pics.PICS_HEADER_HOST := "etsi.ea.msi-dev.acloud.gemalto.com"
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/x-its-request"
LibItsPki_Pics.PICS_HTTP_GET_URI := "/"
# Gemalto
#LibItsHttp_Pics.PICS_HEADER_HOST := "etsi.ea.msi-dev.acloud.gemalto.com"
#LibItsPki_Pics.PICS_HTTP_POST_URI := "/"
# httpbin.org
LibItsHttp_Pics.PICS_HEADER_HOST := "httpbin.org"
LibItsPki_Pics.PICS_HTTP_POST_URI := "/its"
LibItsSecurity_Pics.PICS_SEC_FIXED_KEYS := true # Seed
# Enable Security support
LibItsGeoNetworking_Pics.PICS_GN_SECURITY := true
......@@ -28,8 +35,7 @@ LibItsSecurity_Pixits.PX_CERTIFICATE_POOL_PATH := "/home/vagrant/tmp"
# Configuration sub-directory to access certificate stored in files
LibItsSecurity_Pixits.PX_IUT_SEC_CONFIG_NAME := "asn1c_cert"
# Seed
LibItsSecurity_Pics.PICS_SEC_FIXED_KEYS := false
LibItsPki_Pics.PICS_IUT_COMBINED_EA_AA_ROLE := true
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
......@@ -116,10 +122,9 @@ LogEventTypes:= Yes
# Single GeoNetworking component port
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730)/ETH(mac_src=080027500f9b)/PCAP(mac_src=080027500f9b,nic=eth2)"
#system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=ptsv2.com,use_ssl=0)"
#system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(server=127.0.0.1,port=8000,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(server=etsi.ea.msi-dev.acloud.gemalto.com,port=80,use_ssl=0)"
system.pkiPort.params := "PKI(certificate=CERT_EA)/HTTP(device_mode=1,uri=/its/inner_ec_request,host=httpbin.org,content_type=application/x-its-request)/TCP(server=127.0.0.1,port=8000,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(server=75.75.74.66,port=8000,use_ssl=0)" # httpbin.org
#system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(server=52.85.200.75,port=80,use_ssl=0)" # Gemalto
#system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(server=etsi.ea.msi-dev.acloud.gemalto.com,port=80,use_ssl=0)" # Gemalto
# GeoNetworking UpperTester port based on UDP
system.utPort.params := "UT_PKI/UDP(dst_ip=172.23.0.1,dst_port=8000)"
......@@ -127,7 +132,7 @@ system.utPort.params := "UT_PKI/UDP(dst_ip=172.23.0.1,dst_port=8000)"
[EXECUTE]
#ItsPki_TestCases.TC_SEC_PKI_ITSS_ENR_BV_01
#ItsPki_TestCases.TC_SEC_PKI_ITSS_ENR_BV_02
ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_01
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_01
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_02
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_03
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_04
......@@ -139,6 +144,8 @@ ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_01
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_10
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_11
#ItsPki_TestCases.TC_SEC_PKI_SND_EA_BV_12
ItsPki_TestCases.TC_SEC_PKI_SND_EA_AA_BV_01
#ItsPki_TestCases.TC_SEC_PKI_SND_AA_BV_01
[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
......
......@@ -23,21 +23,21 @@ ItsRSUsSimulator_Pixits.PX_RSU_ID := 8;
# UC7 (CAM only): PX_ETSI_USE_CASE_ID := 7
# UC8 (EVCSN only): PX_ETSI_USE_CASE_ID := 8
# UC9 (CAM only): PX_ETSI_USE_CASE_ID := 9
ItsRSUsSimulator_Pixits.PX_ETSI_USE_CASE_ID := 6
ItsRSUsSimulator_Pixits.PX_ETSI_USE_CASE_ID := 1
# Indicate which zone to simulate
ItsRSUsSimulator_Pixits.PX_ETSI_ZONE_ID := 1
ItsRSUsSimulator_Pixits.PICS_GENERATE_BEACON := false
ItsRSUsSimulator_Pixits.PICS_GENERATE_CAM := true
ItsRSUsSimulator_Pixits.PICS_GENERATE_DENM := false
ItsRSUsSimulator_Pixits.PICS_GENERATE_IVIM := false
ItsRSUsSimulator_Pixits.PICS_GENERATE_MAPEM := false
ItsRSUsSimulator_Pixits.PICS_GENERATE_SPATEM := false
ItsRSUsSimulator_Pixits.PICS_GENERATE_SSEM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_BEACON := false
ItsRSUsSimulator_Pics.PICS_GENERATE_CAM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_DENM := true
ItsRSUsSimulator_Pics.PICS_GENERATE_IVIM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_MAPEM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_SPATEM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_SSEM := false
ItsRSUsSimulator_Pics.PICS_BEACON_FREQUENCY := 1.0
ItsRSUsSimulator_Pics.PICS_CAM_FREQUENCY := 1.0
ItsRSUsSimulator_Pics.PICS_DENM_FREQUENCY := 1.0
ItsRSUsSimulator_Pics.PICS_CAM_FREQUENCY := 0.25
ItsRSUsSimulator_Pics.PICS_DENM_FREQUENCY := 0.25
ItsRSUsSimulator_Pics.PICS_SEND_CAM_INDICATION := false
......@@ -123,10 +123,12 @@ LogEventTypes:= Yes
# save_mode : Set to 1 to save sent packet, 0 otherwise
# Single GeoNetworking component port
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,its_aid=37,secured_mode=1,encrypted_mode=0,certificate=CERT_IUT_A_AT,peer_certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=080027500f9b)/PCAP(mac_src=080027500f9b,nic=eth2,filter=and ether proto 0x8947)"
# its_aid=36: CAM
# its_aid=37: DENM
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,its_aid=37,secured_mode=1,encrypted_mode=0,certificate=CERT_IUT_A_AT,peer_certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=080027500f9b)/PCAP(mac_src=080027500f9b,nic=eth1,filter=and ether proto 0x8947)"
# Config port based on UDP
system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=192.168.2.2)"
system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=192.168.0.4)"
[EXECUTE]
ItsRSUsSimulator_TestCases.TC_RSUSIMU_BV_01
......
......@@ -4,13 +4,21 @@
# The GeoNetworking address of the IUT.
LibItsGeoNetworking_Pics.PICS_GN_LOCAL_GN_ADDR := {
typeOfAddress := e_initial,
stationType := e_passengerCar, #e_roadSideUnit,
typeOfAddress := e_initial, # e_manual(1)
stationType := e_roadSideUnit,
stationCountryCode := 0, #33,
mid := 'BA749705A41D'O
}
mid := '080027425e63'O
} # Simu
#LibItsGeoNetworking_Pics.PICS_GN_LOCAL_GN_ADDR := {
# typeOfAddress := e_initial,
# stationType := e_passengerCar, #e_roadSideUnit,
# stationCountryCode := 0, #33,
# mid := 'BA749705A41D'O
#} # Nordsys
LibItsGeoNetworking_Pixits.PX_GN_UPPER_LAYER := e_btpB
LibItsBtp_Pixits.PX_DESTINATION_PORT := 2001
LibItsBtp_Pixits.PX_DESTINATION_PORT_INFO := 2001
# Enable Security support
LibItsGeoNetworking_Pics.PICS_GN_SECURITY := true
......@@ -100,7 +108,8 @@ LogEventTypes:= Yes
# save_mode : 1 to save sent packet, 0 otherwise
# Single GeoNetworking component port
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=1,its_aid=141,secured_mode=1,certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)" # Nordsys
# its_aid = 36
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=1,its_aid=36,certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=eth1,filter=and ether proto 0x8947)" # Nordsys
#system.geoNetworkingPort.params := "
# GN(ll_address=4C5E0C14D2EC,latitude=43551050,longitude=10298730,beaconing=0,expiry=1000)/
......@@ -112,8 +121,10 @@ system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050
# CAM UpperTester port based on UDP
#system.camUtPort.params := "UT_CAM(loopback=1)"
system.utPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
system.camUtPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
#system.utPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
#system.camUtPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
system.utPort.params := "UT_CAM/UDP(dst_ip=192.168.56.101)" # Simu
system.camUtPort.params := "UT_CAM/UDP(dst_ip=192.168.56.101)" # Simu
[EXECUTE]
#Check that ITS-S sends a Ieee1609Dot2Data containing protocol version set to 3
......@@ -121,7 +132,7 @@ system.camUtPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nords