srt-rfc icon indicating copy to clipboard operation
srt-rfc copied to clipboard

Describe the procedure to derive the signature flags

Open maxsharabayko opened this issue 2 years ago • 0 comments

Haivision has the PNP ID 'HAI'. The procedure for how it should be encoded to become 0x2029 is not clear.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |S|  V  |   PT  |              Sign             |   Resv1   | KK|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              KEKI                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Cipher    |      Auth     |       SE      |     Resv2     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Resv3             |     SLen/4    |     KLen/4    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              Salt                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                          Wrapped Key                          +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 10: Key Material Message structure

   Sign: 16 bits, value = {0x2029}.  This is a fixed-width field that
      contains the signature 'HAI' encoded as a PnP Vendor ID [PNPID]
      (in big-endian order).

The procedure is borrowed from an ancient life of device-driver/kernel-programmer. From an era where each bit was precious. This is far from modern full-text-based protocols. You concatenate the 5 last bits of the ascii codes, plus one leading 0:

lead      0
H=48h&1F-> 01000b
A=41h&1F->      00001b
I=49h&1F->           01001b
          0010000000101001b
             2   0   2   9h

maxsharabayko avatar Jul 03 '23 13:07 maxsharabayko