Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » ETSI ITS Security: IntX support(ETSI ITS Security, ETSI TS 103 097, Internet Engineering Task Force (IETF) RFC 2246 (TLS), Integer of variable length)
ETSI ITS Security: IntX support [message #1755103] Tue, 28 February 2017 08:06 Go to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 63
Registered: June 2016
Member
Hi All,

I have some questions for you:
1) Does TITAN support Integer of variable length as defined in Internet Engineering Task Force (IETF) RFC 2246 (TLS)?
2) If not, can I use variant description to indicate TITAN how to encode/decode it?

If not, I think the only solution is to add external functions to implement these encoding/decoding, is it correct?

Many thanks in advance for your support,

Best regards,

Yann Garcia
Senior Software Engineer
MCAD.net
**************************************
FSCOM
7 rue Soutrane - Garbejaire
F-06560 Sophia Antipolis cedex, FRANCE
************************************************
Tel: +33 (0)4 93 95 82 93
Tel: +33 (0)4 92 94 49 08
Mobile: +33 (0)7 61 00 77 05
Email: yann.garcia@fscom.fr
Skype: yann.garcia
Google+: garcia.yann@gmail.com
Re: ETSI ITS Security: IntX support [message #1755104 is a reply to message #1755103] Tue, 28 February 2017 08:10 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Yann,

yes it does,


see reference guide 4.23.4.7:


4.23.4.7 Type-specific attributes
IntX
Attribute syntax: IntX
Default value: none
Can be used with: integer types
Description: Encodes an integer value as the IntX type in the ETSI Common Library (defined in ETSI TS 103 097).
This is a variable length encoding for integers. Its length depends on the encoded value (but is always a multiple of 8 bits).
The data starts with a series of ones followed by a zero. This represents the length of the encoded value: the number of ones is equal to the number of additional octets needed to encode the value besides those used (partially) to encode the length. The following bits contain the encoding of the integer value (as it would otherwise be encoded).
Comment: Since the length of the encoding is variable, attribute FIELDLENGTH is ignored. Furthermore, IntX also sets BITORDER and BITORDERINFIELD to msb, and BYTEORDER to first, overwriting any manual settings of these attributes.
Only attribute COMP can be used together with IntX (if it's set to signbit, then the sign bit will be the first bit after the length).
Restrictions: Using IntX in a record or set with FIELDORDER set to lsb is only supported if the IntX field starts at the beginning of a new octet. A compiler error is displayed otherwise. The IntX field may start anywhere if the parent record/set's FIELDORDER is set to msb.
Examples:
// Example 1: Standalone IntX integer type with no sign bit:
type integer IntX_unsigned with { variant "IntX" }

// Encoding integer 10:
// 00001010
// ^ length bit (there are no ones as no additional octets are needed)

// Encoding integer 2184:
// 10001000 10001000
// ^^ length bits (one extra octet is needed after the partial length octet)

// Example 2: Standalone IntX integer type with sign bit:
type integer IntX_signed with { variant "IntX, COMP(signbit)" }

// Encoding integer -2184:
//             10101000 10001000
// length bits ^^
//               ^ sign bit

// Example 3: Standalone IntX integer type with 2's complement:
type integer IntX_compl with { variant "IntX, COMP(2scompl)" }

// Encoding integer -2184:
// 10110111 01111000
// ^^ length bits

// Example 4: IntX integer record field (starting in a partial octet):
type record RecIntXPartial {
  integer i,
  integer ix,
  bitstring bs
}
with {
  variant "FIELDORDER(msb)";
  variant (i) "FIELDLENGTH(12), BITORDER(msb)";
  variant (i) "BYTEORDER(first), BITORDERINFIELD(msb)";
  variant (ix) "IntX";
  variant (bs) "FIELDLENGTH(8)";
}

// Encoding record value { i := 716, ix := 716, bs := '10101010'B }:
// 00101100 11001000 00101100 11001010 10100000
// ^^^^^^^^ ^^^^ field 'i' (same encoding as 'ix', but with no length bits)
//   field 'ix' ^^^^ ^^^^^^^^ ^^^^ (the first 2 bits are the length bits)
//                     field 'bs' ^^^^ ^^^^

// Note: setting the record's FIELDORDER to 'lsb' in this case is not supported 
// and would cause the mentioned compiler error.




Best regards
Elemer
Re: ETSI ITS Security: IntX support [message #1755107 is a reply to message #1755104] Tue, 28 February 2017 08:27 Go to previous messageGo to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 63
Registered: June 2016
Member
Hello Elemer,

Thanks a lot,


Yann
Re: ETSI ITS Security: IntX support [message #1755108 is a reply to message #1755104] Tue, 28 February 2017 08:32 Go to previous message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 26
Registered: December 2015
Junior Member
Do you refer to the length indicator of the vectors in TLS:

T T'<floor..ceiling>;

opaque mandatory<300..400>;
/* length field is 2 bytes, cannot be empty */
uint16 longer<0..800>;
/* zero to 400 16-bit unsigned integers */

Do you want to implement TLS protocol module?
Previous Topic:Using TLS/DTLS with Titan test ports part3
Next Topic:Eclipse Titan 6.1.pl0 release notification
Goto Forum:
  


Current Time: Mon Sep 24 06:11:37 GMT 2018

Powered by FUDForum. Page generated in 0.02143 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top