|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-23 13:18 UTC] pajoye@php.net
[2006-10-24 08:42 UTC] kprzemek at coig dot katowice dot pl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 19:00:01 2025 UTC |
Description: ------------ Private key password is always Ok, no matter if the password is right or wrong. And it's not OK, because if I give wrong private key password, I should get an error. So I guess this function isn't working well. Everything is OK on php4.4.2 Is is because php5? I had the same error. No matter if the password is right or wrong it's OK (it's functioning) and it shouldnt't be. Reproduce code: --------------- public function userPassCheck($password,$nruser,$name) { $nras=(int)$this->asID; ifx_textasvarchar(1); $sql="SELECT priv_key". " FROM user_ssl ". " WHERE nras=$nras ". " AND nruser=$nruser"; $rs=$this->db->Execute($sql); if (!$rs) { $this->blad="<b>Error...</b><br>". $this->db->ErrorNo()." - ". $this->db->ErrorMsg(); throw new Exception($this->blad); } $this->privkey=$rs->fields['priv_key']; $rsCert=openssl_get_privatekey($this->privkey,$password); if($rsCert) { echo "<br>OK"; } else { echo "<br>NOT OK"; } } Expected result: ---------------- If password is wrong I expect "NOT OK" if is right "OK". Actual result: -------------- Always "OK".