aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-11-07 13:36:46 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-11-07 13:36:46 +0000
commit30e1ab691cba8e472be329206ee576f685229f2f (patch)
treee259797b1fb3579ce53d3a903486d73b74a2f3e9 /libbb
parent2ec94a7ee84969dd8b206e1363be8ea58fd6779e (diff)
downloadbusybox-w32-30e1ab691cba8e472be329206ee576f685229f2f.tar.gz
busybox-w32-30e1ab691cba8e472be329206ee576f685229f2f.tar.bz2
busybox-w32-30e1ab691cba8e472be329206ee576f685229f2f.zip
libbb: add a TODO to support new SHA-based encrypted passwords
Diffstat (limited to 'libbb')
-rw-r--r--libbb/pw_encrypt.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index 469e71f6c..0b826f48d 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -20,6 +20,11 @@ static const uint8_t ascii64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
20#include "pw_encrypt_des.c" 20#include "pw_encrypt_des.c"
21#include "pw_encrypt_md5.c" 21#include "pw_encrypt_md5.c"
22 22
23/* Other advanced crypt ids: */
24/* $2$ or $2a$: Blowfish */
25/* $5$: SHA-256 */
26/* $6$: SHA-512 */
27/* TODO: implement SHA - http://people.redhat.com/drepper/SHA-crypt.txt */
23 28
24static struct const_des_ctx *des_cctx; 29static struct const_des_ctx *des_cctx;
25static struct des_ctx *des_ctx; 30static struct des_ctx *des_ctx;
@@ -54,12 +59,6 @@ char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
54{ 59{
55 char *encrypted; 60 char *encrypted;
56 61
57#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */
58 if (strncmp(salt, "$2$", 3) == 0) {
59 return sha1_crypt(clear);
60 }
61#endif
62
63 encrypted = my_crypt(clear, salt); 62 encrypted = my_crypt(clear, salt);
64 63
65 if (cleanup) 64 if (cleanup)
@@ -72,12 +71,6 @@ char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
72 71
73char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup) 72char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
74{ 73{
75#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */
76 if (strncmp(salt, "$2$", 3) == 0) {
77 return xstrdup(sha1_crypt(clear));
78 }
79#endif
80
81 return xstrdup(crypt(clear, salt)); 74 return xstrdup(crypt(clear, salt));
82} 75}
83 76