[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

handling of negative integers


I've noticed that heimdal's ASN.1 code, which is quite clever by the
way, doesn't seem to handle encoding/decoding of negative integers
correctly.  1 is encoded correctly as 0x01, but -1 is encoded as
0xFFFFFFFF, where it should actually be encoded as 0xFF in the minimum
number of octets in two's complement representation (unless I'm

This isn't really an issue unless you have to start dealing with
implementations that use negative values.  Microsoft NT5 beta for
example, uses negative integers for some of its non-standard encryption
types, i.e. -128 is RC4_HMAC.