|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-22 01:23 UTC] sniper@php.net
[2005-01-25 09:18 UTC] stanislav dot chachkov at gmail dot com
[2005-02-10 15:03 UTC] sniper@php.net
[2005-02-10 15:53 UTC] tony2001@php.net
[2005-02-10 17:20 UTC] stanislav dot chachkov at gmail dot com
[2005-02-13 18:29 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
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] => )