5.16.3.11 Object(DN-Binary)

The LDAP representation of the attribute value corresponds to SYNTAX_DISTNAME_BINARY. The object_DN portion of the LDAP representation is treated as if it were in Object(DS-DN) syntax and converted to the DSNAME syntax representation, as explained in section 5.16.2.3. The binary_value portion of the LDAP representation is converted to the binary value (an array of bytes) and stored in the byteVal field of the SYNTAX_ADDRESS structure. The dataLen field of SYNTAX_ADDRESS is set to the length of the array, in bytes, plus 4, where 4 is the length of the dataLen field.

Padding is added between the DSNAME and SYNTAX_ADDRESS structures so that the length of DSNAME plus padding modulo 4 equals 0. The padding is an array of bytes, each byte of value 0. The valLen field of ATTRVAL equals the length of the DSNAME structure, plus the number of bytes added for padding, plus the length of the SYNTAX_ADDRESS structure.

All the multibyte quantities in the DSNAME and SYNTAX_ADDRESS structures are stored in little-endian format.

Example where padding is required because DSNAME is not 4-byte aligned:

 LDAP value:
 B:8:00000005:<GUID=2d8b0ce6-aa32-4f31-a6e8-88343e6244a5>;<SID=010100001cd509a018459359>;DC=test,DC=com
  
 Representation of data as SYNTAX_DISTNAME_BINARY:
  
 +0x000 Name             : DSNAME
    +0x000 structLen        : 0x56
    +0x004 SidLen           : 0xc
    +0x008 Guid             : 2d8b0ce6-aa32-4f31-a6e8-88343e6244a5
    +0x018 Sid              : S-1-483723680-1502823704
    +0x034 NameLen          : 0xe
    +0x038 StringName       : "DC=test,DC=com"
 +0x058 Data             : SYNTAX_ADDRESS
    +0x000 dataLen          : 8
    +0x004 byteVal          : 00 00 00 05
  
 valLength: 96
  
 payload:
  
 56 00 00 00 0c 00 00 00 e6 0c 8b 2d 32 aa 31 4f  V..........-2.1O
 a6 e8 88 34 3e 62 44 a5 01 01 00 00 1c d5 09 a0  ...4>bD.........
 18 45 93 59 00 00 00 00 00 00 00 00 00 00 00 00  .E.Y............
 00 00 00 00 0e 00 00 00 44 00 43 00 3d 00 74 00  ........D.C.=.t.
 65 00 73 00 74 00 2c 00 44 00 43 00 3d 00 63 00  e.s.t.,.D.C.=.c.
 6f 00 6d 00 00 00 00 00 08 00 00 00 00 00 00 05  o.m.............

Example where padding is not required because DSNAME is 4-byte aligned:

  
 LDAP value: 
 B:8:0000000D:<GUID= ff432fe0-8c94-43cf-915c-286b197b0164>;<SID=010100001a180dba5ec27614>;DC=test1,DC=test,DC=com.
  
 Representation of data as SYNTAX_DISTNAME_BINARY:
  
 +0x000 Name             : DSNAME
    +0x000 structLen        : 0x68
    +0x004 SidLen           : 0xc
    +0x008 Guid             : ff432fe0-8c94-43cf-915c-286b197b0164
    +0x018 Sid              : S-1-437783994-343327326
    +0x034 NameLen          : 0x17
    +0x038 StringName       : "DC=test1,DC=test,DC=com"
 +0x068 Data             : SYNTAX_ADDRESS
    +0x000 dataLen          : 0x74003d
    +0x004 byteVal          : 00 00 00 0d
  
 68 00 00 00 0c 00 00 00 e0 2f 43 ff 94 8c cf 43  h......../C....C
 91 5c 28 6b 19 7b 01 64 01 01 00 00 1a 18 0d ba  .\(k.{.d........
 5e c2 76 14 00 00 00 00 00 00 00 00 00 00 00 00  ^.v.............
 00 00 00 00 17 00 00 00 44 00 43 00 3d 00 74 00  ........D.C.=.t.
 65 00 73 00 74 00 31 00 2c 00 44 00 43 00 3d 00  e.s.t.1.,.D.C.=.
 74 00 65 00 73 00 74 00 2c 00 44 00 43 00 3d 00  t.e.s.t.,.D.C.=.
 63 00 6f 00 6d 00 00 00 08 00 00 00 00 00 00 0d  c.o.m...........