aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt_md5.c
diff options
context:
space:
mode:
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 8d0a516cf..b7478aa9d 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])
494} 494}
495 495
496 496
497static char*
498__md5_to64(char *s, unsigned v, int n)
499{
500 while (--n >= 0) {
501 *s++ = ascii64[v & 0x3f];
502 v >>= 6;
503 }
504 return s;
505}
506
507/* 497/*
508 * UNIX password 498 * UNIX password
509 * 499 *
@@ -605,9 +595,9 @@ md5_crypt(char passwd[MD5_OUT_BUFSIZE], const unsigned char *pw, const unsigned
605 final[16] = final[5]; 595 final[16] = final[5];
606 for (i = 0; i < 5; i++) { 596 for (i = 0; i < 5; i++) {
607 unsigned l = (final[i] << 16) | (final[i+6] << 8) | final[i+12]; 597 unsigned l = (final[i] << 16) | (final[i+6] << 8) | final[i+12];
608 p = __md5_to64(p, l, 4); 598 p = to64(p, l, 4);
609 } 599 }
610 p = __md5_to64(p, final[11], 2); 600 p = to64(p, final[11], 2);
611 *p = '\0'; 601 *p = '\0';
612 602
613 /* Don't leave anything around in vm they could use. */ 603 /* Don't leave anything around in vm they could use. */