Commit 9e0e8147 authored by filatov's avatar filatov
Browse files

fix eol-styles, executable permissions, etc

fix certificate and key extensions
fix default certificates and key search path
parent d9b07082
......@@ -62,6 +62,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>asn1/LibIts/Security/TS102921</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ccsrc/Ports/LibIts_ports/AutoInterop_ports</FolderPath>
<FolderProperties>
......@@ -83,6 +90,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ccsrc/Ports/LibIts_ports/Pki_ports</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ccsrc/Ports/LibIts_ports/RSUsSimulator_ports</FolderPath>
<FolderProperties>
......@@ -132,6 +146,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>testdata</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>tools</FolderPath>
<FolderProperties>
......@@ -195,6 +216,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ttcn/AtsPki</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ttcn/AtsRSUsSimulator</FolderPath>
<FolderProperties>
......@@ -223,6 +251,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ttcn/LibIts/Pki</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>ttcn/LibIts/V2G</FolderPath>
<FolderProperties>
......@@ -252,43 +287,25 @@
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Asn1c/Asn1cEncDec.cc</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Asn1c/Asn1cEncDec.hh</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Asn1c/ITS_ContainerCodec.cc</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Asn1c/ITS_ContainerCodec.hh</FilePath>
<FilePath>ccsrc/EncDec/LibItsEvcsn_Encdec.cc</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/EncDec/LibItsEvcsn_Encdec.cc</FilePath>
<FilePath>ccsrc/Externals/AtsRSUsSimulator_externals.cc</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Externals/AtsRSUsSimulator_externals.cc</FilePath>
<FilePath>ccsrc/Externals/LibItsDcc_externals.cc</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>ccsrc/Externals/LibItsDcc_externals.cc</FilePath>
<FilePath>ttcn/TestCodec/TestCodec_SignedAndEncryptedMessages.ttcn</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
......
File mode changed from 100755 to 100644
#include <asn1/asn_application.h>
#include "asn1_recode_per.hh"
#include <TTCN3.hh>
extern "C" {
static int asn1c_collect_encoded_data(const void *buffer, size_t size, void *application_specific_key)
{
TTCN_Buffer * tb = (TTCN_Buffer *)application_specific_key;
tb->put_s(size, (unsigned char *)buffer);
return 0;
}
}
int asn1_recode_per::recode(const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf)
{
int rc = -1;
void * ptr = NULL;
asn_dec_rval_t rc_d;
rc_d = asn_decode(NULL, (asn_transfer_syntax)from, (asn_TYPE_descriptor_s*)&td, &ptr, buf.get_data(), buf.get_len());
if(rc_d.code == RC_OK){
// Encode as PER
asn_enc_rval_t rc_e;
buf.clear();
rc_e = asn_encode(NULL, (asn_transfer_syntax)to, (asn_TYPE_descriptor_s*)&td, ptr, asn1c_collect_encoded_data, &buf);
rc = rc_e.encoded;
}
if(ptr){
ASN_STRUCT_FREE(td, ptr);
}
return rc;
}
int asn1_recode_per::ber2per(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_BER, (int)ATS_UNALIGNED_CANONICAL_PER, buf);
}
int asn1_recode_per::per2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_UNALIGNED_BASIC_PER, (int)ATS_DER, buf);
}
/*int asn1_recode_oer::ber2oer(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_XER, (int)ATS_CANONICAL_OER, buf);
}
int asn1_recode_oer::oer2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recodeOer(td, (int)ATS_BASIC_OER, (int)ATS_XER, buf);
}*/
#include <asn1/asn_application.h>
#include "asn1_recode_per.hh"
#include <TTCN3.hh>
extern "C" {
static int asn1c_collect_encoded_data(const void *buffer, size_t size, void *application_specific_key)
{
TTCN_Buffer * tb = (TTCN_Buffer *)application_specific_key;
tb->put_s(size, (unsigned char *)buffer);
return 0;
}
}
int asn1_recode_per::recode(const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf)
{
int rc = -1;
void * ptr = NULL;
asn_dec_rval_t rc_d;
rc_d = asn_decode(NULL, (asn_transfer_syntax)from, (asn_TYPE_descriptor_s*)&td, &ptr, buf.get_data(), buf.get_len());
if(rc_d.code == RC_OK){
// Encode as PER
asn_enc_rval_t rc_e;
buf.clear();
rc_e = asn_encode(NULL, (asn_transfer_syntax)to, (asn_TYPE_descriptor_s*)&td, ptr, asn1c_collect_encoded_data, &buf);
rc = rc_e.encoded;
}
if(ptr){
ASN_STRUCT_FREE(td, ptr);
}
return rc;
}
int asn1_recode_per::ber2per(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_BER, (int)ATS_UNALIGNED_CANONICAL_PER, buf);
}
int asn1_recode_per::per2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_UNALIGNED_BASIC_PER, (int)ATS_DER, buf);
}
/*int asn1_recode_oer::ber2oer(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_XER, (int)ATS_CANONICAL_OER, buf);
}
int asn1_recode_oer::oer2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recodeOer(td, (int)ATS_BASIC_OER, (int)ATS_XER, buf);
}*/
/*!
* \file asn1_recode_per.hh
* \brief Header file ASN.1 PER codec based on asn1c external tool.
* \author ETSI STF525
* \copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
* \version 0.1
*/
#pragma once
class OCTETSTRING; //! Forward declaration of TITAN class
class CHARSTRING; //! Forward declaration of TITAN class
class BITSTRING; //! Forward declaration of TITAN class
class TTCN_Buffer; //! Forward declaration of TITAN class
class TTCN_EncDec; //! Forward declaration of TITAN class
class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class
struct asn_TYPE_descriptor_s; //! Forward declaration of asn1c class
class asn1_recode_per
{
protected:
int ber2per (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int per2ber (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int recode (const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf);
}; // End of class asn1_recode_per
/*!
* \file asn1_recode_per.hh
* \brief Header file ASN.1 PER codec based on asn1c external tool.
* \author ETSI STF525
* \copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
* \version 0.1
*/
#pragma once
class OCTETSTRING; //! Forward declaration of TITAN class
class CHARSTRING; //! Forward declaration of TITAN class
class BITSTRING; //! Forward declaration of TITAN class
class TTCN_Buffer; //! Forward declaration of TITAN class
class TTCN_EncDec; //! Forward declaration of TITAN class
class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class
struct asn_TYPE_descriptor_s; //! Forward declaration of asn1c class
class asn1_recode_per
{
protected:
int ber2per (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int per2ber (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int recode (const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf);
}; // End of class asn1_recode_per
#include "LibItsHttp_MessageBodyTypes.hh"
#include "http_codec.hh"
#include "loggers.hh"
namespace LibItsHttp__EncdecDeclarations {
BITSTRING fx__enc__http__message(const LibItsHttp__TypesAndValues::HttpMessage& p) { return BITSTRING(); }
INTEGER fx__dec__http__message(BITSTRING& pdu, LibItsHttp__TypesAndValues::HttpMessage& p) {
loggers::get_instance().log_msg(">>> fx__dec__http__response: ", pdu);
OCTETSTRING os = bit2oct(pdu);
http_codec codec;
codec.decode(os, p);
return 0;
}
} // End of namespace LibItsHttp__EncdecDeclarations
#include "LibItsHttp_MessageBodyTypes.hh"
#include "http_codec.hh"
#include "loggers.hh"
namespace LibItsHttp__EncdecDeclarations {
BITSTRING fx__enc__http__message(const LibItsHttp__TypesAndValues::HttpMessage& p) { return BITSTRING(); }
INTEGER fx__dec__http__message(BITSTRING& pdu, LibItsHttp__TypesAndValues::HttpMessage& p) {
loggers::get_instance().log_msg(">>> fx__dec__http__response: ", pdu);
OCTETSTRING os = bit2oct(pdu);
http_codec codec;
codec.decode(os, p);
return 0;
}
} // End of namespace LibItsHttp__EncdecDeclarations
#include "LibItsIpv6OverGeoNetworking_EncdecDeclarations.hh"
namespace LibItsIpv6OverGeoNetworking__EncdecDeclarations {
/****************************************************
* @desc External function to encode a Ipv6Packet type
* @param value to encode
* @return encoded value
****************************************************/
BITSTRING fx__enc__Ipv6Packet(const LibItsIpv6OverGeoNetworking__TypesAndValues::Ipv6Packet& p)
{
return int2bit(0,8);
}
/****************************************************
* @desc External function to decode a Ipv6Packet type
* @param value to encode
* @return encoded value
****************************************************/
INTEGER fx__dec__Ipv6Packet(BITSTRING& b, LibItsIpv6OverGeoNetworking__TypesAndValues::Ipv6Packet& p)
{
return -1;
}
} //end namespace
#include "LibItsIpv6OverGeoNetworking_EncdecDeclarations.hh"
namespace LibItsIpv6OverGeoNetworking__EncdecDeclarations {
/****************************************************
* @desc External function to encode a Ipv6Packet type
* @param value to encode
* @return encoded value
****************************************************/
BITSTRING fx__enc__Ipv6Packet(const LibItsIpv6OverGeoNetworking__TypesAndValues::Ipv6Packet& p)
{
return int2bit(0,8);
}
/****************************************************
* @desc External function to decode a Ipv6Packet type
* @param value to encode
* @return encoded value
****************************************************/
INTEGER fx__dec__Ipv6Packet(BITSTRING& b, LibItsIpv6OverGeoNetworking__TypesAndValues::Ipv6Packet& p)
{
return -1;
}
} //end namespace
#include "ItsRSUsSimulator_Functions.hh"
namespace ItsRSUsSimulator__Functions
{
void fx__computePositionFromRotation(const INTEGER& p__refLatitude, const INTEGER& p__refLongitude, const INTEGER& p__cenLatitude, const INTEGER& p__cenLongitude, const INTEGER& p__rotation, INTEGER& p__latitude, INTEGER& p__longitude) {
// TODO
p__latitude = p__cenLatitude;
p__longitude = p__cenLongitude;
}
} // end of namespace
#include "ItsRSUsSimulator_Functions.hh"
namespace ItsRSUsSimulator__Functions
{
void fx__computePositionFromRotation(const INTEGER& p__refLatitude, const INTEGER& p__refLongitude, const INTEGER& p__cenLatitude, const INTEGER& p__cenLongitude, const INTEGER& p__rotation, INTEGER& p__latitude, INTEGER& p__longitude) {
// TODO
p__latitude = p__cenLatitude;
p__longitude = p__cenLongitude;
}
} // end of namespace
#include "LibItsCommon_Functions.hh"
#include <chrono>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
namespace LibItsCommon__Functions
{
/**
* @desc This external function gets the current time
* @return Timestamp - current time since 01/01/2014 in milliseconds
* @see fx_getCurrentTime() return TimestampIts
*/
INTEGER fx__getCurrentTime(
) {
unsigned long long ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() - 1072911600000L; // TODO Add a global method such as its_tme() & its_time_mod() beacuse it is used also in geonetworking_layer
/*unsigned long long its_ref_time = 1072911600000L;
struct timeval tv;
gettimeofday(&tv, NULL);
unsigned long long ms = tv.tv_sec * 1000 + tv.tv_usec / 1000;*/
INTEGER i;
i.set_long_long_val(ms);
return i;
}
/**
* @desc Gets the current time since 01/01/2004
* @return TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
* @see function f_getCurrentTimeMark() return TimeMark
*/
INTEGER fx__getCurrentTimeMark(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/**
* @desc Gets the Minute of current UTC year
* @return MinuteOfTheYear - tenths of a second in the current or next hour in units of 1/10th second from UTC time
* @see function f_getMinuteOfTheYear() return MinuteOfTheYear
*/
INTEGER fx__getMinuteOfTheYear(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/**
* @desc Gets the milliseconds point in the current UTC minute
* @return DSecond - The milliseconds point in the current UTC minute (0..60000)
* @see function f_getDSecond() return DSecond
*/
INTEGER fx__getDSecond(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/* * @desc External function to compute distance between two points
* @param p_latitudeA Latitude of first point
* @param p_longitudeA Longitude of first point
* @param p_latitudeB Latitude of second point
* @param p_longitudeB Longitude of second point
* @return Computed distance in meters
fx_computeDistance(in Int32 p_latitudeA, in Int32 p_longitudeA, in Int32 p_latitudeB, in Int32 p_longitudeB) return float;
*/
FLOAT fx__computeDistance(
const INTEGER& p__latitudeA,
const INTEGER& p__longitudeA,
const INTEGER& p__latitudeB,
const INTEGER& p__longitudeB
) {
double d_latA = ((double)p__latitudeA)/10000000.0;
double d_latB = ((double)p__latitudeB)/10000000.0;
double d_lonA = ((double)p__longitudeA)/10000000.0;
double d_lonB = ((double)p__longitudeB)/10000000.0;
double earth_radius = 6371000.0; //meters
double d_lat = (d_latB - d_latA) * (M_PI/180.0);
double d_lon = (d_lonB - d_lonA) * (M_PI/180.0);
double a = sin(d_lat/2)*sin(d_lat/2) + cos(d_latA*M_PI/180.0)*cos(d_latB*M_PI/180.0)*sin(d_lon/2)*sin(d_lon/2);
double c = 2*atan2(sqrt(a), sqrt(1-a));
return FLOAT(earth_radius*c);
}
/* * @desc External function to compute a position using a reference position, a distance and an orientation
* @param p_iutLongPosVector Reference position
* @param p_distance Distance to the reference position (in meter)
* @param p_orientation Direction of the computed position (0 to 359; 0 means North)
* @param p_latitude Computed position's latitude
* @param p_longitude Computed position's longitude
fx_computePositionUsingDistance(in Int32 p_refLatitude,in Int32 p_refLongitude,in float p_distance,in integer p_orientation,out Int32 p_latitude,out Int32 p_longitude);
*/
void fx__computePositionUsingDistance(
const INTEGER& p__refLatitude,
const INTEGER& p__refLongitude,
const FLOAT& p__distance,
const INTEGER& p__orientation,
INTEGER& p__latitude,
INTEGER& p__longitude
) {
double distance = ((double)p__distance) / 6371000.0;
double angle = ((double)p__orientation) * (M_PI / 180.0);
double ref_lat = ((double)p__refLatitude) * (M_PI / 180.0);
// double ref_lon = ((double)p__refLongitude) * (M_PI / 180.0);
p__latitude = asin(sin(ref_lat)*cos(distance) + cos(ref_lat)*sin(distance)*cos(angle)) * 180.0 / M_PI;
p__longitude = ((double)p__refLongitude) + atan2(sin(angle)*sin(distance)*cos(ref_lat), cos(distance) - sin(ref_lat)*sin((double)p__latitude))*(180.0/M_PI);
}
/* * @desc External function to compute radius of a given circular area
* @param p_squareMeters Square meters of an circular area
* @return Computed radius in meters
fx_computeRadiusFromCircularArea(in float p_squareMeters) return float;
*/
FLOAT fx__computeRadiusFromCircularArea(
const FLOAT& p__squareMeters
) {
return FLOAT(sqrt(p__squareMeters/M_PI));
}
} // end of Namespace
#include "LibItsCommon_Functions.hh"
#include <chrono>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
namespace LibItsCommon__Functions
{
/**
* @desc This external function gets the current time
* @return Timestamp - current time since 01/01/2014 in milliseconds
* @see fx_getCurrentTime() return TimestampIts
*/
INTEGER fx__getCurrentTime(
) {
unsigned long long ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() - 1072911600000L; // TODO Add a global method such as its_tme() & its_time_mod() beacuse it is used also in geonetworking_layer
/*unsigned long long its_ref_time = 1072911600000L;
struct timeval tv;
gettimeofday(&tv, NULL);
unsigned long long ms = tv.tv_sec * 1000 + tv.tv_usec / 1000;*/
INTEGER i;
i.set_long_long_val(ms);
return i;
}
/**
* @desc Gets the current time since 01/01/2004
* @return TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
* @see function f_getCurrentTimeMark() return TimeMark
*/
INTEGER fx__getCurrentTimeMark(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/**
* @desc Gets the Minute of current UTC year
* @return MinuteOfTheYear - tenths of a second in the current or next hour in units of 1/10th second from UTC time
* @see function f_getMinuteOfTheYear() return MinuteOfTheYear
*/
INTEGER fx__getMinuteOfTheYear(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/**
* @desc Gets the milliseconds point in the current UTC minute
* @return DSecond - The milliseconds point in the current UTC minute (0..60000)
* @see function f_getDSecond() return DSecond
*/
INTEGER fx__getDSecond(
) {
// TODO: this is just a sceleton. fill in the function
return 0;
}
/* * @desc External function to compute distance between two points
* @param p_latitudeA Latitude of first point
* @param p_longitudeA Longitude of first point
* @param p_latitudeB Latitude of second point
* @param p_longitudeB Longitude of second point
* @return Computed distance in meters
fx_computeDistance(in Int32 p_latitudeA, in Int32 p_longitudeA, in Int32 p_latitudeB, in Int32 p_longitudeB) return float;
*/
FLOAT fx__computeDistance(
const INTEGER& p__latitudeA,
const INTEGER& p__longitudeA,
const INTEGER& p__latitudeB,