ID: 31634 Updated by: [EMAIL PROTECTED] Reported By: stanislav dot chachkov at gmail dot com Status: Assigned Bug Type: OpenSSL related Operating System: * PHP Version: 4CVS, 5CVS (2005-01-25) Assigned To: wez New Comment:
Can't reproduce. Check your OpenSSL installation. Previous Comments: ------------------------------------------------------------------------ [2005-02-10 15:03:16] [EMAIL PROTECTED] Assigning to the maintainer of ext/openssl ------------------------------------------------------------------------ [2005-01-25 09:18:52] stanislav dot chachkov at gmail dot com Same bug appears with http://snaps.php.net/php4-STABLE-latest.tar.gz ------------------------------------------------------------------------ [2005-01-22 01:23:49] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2005-01-21 14:31:06] stanislav dot chachkov at gmail dot com Description: ------------ openssl_seal always returns FALSE Returned sealed data and envelope keys are empty. There is no error returned by openssl_error_string I also tried various certificates and key lengths. config: php4.3.10 / openssl OpenSSL 0.9.7e / on BSD/OS 4.2 i386 './configure' '--with-mysql' '--enable-ftp' '--enable-dbase' '--with-gd' '--enable-gd' '--with-apxs=/web/bin/apxs' '--with-openssl=/usr/local/ssl' '--with-zlib-dir=/usr/local' '--enable-curl' '--with-curl=/usr/local' '--enable-mhash' '--with-mhas=/usr/local' The another config: '--with-openssl' , also produces this bug. The same script runs ok on another computers (php4.3.9/macosx or php4.3.10/linux) Reproduce code: --------------- <?php function seal($info,$key){ if($pk = openssl_get_publickey($key)){ echo openssl_error_string();echo '<br>'; $res=openssl_seal($info, $sealed, $ekeys, array($pk)); echo openssl_error_string();echo '<br>'; var_dump($res);echo '<br>'; openssl_free_key($pk); return array('sealed'=>$sealed,'ekey'=>$ekeys[0]); } echo openssl_error_string();echo '<br>'; return FALSE; } $key="-----BEGIN CERTIFICATE----- MIIBdDCCAR4CAQAwDQYJKoZIhvcNAQEEBQAwRTELMAkGA1UEBhMCQVUxEzARBgNV BAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 ZDAeFw0wNTAxMTgxOTUyMjBaFw0wNTA3MTcxOTUyMjBaMEUxCzAJBgNVBAYTAkFV MRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRz IFB0eSBMdGQwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAx7Z4soVmUJvKfhtBzKAP oRs9bdllaaTvy9I1kdf0AVFCKN7+US2LQBpGyCpTuENM+WQxJ6vGtJ2pYhGmbPm5 0QIDAQABMA0GCSqGSIb3DQEBBAUAA0EAlvwJFlCbuagfpc6XM7zY8JP0Gz+CXlbh NUjPgT8xkXzOBtjNxe+yNmhAfGyMXc7uKR+3tS6uHXzPvMg3PKCvqw== -----END CERTIFICATE----- "; print_r(seal("Secret data",$key));echo '<br>'; ?> Expected result: ---------------- int(11) Array ( [sealed] => ...here goes the encrypted string in binary ... [ekey] => ..here goes the envelope key in binary ...) Actual result: -------------- bool(false) Array ( [sealed] => [ekey] => ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31634&edit=1