cryptpw.tests 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # Copyright 2017 by Denys Vlasenko <vda.linux@googlemail.com>
  3. # Licensed under GPLv2, see file LICENSE in this source tree.
  4. . ./testing.sh
  5. # testing "description" "command" "result" "infile" "stdin"
  6. #optional USE_BB_CRYPT
  7. testing "cryptpw des 12" \
  8. "cryptpw -m des QWErty '123456789012345678901234567890'" \
  9. '12MnB3PqfVbMA\n' "" ""
  10. testing "cryptpw des 55" \
  11. "cryptpw -m des QWErty 55" \
  12. '55tgFLtkT1Y72\n' "" ""
  13. testing "cryptpw des zz" \
  14. "cryptpw -m des QWErty zz" \
  15. 'zzIZaaXWOkxVk\n' "" ""
  16. #SKIP=
  17. optional USE_BB_CRYPT_SHA
  18. testing "cryptpw sha256" \
  19. "cryptpw -m sha256 QWErty '123456789012345678901234567890'" \
  20. '$5$1234567890123456$5DxfOCmU4vRhtzfsbdK.6wSGMwwVbac7ZkWwusb8Si7\n' "" ""
  21. testing "cryptpw sha256 rounds=99999" \
  22. "cryptpw -m sha256 QWErty 'rounds=99999\$123456789012345678901234567890'" \
  23. '$5$rounds=99999$1234567890123456$aYellycJGZM6AKyVzaQsSrDBdTixubtMnM6J.MN0xM8\n' "" ""
  24. testing "cryptpw sha512" \
  25. "cryptpw -m sha512 QWErty '123456789012345678901234567890'" \
  26. '$6$1234567890123456$KB7QqxFyqmJSWyQYcCuGeFukgz1bPQoipWZf7.9L7z3k8UNTXa6UikbKcUGDc2ANn7DOGmDaroxDgpK16w/RE0\n' "" ""
  27. testing "cryptpw sha512 rounds=99999" \
  28. "cryptpw -m sha512 QWErty 'rounds=99999\$123456789012345678901234567890'" \
  29. '$6$rounds=99999$1234567890123456$BfF6gD6ZjUmwawH5QaAglYAxtU./yvsz0fcQ464l49aMI2DZW3j5ri28CrxK7riPWNpLuUpfaIdY751SBYKUH.\n' "" ""
  30. SKIP=
  31. exit $FAILCOUNT