diff options
author | Zack Weinberg <zackw@panix.com> | 2021-07-21 14:43:29 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2021-07-21 14:43:29 -0400 |
commit | b3216026074e77d95f36c683bf5176c5dd92bc3c (patch) | |
tree | ebfee049e2267608206abd286098f4da150cb40c | |
parent | e2f27ca6e9d77ad8c7c026ec7bc11dc679e91f79 (diff) | |
download | libxcrypt-b3216026074e77d95f36c683bf5176c5dd92bc3c.tar.gz libxcrypt-b3216026074e77d95f36c683bf5176c5dd92bc3c.tar.bz2 libxcrypt-b3216026074e77d95f36c683bf5176c5dd92bc3c.zip |
Fix bigcrypt-related test cases in test/badsalt.
The test spec was only correct when both or neither of bigcrypt and
descrypt were enabled. This sort of thing is why we need the giant CI
configuration matrix we used to have on Travis.
-rw-r--r-- | test/badsalt.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/badsalt.c b/test/badsalt.c index 220826f..ecad067 100644 --- a/test/badsalt.c +++ b/test/badsalt.c @@ -106,7 +106,18 @@ static bool vt_yescrypt(const struct valid_setting *, const char *); static const struct valid_setting valid_cases[] = { V (descrypt, "Mp" ), - Vp (bigcrypt, 2, "Mp............" ), + /* bigcrypt is extra special: + this salt is a valid descrypt salt when bigcrypt isn't enabled + but descrypt is; + truncations down to 2 are valid when descrypt is enabled, but + if *only* bigcrypt is enabled, then truncations can only + go down to 14. */ + { + INCLUDE_bigcrypt ? "bigcrypt" : "descrypt (padded)", + "Mp............", 2, vt_varsuffix, + INCLUDE_descrypt ? 2 : 14, + INCLUDE_descrypt || INCLUDE_bigcrypt + }, V (bsdicrypt, "_J9..MJHn" ), Vv (md5crypt, 3, "$1$MJHnaAke$" ), Vtn(sunmd5, plain, sunmd5, "$md5$1xMeE.at$" ), |