diff options
author | Denys Vlasenko | 2009-12-16 02:28:50 +0100 |
---|---|---|
committer | Denys Vlasenko | 2009-12-16 02:28:50 +0100 |
commit | dbc6a7a8fd33c79037c7f2894c24f271b714e3bc (patch) | |
tree | 3c6139fd129b043ffa2dca099a91dcb3b288c024 /networking | |
parent | cc428147c17a57d62d89b998debc1f4bd094ad56 (diff) | |
download | busybox-dbc6a7a8fd33c79037c7f2894c24f271b714e3bc.zip busybox-dbc6a7a8fd33c79037c7f2894c24f271b714e3bc.tar.gz |
httpd -m: output salted MD5 hash. By (forrest AT hifulltech.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-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 7ac4361..0a8322c 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -2347,7 +2347,12 @@ int httpd_main(int argc UNUSED_PARAM, char **argv) #endif #if ENABLE_FEATURE_HTTPD_AUTH_MD5 if (opt & OPT_MD5) { - puts(pw_encrypt(pass, "$1$", 1)); + char salt[sizeof("$1$XXXXXXXX")]; + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + crypt_make_salt(salt + 3, 4, 0); + puts(pw_encrypt(pass, salt, 1)); return 0; } #endif |