summaryrefslogtreecommitdiffstats
path: root/tests/crypt_checksalt.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/crypt_checksalt.phpt')
-rw-r--r--tests/crypt_checksalt.phpt11
1 files changed, 9 insertions, 2 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)