#37620 [NEW]: mysqli_ssl_set validation is innappropriate
| From: | ap at zip dot com dot au | Date: | Mon, 29 May 2006 01:43:09 +0000 |
| Subject: | #37620 [NEW]: mysqli_ssl_set validation is innappropriate | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-97710@lists.php.net to get a copy of this message | ||
From: ap at zip dot com dot au
Operating system: Linux
PHP version: 5.1.4
PHP Bug Type: MySQLi related
Bug description: mysqli_ssl_set validation is innappropriate
Description:
------------
When the validation code was introduced to fix bug #36802 a seemingly
blind change was made to all (probably - I did not count :) the functions
to validate against MYSQLI_STATUS_VALID as can be seen here:
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.18&r2=1.118.2.19
This doesn't work for mysqli_ssl_set as it needs to be called before a
connection to the mysql server is made and as such, judging by the
documentation here:
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?view=log#rev1.118.2.19
MYSQLI_STATUS_INITIALIZED appears to be a better test to validate
against.
Have patch. Hopefully will be able to attach it once I submit it.
Reproduce code:
---------------
$db = mysqli_init();
mysqli_ssl_set($db,$key, $cert, $cacert, NULL,NULL);
exit;
Expected result:
----------------
*nothing*
Actual result:
--------------
Warning: mysqli_ssl_set(): invalid object or resource mysqli in test.php
on line 5
--
Edit bug report at http://bugs.php.net/?id=37620&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37620&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37620&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37620&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37620&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37620&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37620&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37620&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37620&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37620&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37620&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37620&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37620&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37620&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37620&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37620&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37620&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37620&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37620&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37620&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37620&r=mysqlcfg