Bug #65281 [Opn->Wfx]: openssl_error_string populated when no errors

From: Date: Mon, 12 Sep 2016 18:20:26 +0000
Subject: Bug #65281 [Opn->Wfx]: openssl_error_string populated when no errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203977@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65281&edit=1

 ID:                 65281
 Updated by:         bukka@php.net
 Reported by:        rlynch@php.net
 Summary:            openssl_error_string populated when no errors
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            OpenSSL related
 Operating System:   CentOS 2.6.18
 PHP Version:        5.4.17
 Block user comment: N
 Private report:     N

 New Comment:

That would be a BC break. I have done some work on this and it works as expected. Also all tests
added.


Previous Comments:
------------------------------------------------------------------------
[2013-07-17 18:56:59] rlynch@php.net

Description:
------------
---
From manual page: http://www.php.net/function.openssl-error-string#refsect1-function.openssl-error-string-returnvalues
---
openssl_* functions can "work" (return TRUE for the bool ones, and return valid resources
etc)

BUT, the openssl_error_string() function will still have been populated.



Test script:
---------------
// You'll have to provide your own private key...
$pkey = openssl_pkey_get_private($this->private_key);
$this->openssl_check();
$linux = '';
openssl_pkey_export($pkey, $linux);
$this->openssl_check();

    function openssl_check ()
    {
        // Xdebug isn't in production
        // And we don't want the logging in production
        // How conventient
        if (function_exists('xdebug_call_line'))
        {
            $errors = false;
            while ( ($s = openssl_error_string()) !== false )
            {
                if (!$errors)
                {
                    $errors = true;
                    error_log('openssl_errors in '.__FILE__.':
'.xdebug_call_line());
                }
                error_log("    $s");
            }
            return $errors;
        }
    }


Expected result:
----------------
No output at all.

Or at least something akin to INFO|WARNING|ERROR so I can filter out whatever these mean.

PS
You know these messages are completely incomprehensible, right?
I know they come straight from openssl, but may a translation table, or URL to openssl bug codes or
something...


Actual result:
--------------
A *lot* of each of these:
    error:0E06D06C:configuration file routines:NCONF_get_string:no value
    error:0906D06C:PEM routines:PEM_read_bio:no start line



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=65281&edit=1


Thread (2 messages)

« previous php.bugs (#203977) next »