summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/crypt_checksalt.phpt11
-rw-r--r--xpass.stub.php5
-rw-r--r--xpass_arginfo.h4
3 files changed, 14 insertions, 6 deletions
diff --git a/tests/crypt_checksalt.phpt b/tests/crypt_checksalt.phpt
index b9a6462..f34f585 100644
--- a/tests/crypt_checksalt.phpt
+++ b/tests/crypt_checksalt.phpt
@@ -2,10 +2,17 @@
Test crypt_checksalt
--FILE--
<?php
+// salt with old algo is OK or LEGACY
$r = crypt_checksalt(crypt_gensalt(XPASS_CRYPT_STD_DES));
var_dump($r === CRYPT_SALT_METHOD_LEGACY || $r === CRYPT_SALT_OK);
-var_dump(crypt_checksalt(crypt_gensalt()) === CRYPT_SALT_OK);
-var_dump(crypt_checksalt("!not_a_valid_hash") === CRYPT_SALT_INVALID);
+
+// salt with default algo is OK
+$r = crypt_checksalt(crypt_gensalt());
+var_dump($r === CRYPT_SALT_OK);
+
+// bad salt is INVALID
+$r = crypt_checksalt("!not_a_valid_hash");
+var_dump($r === CRYPT_SALT_INVALID);
?>
--EXPECT--
bool(true)
diff --git a/xpass.stub.php b/xpass.stub.php
index d8f43d1..4cb0d67 100644
--- a/xpass.stub.php
+++ b/xpass.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-class-entries */
+/**
+ * @generate-class-entries
+ * @generate-legacy-arginfo 80000
+ */
/* use XPASS prefix to avoid conflicts with standard constants */
diff --git a/xpass_arginfo.h b/xpass_arginfo.h
index b730bc0..87ad78f 100644
--- a/xpass_arginfo.h
+++ b/xpass_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: db002b549531b275130c17883ff9810fb13017b1 */
+ * Stub hash: 09c1d047a579afe870fadd302bd2e34a5d06c370 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt_gensalt, 0, 0, IS_STRING, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 1, "null")
@@ -13,12 +13,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt_checksalt, 0, 1, IS_LONG,
ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
ZEND_END_ARG_INFO()
-
ZEND_FUNCTION(crypt_gensalt);
ZEND_FUNCTION(crypt_preferred_method);
ZEND_FUNCTION(crypt_checksalt);
-
static const zend_function_entry ext_functions[] = {
ZEND_FE(crypt_gensalt, arginfo_crypt_gensalt)
ZEND_FE(crypt_preferred_method, arginfo_crypt_preferred_method)