Req #54473 [Com]: PATCH: openssl extension should also load engines

From: Date: Tue, 26 Apr 2011 18:13:06 +0000
Subject: Req #54473 [Com]: PATCH: openssl extension should also load engines
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160384@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54473&edit=1

 ID:                 54473
 Comment by:         andrew at ei-grad dot ru
 Reported by:        crrodriguez at opensuse dot org
 Summary:            PATCH: openssl extension should also load engines
 Status:             Open
 Type:               Feature/Change Request
 Package:            OpenSSL related
 Operating System:   all
 PHP Version:        5.3SVN-2011-04-05 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Hmm... Thats seems strange for me, why do you want to load ALL engines??
A right way to solve your problem is to properly load OPENSSL config
from openssl.cfg file (with a call of OPENSSL_config(NULL) function, for
example), where you can specify the required engine to be used for all
applications using OpenSSL.

man OPENSSL_config:

       It is strongly recommended that all new applications call
       OPENSSL_config() or the more sophisticated functions such as
       CONF_modules_load() during initialization (that is before
starting any
       threads). By doing this an application does not need to keep
track of
       all configuration options and some new functionality can be
supported
       automatically.

Unfortunaly, for some reason, PHP openssl extension doesn't do this.
That's a bug, IMHO.


Previous Comments:
------------------------------------------------------------------------
[2011-04-11 10:55:39] cataphract@php.net

Reading the docs, it would appear ENGINE_cleanup() should be called on
shutdown.

------------------------------------------------------------------------
[2011-04-05 23:39:16] crrodriguez at opensuse dot org

Description:
------------
Currently openssl allows hardware engines to be used, which are usually
much 
faster than the library itself, but PHP does not currently load them if
available 
at Module init..

This is more important now that when openssl is used with new Intel
CPUs, it can 
use AES_NI instruction sets.
  
The attached patch fixes the problem.

Test script:
---------------
--------------

Expected result:
----------------
engines loaded at MINIT

Actual result:
--------------
Not currently loaded.


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



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


Thread (6 messages)

« previous php.bugs (#160384) next »