EldoS | Feel safer!

Software components for data protection, secure storage and transfer

May I ask a TLS, but non SBB related question?

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#12913
Posted: 04/01/2010 07:42:32
by neil young (Standard support level)
Joined: 11/05/2007
Posts: 96

Sort of an easter egg...
Regards
#12914
Posted: 04/01/2010 09:11:21
by Ken Ivanov (EldoS Corp.)

You are welcome.
#12915
Posted: 04/01/2010 09:17:39
by neil young (Standard support level)
Joined: 11/05/2007
Posts: 96

Thanks. Somehow I knew, that you'll answer that way :)

The problem seems to be rather simple and easy to answer for TLS experts as you are. If not - don't mess with it.

I have a question concerning how to understand 4.3 of RFC 2246.

The vector definition seems rather clear to me. I have a problem to catch the meaning of this statement:

"The length of an encoded vector must be an even multiple of the length of a single element (for example, a 17 byte vector of uint16 would be illegal). "

Given the following declaration:

opaque config_data<2^24-1>;

Is this understanding correct:
1) The declaration is slightly incorrect, because the "floor" element is missing. I tend to treat it to be 0
2) The number of bytes expressing the length of the vector is 3, large enough to count for 2^24-1 bytes
3) If e.g. the size of the vector's data is 2 bytes, do I really have to add a pad byte in order to meet the "even multiple" demand?

Sample: Data payload is 0x4711

Is this correct?
00 00 02 47 11 0

Or this?
00 00 02 47 11

Or none?

Kind regards
#12917
Posted: 04/01/2010 10:13:27
by Ken Ivanov (EldoS Corp.)

Quote
Is this understanding correct:
1) The declaration is slightly incorrect, because the "floor" element is missing. I tend to treat it to be 0

Yes. Some third-party TLS-based specifications are not free of such "typos".

Quote
2) The number of bytes expressing the length of the vector is 3, large enough to count for 2^24-1 bytes

Yes, exactly.

Quote
3) If e.g. the size of the vector's data is 2 bytes, do I really have to add a pad byte in order to meet the "even multiple" demand?

Hmm, no. The above rule states that the encoded size value (that is put to the first three bytes in your case) must be a multiple of the vector element's size (two in your case). E.g. if a type is defined as uint16 data<0..2^24-1>, then the sizes encoded as 00 00 01, 00 00 FF and 00 FF FF are illegal (as neither of them is a multiple of two).

If the type is defined as uint16<0..2^24-1>, then the 0x4711 value (one uint16 element) will be encoded as 00 00 02 47 11
#12918
Posted: 04/01/2010 11:15:56
by neil young (Standard support level)
Joined: 11/05/2007
Posts: 96

Many thanks. In my case the "type" is "opaque". Seems to be "byte", so the encoding is also 00 00 02 47 11.

Have a great Easter weekend.
Regards
#12919
Posted: 04/01/2010 11:27:29
by Ken Ivanov (EldoS Corp.)

Yes, opaque is a synonym for uint8. That is, the length for the value of this type can be anything within the defined scope (00 00 00 - FF FF FF).

Thank you, have a nice Easter too!
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 916 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!