ID: 39236 User updated by: kprzemek at coig dot katowice dot pl Reported By: kprzemek at coig dot katowice dot pl -Status: Feedback +Status: Closed Bug Type: OpenSSL related Operating System: RHEL4 PHP Version: 5.1.6 Assigned To: pajoye New Comment:
Sorry my mistake. I use the private key wthout password. I don't know haw I could not notice that. Thanks for help. Everything in openssl_get_privatekey works fine. Previous Comments: ------------------------------------------------------------------------ [2006-10-23 13:18:29] [EMAIL PROTECTED] Please provide an example without external data, a link to a (sample) private key and the password to use. ------------------------------------------------------------------------ [2006-10-23 13:07:33] kprzemek at coig dot katowice dot pl 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". ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39236&edit=1