On Wed, 21 Nov 2001, Lugeon Blaise wrote:

> Everything works fine, except for some serial number: If a my serial number
> starts with a number higher than 7, OpenSSL adds 00 before it.
>
> Ex:
>
> 7FF5A2 -> 7FF5 A2      : Correct
> 8FF5A2 -> 008F F5A2  : Incorrect
> FFF5A2 -> 00FF F5A2  : Incorrect
>
> I suspect that there is a trouble with a conversion (signed -> unsigned).

The serial number is an integer. An integer can be either positive or
negative, so there should be something to store the sign of it.
Actually, the sign is specified by the highest order bit of the number
(the one on the left when you display it). If it's 1, then the number is
negative.

If your number 8ff5a2 is a positive one, you must add a leading 00 before
it's representation, (because 8 has it's highest order bit set, a number
starting by 8 in it's representation should be negative).

Fortunately, that doesn't change the value of the number.

If you thought you could perform a byte by byte comparison to test the
serial numbers, you're wrong. Remember that serial numbers are in fact
integers, not binary blobs. You have to perform an arithmetic comparison.

-- 
Erwann ABALEA
[EMAIL PROTECTED]
RSA PGP Key ID: 0x2D0EABD5
-----
Against stupidity, the Gods themselves, contend in vain!

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to