[openssl-users] Can you suggest any technical name for changing sources from openssl-1.0.2 to openssl-1.1.0?

Viktor Dukhovni openssl-users at dukhovni.org
Tue Nov 29 18:31:35 UTC 2016


> On Nov 29, 2016, at 10:12 AM, Jakob Bohm <jb-openssl at wisemo.com> wrote:
> 
>>     /*
>>      * OPENSSL_VERSION_NUMBER(3):
>>      *
>>      * OPENSSL_VERSION_NUMBER is a numeric release version identifier:
>>      *
>>      * MMNNFFPPS: major minor fix patch status
>>      *
> 
> Shouldn't this be
> MNNFFPPS: major minor fix patch status (only 1 nibble for major)

Yes, the comment in that file has an extra nibble for the major number,
but for portability reasons the version number is only 32 bits.

The code below the comment parses the unsigned long version number as
follows:

    if (version < 0x0930) {
        info->status = 0;
        info->patch = version & 0x0f;
        version >>= 4;
        info->micro = version & 0x0f;
        version >>= 4;
        info->minor = version & 0x0f;
        version >>= 4;
        info->major = version & 0x0f;
    } else if (version < 0x00905800L) {
        info->patch = version & 0xff;
        version >>= 8;
        info->status = version & 0xf;
        version >>= 4;
        info->micro = version & 0xff;
        version >>= 8;
        info->minor = version & 0xff;
        version >>= 8;
        info->major = version & 0xff;
    } else {
        info->status = version & 0xf;
        version >>= 4;
        info->patch = version & 0xff;
        version >>= 8;
        info->micro = version & 0xff;
        version >>= 8;
        info->minor = version & 0xff;
        version >>= 8;
        info->major = version & 0xff;
        if (version < 0x00906000L)
            info->patch &= ~0x80;
    }

So it could produce a major version > 15 on systems where long
is > 32 bits, but that's unlikely on the OpenSSL side at present.

-- 
	Viktor.



More information about the openssl-users mailing list