Commit 6c96a9f7 authored by YannGarcia's avatar YannGarcia

Bug fixed in AtsPki

parent be40c7ea
...@@ -153,7 +153,7 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsPki__TypesAndValues::UtPkiResu ...@@ -153,7 +153,7 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsPki__TypesAndValues::UtPkiResu
encoding_buffer.put_c(0x01/*static_cast<const unsigned char>(uppertester_pki_codec::c_utPkiInitializeResult)*/); encoding_buffer.put_c(0x01/*static_cast<const unsigned char>(uppertester_pki_codec::c_utPkiInitializeResult)*/);
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utPkiInitializeResult())); encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utPkiInitializeResult()));
} else if (send_par.ischosen(LibItsPki__TypesAndValues::UtPkiResults::ALT_utPkiTriggerResult)) { } else if (send_par.ischosen(LibItsPki__TypesAndValues::UtPkiResults::ALT_utPkiTriggerResult)) {
encoding_buffer.put_c(0xBC/*static_cast<const unsigned char>(uppertester_pki_codec::c_utPkiTriggerResult)*/); encoding_buffer.put_c(0xB0/*static_cast<const unsigned char>(uppertester_pki_codec::c_utPkiTriggerResult)*/);
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utPkiTriggerResult())); encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utPkiTriggerResult()));
} else { } else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::sendMsg: Unsupported UtPkiResults variant"); loggers::get_instance().warning("ConfigRsuSimulatorLayer::sendMsg: Unsupported UtPkiResults variant");
...@@ -585,6 +585,7 @@ int ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger(const OCTETSTRING& ...@@ -585,6 +585,7 @@ int ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger(const OCTETSTRING&
} }
p.tsb() = g; p.tsb() = g;
} }
// Pass it to the ports if any // Pass it to the ports if any
to_all_upper_ports(p, params); to_all_upper_ports(p, params);
} else { } else {
...@@ -605,11 +606,24 @@ int ConfigRsuSimulatorLayer::process_ut_pki_trigger(const OCTETSTRING& data, par ...@@ -605,11 +606,24 @@ int ConfigRsuSimulatorLayer::process_ut_pki_trigger(const OCTETSTRING& data, par
} }
if (_params[std::string("ut")].compare("pki") == 0) { if (_params[std::string("ut")].compare("pki") == 0) {
unsigned char msg_id = *static_cast<const unsigned char*>(data);
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger: msg_id=%02x", msg_id);
OCTETSTRING payload(data.lengthof() - 1, 1 + static_cast<const unsigned char*>(data));
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger: payload:", payload);
TTCN_EncDec::clear_error();
TTCN_Buffer decoding_buffer(payload);
LibItsPki__TypesAndValues::UtPkiTrigger p; LibItsPki__TypesAndValues::UtPkiTrigger p;
p.triggerEnrolmentRequest().cannonicalId() = OCTETSTRING(0, nullptr); // No parameter used if (msg_id == 0xbb/*uppertester_pki_codec*/) {
p.triggerEnrolmentRequest().encAlgorithm() = OCTETSTRING(0, nullptr); // No parameter used // LibItsPki__TypesAndValues::TriggerEnrolmentRequest e;
p.triggerEnrolmentRequest().privateKey() = OCTETSTRING(0, nullptr); // No parameter used // e.decode(*e.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
p.triggerEnrolmentRequest().compressedPublickey() = OCTETSTRING(0, nullptr); // No parameter used //p.triggerEnrolmentRequest() = e;
p.triggerEnrolmentRequest().cannonicalId() = OCTETSTRING(0, nullptr); // No parameter used
p.triggerEnrolmentRequest().encAlgorithm() = OCTETSTRING(0, nullptr); // No parameter used
p.triggerEnrolmentRequest().privateKey() = OCTETSTRING(0, nullptr); // No parameter used
p.triggerEnrolmentRequest().compressedPublickey() = OCTETSTRING(0, nullptr); // No parameter used
}
// Pass it to the ports if any // Pass it to the ports if any
to_all_upper_ports(p, params); to_all_upper_ports(p, params);
} else { } else {
......
...@@ -248,7 +248,7 @@ int certificates_loader::build_certificates_cache(std::set<std::experimental::fi ...@@ -248,7 +248,7 @@ int certificates_loader::build_certificates_cache(std::set<std::experimental::fi
OCTETSTRING hash; // Whole-certificate hash OCTETSTRING hash; // Whole-certificate hash
OCTETSTRING hashed_id; // Whole-certificate hashedid-8 OCTETSTRING hashed_id; // Whole-certificate hashedid-8
OCTETSTRING issuer; // Certificate issuer OCTETSTRING issuer; // Certificate issuer
if (public_key_x.lengthof() == 32) { if (public_key_x.lengthof() == 32) { // See IEEE Std 1609.2a-2017 Clause 6.4.3 CertificateBase
hash = hash_sha_256; hash = hash_sha_256;
loggers::get_instance().log_msg("certificates_loader::build_certificates_cache: Whole-certificate SHA-256 hash: ", hash); loggers::get_instance().log_msg("certificates_loader::build_certificates_cache: Whole-certificate SHA-256 hash: ", hash);
hashed_id = OCTETSTRING(8, static_cast<const unsigned char*>(hash) + hash.lengthof() - 8); hashed_id = OCTETSTRING(8, static_cast<const unsigned char*>(hash) + hash.lengthof() - 8);
......
...@@ -33,9 +33,9 @@ class uppertester_pki_codec: public codec < ...@@ -33,9 +33,9 @@ class uppertester_pki_codec: public codec <
public: public:
const unsigned char c_utPkiInitialize = 0x00; const unsigned char c_utPkiInitialize = 0x00;
const unsigned char c_utPkiInitializeResult = 0x01; const unsigned char c_utPkiInitializeResult = 0x01;
const unsigned char c_utPkiTriggerResult = 0xB0;
const unsigned char c_utPkiTriggerEnrolmentRequest = 0xBB; const unsigned char c_utPkiTriggerEnrolmentRequest = 0xBB;
const unsigned char c_utPkiTriggerResult = 0xBC; const unsigned char c_utPkiTriggerAuthorizationRequest = 0xBC;
const unsigned char c_utPkiTriggerAuthorizationRequest = 0xBD;
private: private:
int encode_ (const Base_Type& type, const TTCN_Typedescriptor_t& field_descriptor, TTCN_Buffer& encoding_buffer); int encode_ (const Base_Type& type, const TTCN_Typedescriptor_t& field_descriptor, TTCN_Buffer& encoding_buffer);
......
...@@ -43,6 +43,7 @@ ItsRSUsSimulator_Pics.PICS_GENERATE_MAPEM := false ...@@ -43,6 +43,7 @@ ItsRSUsSimulator_Pics.PICS_GENERATE_MAPEM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_SPATEM := false ItsRSUsSimulator_Pics.PICS_GENERATE_SPATEM := false
ItsRSUsSimulator_Pics.PICS_GENERATE_SSEM := false ItsRSUsSimulator_Pics.PICS_GENERATE_SSEM := false
ItsRSUsSimulator_Pics.PICS_ITS_S_ROLE := true;
ItsRSUsSimulator_Pics.PICS_PKI_SUPPORT := true ItsRSUsSimulator_Pics.PICS_PKI_SUPPORT := true
ItsRSUsSimulator_Pics.PICS_BEACON_FREQUENCY := 1.0 ItsRSUsSimulator_Pics.PICS_BEACON_FREQUENCY := 1.0
...@@ -166,14 +167,16 @@ system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050 ...@@ -166,14 +167,16 @@ system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=36747486,longitude=-4556772,distanceA=25,distanceB=25,its_aid=37,secured_mode=1,encrypted_mode=0,certificate=CERT_MICROSEC_AT_01,peer_certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/QUALCOMM/UDP(dst_ip=10.200.1.113,src_port=9091,dst_port=4041)" #system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=36747486,longitude=-4556772,distanceA=25,distanceB=25,its_aid=37,secured_mode=1,encrypted_mode=0,certificate=CERT_MICROSEC_AT_01,peer_certificate=CERT_TS_A_AT,sec_db_path=/home/vagrant/tmp/asn1c_cert)/QUALCOMM/UDP(dst_ip=10.200.1.113,src_port=9091,dst_port=4041)"
#system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=192.168.42.252,port=80)" #system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=192.168.42.252,port=80)"
system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=192.168.1.252,port=80)" #system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=192.168.1.252,port=80)"
system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server=192.168.1.39,port=8080)"
# Config port based on UDP # Config port based on UDP
#system.cfPort.params := "CF(ut=pki)/UDP(dst_ip=192.168.42.252,src_port=12345)" #system.cfPort.params := "CF(ut=pki)/UDP(dst_ip=192.168.42.252,src_port=12345)"
#system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=192.168.1.39,src_port=12345)" #system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=192.168.1.39,src_port=12345)"
#system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)" #system.cfPort.params := "CF(ut=cam)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)"
system.cfPort.params := "CF(ut=denm)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)" #system.cfPort.params := "CF(ut=denm)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)"
#system.cfPort.params := "CF(ut=gn)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)" #system.cfPort.params := "CF(ut=gn)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)"
system.cfPort.params := "CF(ut=pki)/UDP(dst_ip=172.28.4.87,src_port=12345,reuse_incoming_source_adddress=1)"
[EXECUTE] [EXECUTE]
ItsRSUsSimulator_TestCases.TC_RSUSIMU_BV_01 ItsRSUsSimulator_TestCases.TC_RSUSIMU_BV_01
......
...@@ -36,6 +36,14 @@ module ItsRSUsSimulator_Pics { ...@@ -36,6 +36,14 @@ module ItsRSUsSimulator_Pics {
// ItsRSUsSimulator // ItsRSUsSimulator
import from ItsRSUsSimulator_TypesAndValues all; import from ItsRSUsSimulator_TypesAndValues all;
import from ItsRSUsSimulator_PicsInitConsts all; import from ItsRSUsSimulator_PicsInitConsts all;
group itss {
modulepar boolean PICS_PKI_SUPPORT := false;
modulepar boolean PICS_ITS_S_ROLE := false;
} // End of group itss
/** /**
* @desc This group describes the RSUs installed on the track * @desc This group describes the RSUs installed on the track
...@@ -5747,8 +5755,6 @@ module ItsRSUsSimulator_Pics { ...@@ -5747,8 +5755,6 @@ module ItsRSUsSimulator_Pics {
modulepar boolean PICS_GENERATE_SSEM := false; modulepar boolean PICS_GENERATE_SSEM := false;
modulepar boolean PICS_PKI_SUPPORT := false;
//modulepar boolean PICS_GENERATE_EVCSN := false; //modulepar boolean PICS_GENERATE_EVCSN := false;
} // End of group messages } // End of group messages
...@@ -5810,5 +5816,5 @@ module ItsRSUsSimulator_Pics { ...@@ -5810,5 +5816,5 @@ module ItsRSUsSimulator_Pics {
modulepar float PICS_EVCSN_FREQUENCY := 1.0; modulepar float PICS_EVCSN_FREQUENCY := 1.0;
} // End of group generationFrequencies } // End of group generationFrequencies
} // End of module ItsRSUsSimulator_Pics } // End of module ItsRSUsSimulator_Pics
...@@ -56,27 +56,29 @@ module ItsRSUsSimulator_TestCases { ...@@ -56,27 +56,29 @@ module ItsRSUsSimulator_TestCases {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body // Test Body
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].beacon)) { if (PICS_ITS_S_ROLE == false) {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].beacon)) {
tc_beacon.start; tc_beacon.start;
} }
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].cam)) { if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].cam)) {
tc_cam.start(vc_cam_timer_value); tc_cam.start(vc_cam_timer_value);
} }
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].denms)) { if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].denms)) {
tc_denm.start; tc_denm.start;
} }
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].mapem)) { if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].mapem)) {
tc_mapem.start; tc_mapem.start;
} }
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].spatems)) { if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].spatems)) {
tc_spatem.start; tc_spatem.start;
} }
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].ivim)) { if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].ivim)) {
tc_ivim.start; tc_ivim.start;
} }
/* if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].evcsn)) { */ /* if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].evcsn)) { */
/* tc_evcsn.start; */ /* tc_evcsn.start; */
/* } */ /* } */
} // else, nothing to do, waiting for PKI triggers
geoNetworkingPort.clear; geoNetworkingPort.clear;
alt { alt {
......
Subproject commit 956ea968e8a7b3701c6fbb1386c3aac2e98c4d46 Subproject commit 85cb2b6c78a91a7d1370036baa632d557c509ed4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment