diff options
author | nsayer <nsayer@FreeBSD.org> | 2001-05-16 18:32:46 +0000 |
---|---|---|
committer | nsayer <nsayer@FreeBSD.org> | 2001-05-16 18:32:46 +0000 |
commit | 280add2b356f77445e389ff5ccf84dc86ae64c99 (patch) | |
tree | 653386fc64b794a8f8dc3f6d852ccb614a0e4460 /crypto/telnet/libtelnet/pk.c | |
parent | ca01fb27dc03aff905825f3a18debbf67655f820 (diff) | |
download | FreeBSD-src-280add2b356f77445e389ff5ccf84dc86ae64c99.zip FreeBSD-src-280add2b356f77445e389ff5ccf84dc86ae64c99.tar.gz |
srandomdev() affords us the opportunity to radically improve, and at the
same time simplify, the random number selection code.
Diffstat (limited to 'crypto/telnet/libtelnet/pk.c')
-rw-r--r-- | crypto/telnet/libtelnet/pk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/telnet/libtelnet/pk.c b/crypto/telnet/libtelnet/pk.c index 9af8915..a4773ef 100644 --- a/crypto/telnet/libtelnet/pk.c +++ b/crypto/telnet/libtelnet/pk.c @@ -117,6 +117,7 @@ void getseed(seed, seedsize) char *seed; int seedsize; { +#if 0 int i,f; int rseed; struct timeval tv; @@ -140,6 +141,12 @@ void getseed(seed, seedsize) for (i = 0; i < seedsize; i++) { seed[i] = (lrand48() & 0xff); } +#else + srandomdev(); + for (i = 0; i < seedsize; i++) { + seed[i] = random() & 0xff; + } +#endif } |