summaryrefslogtreecommitdiff
path: root/sys/src/cmd/auth/changeuser.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-08-21 22:46:26 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-08-21 22:46:26 +0200
commitc6a9cbb0713c3ede52cf6822dcfc0589e5b9b8fe (patch)
treea63e82542cb7253ba9d710953ad0314699e91427 /sys/src/cmd/auth/changeuser.c
parent809522e80f4011925e8d92aa480fad04c7ff9e10 (diff)
cmd/auth: remove private /dev/random reading routines, use genrandom()
Diffstat (limited to 'sys/src/cmd/auth/changeuser.c')
-rw-r--r--sys/src/cmd/auth/changeuser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/cmd/auth/changeuser.c b/sys/src/cmd/auth/changeuser.c
index e40572769..47b0ff58e 100644
--- a/sys/src/cmd/auth/changeuser.c
+++ b/sys/src/cmd/auth/changeuser.c
@@ -1,5 +1,6 @@
#include <u.h>
#include <libc.h>
+#include <libsec.h>
#include <authsrv.h>
#include <ctype.h>
#include <bio.h>
@@ -19,13 +20,12 @@ void
main(int argc, char *argv[])
{
char *u, answer[32], p9pass[32];
- int which, i, newkey, newbio, dosecret;
+ int which, newkey, newbio, dosecret;
long t;
Authkey key;
Acctbio a;
Fs *f;
- srand(getpid()*time(0));
fmtinstall('K', deskeyfmt);
which = 0;
@@ -84,8 +84,7 @@ main(int argc, char *argv[])
}
if(newkey){
memset(&key, 0, sizeof(key));
- for(i=0; i<DESKEYLEN; i++)
- key.des[i] = nrand(256);
+ genrandom((uchar*)key.des, DESKEYLEN);
}
if(a.user == 0){
t = getexpiration(f->keys, u);