diff options
author | markm <markm@FreeBSD.org> | 2001-03-11 16:37:33 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-03-11 16:37:33 +0000 |
commit | 51b4362532b9733a8a7f4154ab94d40d63645807 (patch) | |
tree | e03404cbf49f3092a5e13c14e7ffbfc39d220383 /usr.bin/passwd | |
parent | 10da32144618e3bcc873be353d69670aff7c3534 (diff) | |
download | FreeBSD-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.c | 8 |
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)); } |