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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
5 - 1 = ?
Subscribe to this entry?

 
 [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: Fri Mar 29 12:01:27 2024 UTC