diff options
author | Denis Vlasenko | 2008-11-13 12:23:46 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-11-13 12:23:46 +0000 |
commit | 6b1e3d7e734f85a08c2e4414764f03a7f880b3e6 (patch) | |
tree | e05a20ca45050c6cd9b2efd7eeb995bb44c4b70c /loginutils | |
parent | 4d47692fb899be6dec58e7e1ae22893ebb92fa37 (diff) | |
download | busybox-6b1e3d7e734f85a08c2e4414764f03a7f880b3e6.zip busybox-6b1e3d7e734f85a08c2e4414764f03a7f880b3e6.tar.gz |
libbb: remove glibc-style bloat from sha_crypt. -1130 bytes.
cryptpw: add more difficult test vectors.
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/cryptpw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c index d76deac..0c1a9a0 100644 --- a/loginutils/cryptpw.c +++ b/loginutils/cryptpw.c @@ -34,7 +34,7 @@ done int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int cryptpw_main(int argc UNUSED_PARAM, char **argv) { - char salt[sizeof("$N$") + 16]; + char salt[sizeof("$N$") + 16 + TESTING*100]; char *opt_a; int opts; @@ -54,7 +54,12 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv) salt[1] = '5' + (strcmp(opt_a, "sha512") == 0); crypt_make_salt(salt + 3, 16/2, 0); /* sha */ #if TESTING - strcpy(salt, "$6$em7yVj./Mv5n1V5X"); + strcpy(salt, "$5$rounds=5000$toolongsaltstring"); + // with "This is just a test" as password, should produce: + // "$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5" + strcpy(salt, "$6$rounds=5000$toolongsaltstring"); + // with "This is just a test" as password, should produce: + // "$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQzQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0" #endif } else #endif |