summaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt_md5.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-11-10 18:52:35 +0000
committerDenis Vlasenko2008-11-10 18:52:35 +0000
commit2211d5268cc6fc5575f758a9835070fae5ffc405 (patch)
tree46b23253b2be2c2c5bcdb6909a740e894a93ae07 /libbb/pw_encrypt_md5.c
parent56dceb9b7722193ef53fb1afb981f1289eecb0b0 (diff)
downloadbusybox-2211d5268cc6fc5575f758a9835070fae5ffc405.zip
busybox-2211d5268cc6fc5575f758a9835070fae5ffc405.tar.gz
libbb: add optionl support for SHA256/512 encrypted passwords
function old new delta sha_crypt - 2423 +2423 cryptpw_main 128 183 +55 to64 - 29 +29 pw_encrypt 974 1000 +26 str_rounds - 11 +11 login_main 1532 1541 +9 packed_usage 25215 25200 -15 __md5_to64 29 - -29 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 3/1 up/down: 2553/-44) Total: 2509 bytes
Diffstat (limited to 'libbb/pw_encrypt_md5.c')
-rw-r--r--libbb/pw_encrypt_md5.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/libbb/pw_encrypt_md5.c b/libbb/pw_encrypt_md5.c
index 8d0a516..b7478aa 100644
--- a/libbb/pw_encrypt_md5.c
+++ b/libbb/pw_encrypt_md5.c
@@ -494,16 +494,6 @@ static void __md5_Transform(uint32_t state[4], const unsigned char block[64])
}
-static char*
-__md5_to64(char *s, unsigned v, int n)
-{
- while (--n >= 0) {
- *s++ = ascii64[v & 0x3f];
- v >>= 6;
- }
- return s;
-}
-
/*
* UNIX password
*
@@ -605,9 +595,9 @@ md5_crypt(char passwd[MD5_OUT_BUFSIZE], const unsigned char *pw, const unsigned
final[16] = final[5];
for (i = 0; i < 5; i++) {
unsigned l = (final[i] << 16) | (final[i+6] << 8) | final[i+12];
- p = __md5_to64(p, l, 4);
+ p = to64(p, l, 4);
}
- p = __md5_to64(p, final[11], 2);
+ p = to64(p, final[11], 2);
*p = '\0';
/* Don't leave anything around in vm they could use. */