php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71143 Define LIBRESSL_VERSION_NUMBER when available
Submitted: 2015-12-16 21:22 UTC Modified: -
Votes:3
Avg. Score:2.7 ± 0.5
Reproduced:0 of 0 (0.0%)
From: fsb at thefsb dot org Assigned:
Status: Open Package: OpenSSL related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-12-16 21:22 UTC] fsb at thefsb dot org
Description:
------------
Testing for LibreSSL and its version number via OPENSSL_VERSION_TEXT is possible but not ideal.

Since 2.2.2 LibreSSL defines LIBRESSL_VERSION_NUMBER. I would prefer to use this.

Please define LIBRESSL_VERSION_NUMBER as a constant in PHP user space, or provide another way to access it.

Test script:
---------------
if (defined('OPENSSL_VERSION_TEXT')) {
    echo 'OPENSSL_VERSION_TEXT is ' . OPENSSL_VERSION_TEXT . "\n";
    if (strpos(OPENSSL_VERSION_TEXT, 'LibreSSL') === 0) {
        echo 'LIBRESSL_VERSION_NUMBER is ' 
            . (defined('LIBRESSL_VERSION_NUMBER') ? dechex(LIBRESSL_VERSION_NUMBER) : 'undefined') 
            . "\n";
    }
} else {
    echo "OpenSSL not presentn\n";
}


Expected result:
----------------
For example...

OPENSSL_VERSION_TEXT is LibreSSL 2.3.1
LIBRESSL_VERSION_NUMBER is 20301000



Actual result:
--------------
For example...

OPENSSL_VERSION_TEXT is LibreSSL 2.3.1
LIBRESSL_VERSION_NUMBER is undefined

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 02:02:52 2024 UTC