]> granicus.if.org Git - php/commitdiff
MFB: Make mcrypt_enc_self_test() return value compatible with documentation and mcryp...
authorDavid Soria Parra <dsp@php.net>
Sun, 18 May 2008 17:15:08 +0000 (17:15 +0000)
committerDavid Soria Parra <dsp@php.net>
Sun, 18 May 2008 17:15:08 +0000 (17:15 +0000)
ext/mcrypt/mcrypt.c
ext/mcrypt/tests/mcrypt_enc_self_test.phpt

index e72a97ec53dd8046ee906879a7f634757b149267..47e46d6de6725dd8c5b2fce86b4e7630e66782f8 100644 (file)
@@ -476,7 +476,12 @@ PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes)
 PHP_FUNCTION(mcrypt_enc_self_test)
 {
        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;
+       }
 }
 /* }}} */
 
index a161e0e02befbf63d4c1f120b8ea59edac7ee4fd..54ce213de2d7798d5f66d5c1a4ccd563a69bb167 100644 (file)
@@ -7,4 +7,4 @@ mcrypt_enc_self_test
 $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
 var_dump(mcrypt_enc_self_test($td));
 --EXPECT--
-int(0)
\ No newline at end of file
+bool(true)