aboutsummaryrefslogtreecommitdiff
path: root/testsuite/cryptpw.tests
blob: 8ec476c9f05cd14806e2b6d3fb184a1af3958625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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