MFB: Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt_module_self_test()

This commit is contained in:
David Soria Parra 2008-05-18 17:15:08 +00:00
parent ad69a4c588
commit 024c25fc59
2 changed files with 7 additions and 2 deletions

View File

@ -476,7 +476,12 @@ PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes)
PHP_FUNCTION(mcrypt_enc_self_test) PHP_FUNCTION(mcrypt_enc_self_test)
{ {
MCRYPT_GET_TD_ARG MCRYPT_GET_TD_ARG
RETURN_LONG(mcrypt_enc_self_test(pm->td));
if (mcrypt_enc_self_test(pm->td) == 0) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
} }
/* }}} */ /* }}} */

View File

@ -7,4 +7,4 @@ mcrypt_enc_self_test
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, ''); $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
var_dump(mcrypt_enc_self_test($td)); var_dump(mcrypt_enc_self_test($td));
--EXPECT-- --EXPECT--
int(0) bool(true)