diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/pw_encrypt.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c index 762cbab27..c1e927e23 100644 --- a/libbb/pw_encrypt.c +++ b/libbb/pw_encrypt.c | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | 11 | ||
12 | #if ENABLE_USE_BB_CRYPT | ||
13 | |||
12 | /* | 14 | /* |
13 | * DES and MD5 crypt implementations are taken from uclibc. | 15 | * DES and MD5 crypt implementations are taken from uclibc. |
14 | * They were modified to not use static buffers. | 16 | * They were modified to not use static buffers. |
@@ -69,3 +71,18 @@ char *pw_encrypt(const char *clear, const char *salt, int cleanup) | |||
69 | 71 | ||
70 | return encrypted; | 72 | return encrypted; |
71 | } | 73 | } |
74 | |||
75 | #else /* if !ENABLE_USE_BB_CRYPT */ | ||
76 | |||
77 | char *pw_encrypt(const char *clear, const char *salt, int cleanup) | ||
78 | { | ||
79 | #if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */ | ||
80 | if (strncmp(salt, "$2$", 3) == 0) { | ||
81 | return xstrdup(sha1_crypt(clear)); | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | return xstrdup(crypt(clear, salt)); | ||
86 | } | ||
87 | |||
88 | #endif | ||