diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-13 12:23:46 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-13 12:23:46 +0000 |
commit | 6b1e3d7e734f85a08c2e4414764f03a7f880b3e6 (patch) | |
tree | e05a20ca45050c6cd9b2efd7eeb995bb44c4b70c /loginutils | |
parent | 4d47692fb899be6dec58e7e1ae22893ebb92fa37 (diff) | |
download | busybox-w32-6b1e3d7e734f85a08c2e4414764f03a7f880b3e6.tar.gz busybox-w32-6b1e3d7e734f85a08c2e4414764f03a7f880b3e6.tar.bz2 busybox-w32-6b1e3d7e734f85a08c2e4414764f03a7f880b3e6.zip |
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 d76deac20..0c1a9a0db 100644 --- a/loginutils/cryptpw.c +++ b/loginutils/cryptpw.c | |||
@@ -34,7 +34,7 @@ done | |||
34 | int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 34 | int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
35 | int cryptpw_main(int argc UNUSED_PARAM, char **argv) | 35 | int cryptpw_main(int argc UNUSED_PARAM, char **argv) |
36 | { | 36 | { |
37 | char salt[sizeof("$N$") + 16]; | 37 | char salt[sizeof("$N$") + 16 + TESTING*100]; |
38 | char *opt_a; | 38 | char *opt_a; |
39 | int opts; | 39 | int opts; |
40 | 40 | ||
@@ -54,7 +54,12 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv) | |||
54 | salt[1] = '5' + (strcmp(opt_a, "sha512") == 0); | 54 | salt[1] = '5' + (strcmp(opt_a, "sha512") == 0); |
55 | crypt_make_salt(salt + 3, 16/2, 0); /* sha */ | 55 | crypt_make_salt(salt + 3, 16/2, 0); /* sha */ |
56 | #if TESTING | 56 | #if TESTING |
57 | strcpy(salt, "$6$em7yVj./Mv5n1V5X"); | 57 | strcpy(salt, "$5$rounds=5000$toolongsaltstring"); |
58 | // with "This is just a test" as password, should produce: | ||
59 | // "$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5" | ||
60 | strcpy(salt, "$6$rounds=5000$toolongsaltstring"); | ||
61 | // with "This is just a test" as password, should produce: | ||
62 | // "$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQzQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0" | ||
58 | #endif | 63 | #endif |
59 | } else | 64 | } else |
60 | #endif | 65 | #endif |