Bug #4870

Tests with RSAWalletServicePHP fail on Windows

Added by David Bruehlmeier over 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Security
Start date:
2009-10-02
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

Error in encryptingAndDecryptingBasicallyWorks Detail
E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php:232
Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php line 232
Error in checkRSAEncryptedPasswordReturnsTrueForACorrectPassword Detail
E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php:232
Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php line 232
Error in checkRSAEncryptedPasswordReturnsFalseForAnIncorrectPassword Detail
E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php:232
Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php line 232
Error in decryptingWithAKeypairUUIDMarkedForPasswordUsageThrowsAnException Detail
E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php:232
Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in E:\Sources\FLOW3\Packages\Framework\FLOW3\Classes\Security\Cryptography\RSAWalletServicePHP.php line 232
My Setup
  • Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
  • Windows NT SP3
#1

Updated by Karsten Dambekalns over 11 years ago

  • Category set to Security
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
It seems openssl_pkey_new() in generateNewKeyPair() returns FALSE instead of the expected resource. There are two things to do:
  • (we) check the return value so we get a sensible error message
  • (you, David) check your setup, see below

It seems on Windows you need to configure things correctly so OpenSSL works as expected, see http://de3.php.net/manual/en/openssl.installation.php - did you make sure it is set up as needed?

#2

Updated by David Bruehlmeier over 11 years ago

Hi

OpenSSL is installed and working according to phpinfo():

openssl
OpenSSL support     enabled
OpenSSL Library Version     OpenSSL 0.9.8k 25 Mar 2009
OpenSSL Header Version     OpenSSL 0.9.8k 25 Mar 2009 

However, when I execute this:

$key = openssl_pkey_new();
while ($msg = openssl_error_string())
    echo $msg . "<br />\n";

I get

error:02001003:system library:fopen:No such process
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib
error:02001003:system library:fopen:No such process
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib

I guess its due to a misconfiguration in openssl.cnf, but what exactly might it be...? Has anybody else got the same problem?

#3

Updated by Karsten Dambekalns over 11 years ago

David Bruehlmeier wrote:

OpenSSL is installed and working according to phpinfo():

Installed yes, working - not necessarily.

I guess its due to a misconfiguration in openssl.cnf, but what exactly might it be...?

Given the error message, I think the DLLs (ssleay.dll and libeay.dll) are missing - did you check? Or the configuration file is not found.

#4

Updated by David Bruehlmeier over 11 years ago

You were right, it was installed, but not working... I solved it by installing "Win32 OpenSSL v0.9.8k Light" from http://www.slproweb.com/products/Win32OpenSSL.html (without changing the default installation directory which seems to be C:\OpenSSL). The tests now run "green" even on 1.0.0-alpha5.

#5

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from Accepted to Resolved
  • Target version set to 1.0 alpha 6
  • % Done changed from 0 to 100

Ok, glad you got it working now.

Also available in: Atom PDF