summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-09-13 11:31:59 +0200
committerRemi Collet <remi@php.net>2024-09-13 11:31:59 +0200
commit6ebefa0cbe885cd65bdf678c6e85d8b76db03e28 (patch)
tree5dd147e7d6a77140d8845ca16b697220c0db3179 /tests
parent6c4e58ba64e3e7fd203a5e38247c98de920da612 (diff)
refresh stub (using 8.4 and compat flag)
Diffstat (limited to 'tests')
-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)