summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko2017-01-15 21:48:31 +0100
committerDenys Vlasenko2017-01-15 21:48:31 +0100
commit6c73aaff38819533c55aecc53487d53521915e91 (patch)
tree0d2c0f0893420f61101d9501303c6e0e0165113c /testsuite
parent16e7f697f8064a4e5fc2f8e181fe6a7b9602b1b3 (diff)
downloadbusybox-6c73aaff38819533c55aecc53487d53521915e91.zip
busybox-6c73aaff38819533c55aecc53487d53521915e91.tar.gz
cryptpw: support "rounds=NNNNNNN$" thing in salts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/cryptpw.tests28
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/cryptpw.tests b/testsuite/cryptpw.tests
new file mode 100755
index 0000000..8ec476c
--- /dev/null
+++ b/testsuite/cryptpw.tests
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Copyright 2017 by Denys Vlasenko <vda.linux@googlemail.com>
+# Licensed under GPLv2, see file LICENSE in this source tree.
+
+. ./testing.sh
+
+# testing "description" "command" "result" "infile" "stdin"
+
+optional USE_BB_CRYPT_SHA
+testing "cryptpw sha256" \
+ "cryptpw -m sha256 QWErty '123456789012345678901234567890'" \
+ '$5$1234567890123456$5DxfOCmU4vRhtzfsbdK.6wSGMwwVbac7ZkWwusb8Si7\n' "" ""
+
+testing "cryptpw sha256 rounds=99999" \
+ "cryptpw -m sha256 QWErty 'rounds=99999\$123456789012345678901234567890'" \
+ '$5$rounds=99999$1234567890123456$aYellycJGZM6AKyVzaQsSrDBdTixubtMnM6J.MN0xM8\n' "" ""
+
+testing "cryptpw sha512" \
+ "cryptpw -m sha512 QWErty '123456789012345678901234567890'" \
+ '$6$1234567890123456$KB7QqxFyqmJSWyQYcCuGeFukgz1bPQoipWZf7.9L7z3k8UNTXa6UikbKcUGDc2ANn7DOGmDaroxDgpK16w/RE0\n' "" ""
+
+testing "cryptpw sha512 rounds=99999" \
+ "cryptpw -m sha512 QWErty 'rounds=99999\$123456789012345678901234567890'" \
+ '$6$rounds=99999$1234567890123456$BfF6gD6ZjUmwawH5QaAglYAxtU./yvsz0fcQ464l49aMI2DZW3j5ri28CrxK7riPWNpLuUpfaIdY751SBYKUH.\n' "" ""
+SKIP=
+
+exit $FAILCOUNT