diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-16 02:28:50 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-16 02:28:50 +0100 |
commit | dbc6a7a8fd33c79037c7f2894c24f271b714e3bc (patch) | |
tree | 3c6139fd129b043ffa2dca099a91dcb3b288c024 | |
parent | cc428147c17a57d62d89b998debc1f4bd094ad56 (diff) | |
download | busybox-w32-dbc6a7a8fd33c79037c7f2894c24f271b714e3bc.tar.gz busybox-w32-dbc6a7a8fd33c79037c7f2894c24f271b714e3bc.tar.bz2 busybox-w32-dbc6a7a8fd33c79037c7f2894c24f271b714e3bc.zip |
httpd -m: output salted MD5 hash. By (forrest AT hifulltech.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/httpd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 7ac43619a..0a8322c88 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -2347,7 +2347,12 @@ int httpd_main(int argc UNUSED_PARAM, char **argv) | |||
2347 | #endif | 2347 | #endif |
2348 | #if ENABLE_FEATURE_HTTPD_AUTH_MD5 | 2348 | #if ENABLE_FEATURE_HTTPD_AUTH_MD5 |
2349 | if (opt & OPT_MD5) { | 2349 | if (opt & OPT_MD5) { |
2350 | puts(pw_encrypt(pass, "$1$", 1)); | 2350 | char salt[sizeof("$1$XXXXXXXX")]; |
2351 | salt[0] = '$'; | ||
2352 | salt[1] = '1'; | ||
2353 | salt[2] = '$'; | ||
2354 | crypt_make_salt(salt + 3, 4, 0); | ||
2355 | puts(pw_encrypt(pass, salt, 1)); | ||
2351 | return 0; | 2356 | return 0; |
2352 | } | 2357 | } |
2353 | #endif | 2358 | #endif |