summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2021-05-06 21:32:03 +0200
committerBjörn Esser <besser82@fedoraproject.org>2021-05-19 20:52:50 +0200
commite334b064966a5604ecf534f45e95fbc70be93c94 (patch)
treeb0458256cbb0e8d23f1dec440a99ce980e248958
parentb6f74dfed38ce1d8b52ae345be8d3c0bfa9f1868 (diff)
downloadlibxcrypt-e334b064966a5604ecf534f45e95fbc70be93c94.tar.gz
libxcrypt-e334b064966a5604ecf534f45e95fbc70be93c94.tar.bz2
libxcrypt-e334b064966a5604ecf534f45e95fbc70be93c94.zip
test/checksalt.c: Adjust return values for `CRYPT_SALT_METHOD_LEGACY`.
As the crypt_checksalt() function now indicates whether a hashing method selected in the setting is considered to be weak, we need to adjust the expected return values.
-rw-r--r--test/checksalt.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/test/checksalt.c b/test/checksalt.c
index 7575dfd..78ab248 100644
--- a/test/checksalt.c
+++ b/test/checksalt.c
@@ -30,83 +30,83 @@ struct testcase
static const struct testcase testcases[] =
{
#if INCLUDE_descrypt || INCLUDE_bigcrypt
- { "", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
- { "..", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
- { "MN", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
+ { "..", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
+ { "MN", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
- { "..", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
- { "MN", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "..", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "MN", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_bsdicrypt
- { "_", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "_", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "_", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "_", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_md5crypt
- { "$1$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$1$", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "$1$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$1$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_nt
- { "$3$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$3$", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "$3$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$3$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_sunmd5
- { "$md5", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$md5", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "$md5", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$md5", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_sha1crypt
- { "$sha1", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$sha1", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "$sha1", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$sha1", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_sha256crypt
- { "$5$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$5$", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_METHOD_LEGACY },
#else
- { "$5$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$5$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_sha512crypt
- { "$6$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$6$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$6$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$6$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_bcrypt
- { "$2b$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$2b$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$2b$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$2b$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_bcrypt_a
- { "$2a$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$2a$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$2a$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$2a$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_bcrypt_x
- { "$2x$", CRYPT_SALT_OK, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$2x$", CRYPT_SALT_METHOD_LEGACY, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#else
- { "$2x$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$2x$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_bcrypt_y
- { "$2y$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$2y$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$2y$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$2y$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_yescrypt
- { "$y$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$y$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$y$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$y$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_scrypt
- { "$7$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$7$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$7$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$7$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
#if INCLUDE_gost_yescrypt
- { "$gy$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
+ { "$gy$", CRYPT_SALT_OK, CRYPT_SALT_OK, CRYPT_SALT_OK },
#else
- { "$gy$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
+ { "$gy$", CRYPT_SALT_INVALID, CRYPT_SALT_INVALID, CRYPT_SALT_INVALID },
#endif
/* All of these are invalid. */