summaryrefslogtreecommitdiffstats
path: root/usr.bin/passwd
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-03-11 16:37:33 +0000
committermarkm <markm@FreeBSD.org>2001-03-11 16:37:33 +0000
commit51b4362532b9733a8a7f4154ab94d40d63645807 (patch)
treee03404cbf49f3092a5e13c14e7ffbfc39d220383 /usr.bin/passwd
parent10da32144618e3bcc873be353d69670aff7c3534 (diff)
downloadFreeBSD-src-51b4362532b9733a8a7f4154ab94d40d63645807.zip
FreeBSD-src-51b4362532b9733a8a7f4154ab94d40d63645807.tar.gz
Updates for Blowfish password hashing.
Diffstat (limited to 'usr.bin/passwd')
-rw-r--r--usr.bin/passwd/local_passwd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c
index ccf8bbb..ce2e46b 100644
--- a/usr.bin/passwd/local_passwd.c
+++ b/usr.bin/passwd/local_passwd.c
@@ -100,7 +100,7 @@ getnewpasswd(pw, nis)
#ifdef LOGIN_CAP
login_cap_t * lc;
#endif
- char buf[_PASSWORD_LEN+1], salt[10];
+ char buf[_PASSWORD_LEN+1], salt[32];
struct timeval tv;
if (!nis)
@@ -182,7 +182,11 @@ getnewpasswd(pw, nis)
to64(&salt[0], random(), 3);
to64(&salt[3], tv.tv_usec, 3);
to64(&salt[6], tv.tv_sec, 2);
- salt[8] = '\0';
+ to64(&salt[8], random(), 5);
+ to64(&salt[13], random(), 5);
+ to64(&salt[17], random(), 5);
+ to64(&salt[22], random(), 5);
+ salt[27] = '\0';
#endif
return (crypt(buf, salt));
}
OpenPOWER on IntegriCloud