Skip to content

Commit

Permalink
yescrypt: Add more tests.
Browse files Browse the repository at this point in the history
Test that crypt() with hashed password in place of settings works the
same as settings.
  • Loading branch information
vt-alt authored and besser82 committed Oct 24, 2018
1 parent cc50dde commit 1cf3172
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test-crypt-yescrypt.c
Expand Up @@ -43,8 +43,16 @@ test(const char *p, const char *s, const char *m)
int
main (void)
{
int result = test("pleaseletmein", "$y$jD5.7$LdJMENpBABJJ3hIHjB1Bi.",
"$y$jD5.7$LdJMENpBABJJ3hIHjB1Bi.$HboGM6qPrsK.StKYGt6KErmUYtioHreJd98oIugoNB6");
int result = 0;

#define YSETTINGS "$y$jD5.7$LdJMENpBABJJ3hIHjB1Bi."
#define YHASHPART "HboGM6qPrsK.StKYGt6KErmUYtioHreJd98oIugoNB6"
#define YFULLHASH YSETTINGS "$" YHASHPART
result |= test("pleaseletmein", YSETTINGS, YFULLHASH);
result |= test("pleaseletmein", YFULLHASH, YFULLHASH);
result |= test("pleaseletmein", YSETTINGS "$", YFULLHASH);
result |= test("pleaseletmein", YSETTINGS "$garbage", YFULLHASH);

result |= test("", "$y$jD5.7$", "$y$jD5.7$$JD8dsR.nt1ty0ltQ2HHwauaDRoOUIEaA5i.vpj2nyL.");
result |= test("", "$y$jD5.7$$", "$y$jD5.7$$JD8dsR.nt1ty0ltQ2HHwauaDRoOUIEaA5i.vpj2nyL.");

Expand Down

0 comments on commit 1cf3172

Please sign in to comment.