otr4j / otr4j-issues

1 stars 0 forks source link

InstanceTag has unnecessary, low upper limit #19

Closed cobratbq closed 4 years ago

cobratbq commented 9 years ago

I'm looking at class InstanceTag. It seems to have an upper limit to the allowed value: HIGHEST_VALUE = 0x11111111.

I cannot explain this value and the OTRv3 documentation does not specify an upper bound AFAICT. Furthermore, 0x11111111 is quite far from the highest 32 bit value (0xffffffff).

cobratbq commented 9 years ago

I also sent Marin an email and he confirms that this isn't the correct upper limit.

I'm currently looking into what's the best data type to use, since Java types are always signed. I think it would be sufficient to go with integer (int) and check for value outside of range: [0, 0x00000100]. Although that isn't as nice, as Integer.MAX_VALUE is not the maximum value possible.

cobratbq commented 9 years ago

I have created PR https://github.com/otr4j/otr4j/pull/52 to fix this.

cobratbq commented 9 years ago

Fixed with https://github.com/otr4j/otr4j/issues/52