How to encode snmp oid number greater than 32768?

55 views Asked by At

As a exercise, I tried encode snmp oid "1.3.6.1.4.1.33500" with BER and arrived as hex bytes as below.

   0x2b,
    0x6,
    0x1,
    0x4,
    0x1,
    0x82,
    0x85,
    0x5c,

I verified the 7th oid number as 0x2 * 128 * 128 + 0x5 *128 + 0x5c = 33500. Is this the correct way of encoding oid number greater than 32768 ?

1

There are 1 answers

0
John Bayko On

Not sure what your actual question is, since you obviously know how to do it. Here's a reference anyway: https://learn.microsoft.com/en-ca/windows/win32/seccertenroll/about-object-identifier?redirectedfrom=MSDN

I think you did make a mistake - this what I get:

33500 = 82dc
= 1000 0010 1101 1100
->x0000010 x0000101 x1011100
->10000010 10000011 01011100
->   8   2    8   3    5   c
= 82 83 5c

Maybe you had a conversion error, but basically that's is.