Denys Vlasenko | 6c73aaf | 2017-01-15 21:48:31 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Copyright 2017 by Denys Vlasenko <vda.linux@googlemail.com> |
| 4 | # Licensed under GPLv2, see file LICENSE in this source tree. |
| 5 | |
| 6 | . ./testing.sh |
| 7 | |
| 8 | # testing "description" "command" "result" "infile" "stdin" |
| 9 | |
Denys Vlasenko | 00b5051 | 2021-11-28 12:21:23 +0100 | [diff] [blame] | 10 | #optional USE_BB_CRYPT |
| 11 | testing "cryptpw des 12" \ |
| 12 | "cryptpw -m des QWErty '123456789012345678901234567890'" \ |
| 13 | '12MnB3PqfVbMA\n' "" "" |
| 14 | |
| 15 | testing "cryptpw des 55" \ |
| 16 | "cryptpw -m des QWErty 55" \ |
| 17 | '55tgFLtkT1Y72\n' "" "" |
| 18 | |
| 19 | testing "cryptpw des zz" \ |
| 20 | "cryptpw -m des QWErty zz" \ |
| 21 | 'zzIZaaXWOkxVk\n' "" "" |
| 22 | #SKIP= |
| 23 | |
Denys Vlasenko | 6c73aaf | 2017-01-15 21:48:31 +0100 | [diff] [blame] | 24 | optional USE_BB_CRYPT_SHA |
| 25 | testing "cryptpw sha256" \ |
| 26 | "cryptpw -m sha256 QWErty '123456789012345678901234567890'" \ |
| 27 | '$5$1234567890123456$5DxfOCmU4vRhtzfsbdK.6wSGMwwVbac7ZkWwusb8Si7\n' "" "" |
| 28 | |
| 29 | testing "cryptpw sha256 rounds=99999" \ |
| 30 | "cryptpw -m sha256 QWErty 'rounds=99999\$123456789012345678901234567890'" \ |
| 31 | '$5$rounds=99999$1234567890123456$aYellycJGZM6AKyVzaQsSrDBdTixubtMnM6J.MN0xM8\n' "" "" |
| 32 | |
| 33 | testing "cryptpw sha512" \ |
| 34 | "cryptpw -m sha512 QWErty '123456789012345678901234567890'" \ |
| 35 | '$6$1234567890123456$KB7QqxFyqmJSWyQYcCuGeFukgz1bPQoipWZf7.9L7z3k8UNTXa6UikbKcUGDc2ANn7DOGmDaroxDgpK16w/RE0\n' "" "" |
| 36 | |
| 37 | testing "cryptpw sha512 rounds=99999" \ |
| 38 | "cryptpw -m sha512 QWErty 'rounds=99999\$123456789012345678901234567890'" \ |
| 39 | '$6$rounds=99999$1234567890123456$BfF6gD6ZjUmwawH5QaAglYAxtU./yvsz0fcQ464l49aMI2DZW3j5ri28CrxK7riPWNpLuUpfaIdY751SBYKUH.\n' "" "" |
| 40 | SKIP= |
| 41 | |
| 42 | exit $FAILCOUNT |