Commit 79feabf2 authored by YannGarcia's avatar YannGarcia
Browse files

Bug fixed in docker/Dockerfile; Add script to switch in ITS Conformance...

Bug fixed in docker/Dockerfile; Add script to switch in ITS Conformance testing Release 1; Add flag to force secured beaconing
parent 828ab3c7
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ using namespace LibItsGeoNetworking__TypesAndValues;
geonetworking_layer::geonetworking_layer(const std::string &p_type, const std::string &p_param)
  : t_layer<LibItsGeoNetworking__TestSystem::GeoNetworkingPort>(p_type), _params(), _codec(), _beacon(nullptr), _gbc_packet(nullptr), _shb_packet(nullptr),
    _tsb_packet(nullptr), _uni_packet(nullptr), _ls_reply(nullptr), _location_table(),
    _pass_beacon_table(), _device_mode{false}, _secured_mode{false}, _encrypted_mode{false}, _enable_security_checks{false},
    _pass_beacon_table(), _device_mode{false}, _secured_mode{false}, _beacon_secured_mode{false}, _encrypted_mode{false}, _enable_security_checks{false},
    _sendData(), _timerid{0}, _sev{0}, _its{0}, _freq_nanosecs(0), _mask{0}, _sa{0}, _sequence_number{0}, _latitude{0}, _longitude{0}, _force_certificate{false},
    _leap_delay_us(4000/*Add 4 leap seconds to convert to TAI (as Feb 2019)*/) {
  loggers::get_instance().log(">>> geonetworking_layer::geonetworking_layer: %s, %s", to_string().c_str(), p_param.c_str());
@@ -116,6 +116,12 @@ void geonetworking_layer::init(const std::string &p_type, const std::string &p_p
  } else {
    _params.insert(std::pair<std::string, std::string>(params_its::secured_mode, "0"));
  }
  it = _params.find(params_its::beacon_secured_mode);
  if (it != _params.cend()) {
    _beacon_secured_mode = (1 == converter::get_instance().string_to_int(it->second));
  } else {
    _params.insert(std::pair<std::string, std::string>(params_its::beacon_secured_mode, "0"));
  }
  it = _params.find(params_its::encrypted_mode);
  if (it != _params.cend()) {
    _encrypted_mode = (1 == converter::get_instance().string_to_int(it->second));
@@ -142,7 +148,7 @@ void geonetworking_layer::init(const std::string &p_type, const std::string &p_p
  }

  // Set up default security parameters value
  if (_secured_mode || _encrypted_mode) {
  if (_secured_mode || _encrypted_mode || _beacon_secured_mode) {
    loggers::get_instance().log("geonetworking_layer::init: Setup secured mode");
    setup_secured_mode();
  }
@@ -515,7 +521,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_its      params(_params);
  if (_secured_mode) { // Apply Security
  if (_secured_mode || _beacon_secured_mode) { // Apply Security
    if (build_secured_pdu(data, params) != 0) {
      return;
    }
+6 −5
Original line number Diff line number Diff line
@@ -57,8 +57,9 @@ class geonetworking_layer : public t_layer<LibItsGeoNetworking__TestSystem::GeoN
  LibItsGeoNetworking__TypesAndValues::GeoNetworkingPdu *_ls_reply;           /*!< Data structure used to reply to an incoming LS_REQUEST */
  location_table                                         _location_table;     /*!< Location table, used when device_mode is set */
  location_table                                         _pass_beacon_table;  /*!< Beaconing filter table */
  bool                                                   _device_mode;
  bool                                                   _secured_mode;
  bool                                                   _device_mode;        /*!< Force the Test System to act as an OBU */
  bool                                                   _secured_mode;       /*!< Force secured mode */
  bool                                                   _beacon_secured_mode; /*!< Force secured beaconing */
  bool                                                   _encrypted_mode;
  bool                                                   _enable_security_checks;
  std::mutex                                             _sendData; // FIXME To be removed, useless
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ public: //! \publicsection

  static const std::string& device_mode;  //! To indicate to the lower layer to act as a standalone device
  static const std::string& secured_mode; //! To indicate to the lower layer to apply signature on message exchanges as defined in IEEE 1609.2&  ETSI TS 102 965
  static const std::string& beacon_secured_mode; 
                                          //! To indicate to the lower layer to apply signature on beaconing as defined in IEEE 1609.2&  ETSI TS 102 965
  static const std::string
   & encrypted_mode; //! To indicate to the lower layer to apply encryption on message exchanges as defined in IEEE 1609.2&  ETSI TS 102 965
  static const std::string& enable_security_checks; //! To indicates if security check failures shall be treated as error or warning
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ const std::string& params_its::station_id = std::string("station_id");

const std::string& params_its::device_mode            = std::string("device_mode");
const std::string& params_its::secured_mode           = std::string("secured_mode");
const std::string& params_its::beacon_secured_mode    = std::string("beacon_secured_mode");
const std::string& params_its::encrypted_mode         = std::string("encrypted_mode");
const std::string& params_its::enable_security_checks = std::string("enable_security_checks");
const std::string& params_its::force_certificate      = std::string("force_certificate");
+4 −7
Original line number Diff line number Diff line
@@ -19,9 +19,6 @@ LibItsGeoNetworking_Pixits.PX_GN_UPPER_LAYER := e_btpB
LibItsBtp_Pixits.PX_DESTINATION_PORT := 2001
LibItsBtp_Pixits.PX_DESTINATION_PORT_INFO := 2001

# The certificate identifier the TA shall use in case of secured IUT
#LibItsCommon_Pixits.PX_CERT_FOR_TS := "CERT_TS_A_AT"

# Enable Security support
LibItsGeoNetworking_Pics.PICS_GN_SECURITY := true
# Root path to access certificate stored in files, identified by certficate ID
@@ -127,12 +124,12 @@ LogEventTypes:= Yes
# its_aid=128:  RTCMEM

# Cygwin
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,sec_db_path=../data/certificates/certificates)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=CEBB111F-D749-4B40-8B4D-DBB060E90987,filter=and ether proto 0x8947)"
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,beacon_secured_mode=1,sec_db_path=../data/certificates/certificates)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=CEBB111F-D749-4B40-8B4D-DBB060E90987,filter=and ether proto 0x8947)"
# Linux
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,sec_db_path=../data/certificates/certificates)/ETH(mac_src=8c554ac1eee0)/PCAP(mac_src=8c554ac1eee0,nic=wlp0s20f3,filter=and ether proto 0x8947)"
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,its_aid=36)/ETH(mac_src=8c554ac1eee0)/PCAP(mac_src=8c554ac1eee0,nic=wlp0s20f3,filter=and ether proto 0x8947)"
system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,beacon_secured_mode=1,sec_db_path=../data/certificates/certificates)/ETH(mac_src=8c554ac1eee0)/PCAP(mac_src=8c554ac1eee0,nic=wlp0s20f3,filter=and ether proto 0x8947)"
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,beacon_secured_mode=1,its_aid=36)/ETH(mac_src=8c554ac1eee0)/PCAP(mac_src=8c554ac1eee0,nic=wlp0s20f3,filter=and ether proto 0x8947)"
# Linux over UDP
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,its_aid=36)/ETH(mac_src=8c554ac1eee0)/UDP(dst_ip=192.168.1.43,src_port=4041,dst_port=9091)"
#system.geoNetworkingPort.params := "GN(ll_address=4C5E0C14D2EB,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=0,secured_mode=0,beacon_secured_mode=1,its_aid=36)/ETH(mac_src=8c554ac1eee0)/UDP(dst_ip=192.168.1.43,src_port=4041,dst_port=9091)"

system.httpPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/TCP(debug=1,server_mode=1,server=192.168.1.43)"

Loading