diff options
author | ache <ache@FreeBSD.org> | 1997-06-14 04:05:01 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-06-14 04:05:01 +0000 |
commit | 30e34273cc0ed2e4ad574283a101bec091f20d64 (patch) | |
tree | 112c2b84f72ac7bf2912d43eccfb2d1763189493 /eBones | |
parent | cc33f39796e9ec4afb74cc4b7abd043d63670724 (diff) | |
download | FreeBSD-src-30e34273cc0ed2e4ad574283a101bec091f20d64.zip FreeBSD-src-30e34273cc0ed2e4ad574283a101bec091f20d64.tar.gz |
Replace random() by arc4random() since random() can't be used
in libraries, it may damage its predictable sequence
Diffstat (limited to 'eBones')
-rw-r--r-- | eBones/lib/libkrb/des_rw.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/eBones/lib/libkrb/des_rw.c b/eBones/lib/libkrb/des_rw.c index 36cfaa8..6f2719d 100644 --- a/eBones/lib/libkrb/des_rw.c +++ b/eBones/lib/libkrb/des_rw.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: des_rw.c,v 1.8 1997/03/24 14:52:51 ache Exp $ + * $Id: des_rw.c,v 1.9 1997/06/14 02:29:19 ache Exp $ */ /* @@ -216,7 +216,6 @@ des_write(fd, buf, len) char * buf; int len; { - static int seeded = 0; char garbage[8]; long rnd; int pad_len; @@ -228,13 +227,9 @@ des_write(fd, buf, len) /* * Right justify the message in 8 bytes of random garbage. */ - if(!seeded) { - seeded = 1; - srandomdev(); - } for(i = 0 ; i < 8 ; i+= sizeof(long)) { - rnd = random(); + rnd = arc4random(); bcopy(&rnd, garbage+i, (i <= (8 - sizeof(long)))?sizeof(long):(8-i)); } |