svn commit: samba r20251 - in branches/SAMBA_4_0/source: libnet librpc/idl torture/rpc

Stefan (metze) Metzmacher metze at samba.org
Tue Dec 19 14:27:41 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

metze at samba.org schrieb:
> Author: metze
> Date: 2006-12-19 13:38:42 +0000 (Tue, 19 Dec 2006)
> New Revision: 20251
> 
> WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20251
> 
> Log:
> I found out that the oid-prefix to uint32-id-prefix mapping is transferred
> in replication replies, but I don't know the exact encoding.
> 
> for example the oids are transferred as:
> 
> 2.5.4			=> uint8_t v[] = { 0x55, 0x04 };
> 2.5.5			=> uint8_t v[] = { 0x55, 0x05 };
> 2.5.6			=> uint8_t v[] = { 0x55, 0x06 };
> 2.5.18			=> uint8_t v[] = { 0x55, 0x12 };
> 2.5.20			=> uint8_t v[] = { 0x55, 0x14 };
> 2.5.21			=> uint8_t v[] = { 0x55, 0x15 };
> 1.2.840.113556.1.2	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x02 };
> 1.2.840.113556.1.3	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x03 };
> 1.2.840.113556.1.4	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x04 };
> 1.2.840.113556.1.5	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x05 };
> 1.2.840.113556.1.5.7000	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x05, 0xb6, 0x58 };
> 1.2.840.113549.1.9	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09 };
> 2.16.840.1.113730.3	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03 };
> 2.16.840.1.113730.3.1	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03, 0x01 };
> 2.16.840.1.113730.3.2	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03, 0x02 };
> 0.9.2342.19200300.100.1	=> uint8_t v[] = { 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01 };
> 0.9.2342.19200300.100.4	=> uint8_t v[] = { 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04 };
> 1.3.6.1.4.1.250.1	=> uint8_t v[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x7a, 0x01 };
> 1.3.6.1.4.1.1466.101.119=> uint8_t v[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x65, 0x77 };
> 
> if someone knows how the encoding works, please tell me:-)
> I assume some ASN.1 encoding...

ok, I found the encoding of the first byte, which represents the first 2
numbers of the oid string.

this program gives:

0x55 => 2.5
0x60 => 2.16
0x2A => 1.2
0x2B => 1.3
0x09 => 0.9

#include <stdio.h>
int main(void)
{
        int i;
        int v[] = { 0x55, 0x60, 0x2a, 0x2b, 0x09 };
        int first;
        int second;
        for (i=0; i < 5; i++) {
                first = (v[i] >> 3) / 5;
                second = v[i] - ((first * 5) << 3);
                printf("0x%02X => %u.%u\n",
                        v[i], first, second);
        }
        return 0;
}

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFh/bcm70gjA5TCD8RApUkAJ43ZkdPpGiNXO1avz0potYxRZT0GQCdFVqI
cyWL9pQzAlka891GgfESd+g=
=Qw3q
-----END PGP SIGNATURE-----


More information about the samba-cvs mailing list