From 30e34273cc0ed2e4ad574283a101bec091f20d64 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 14 Jun 1997 04:05:01 +0000 Subject: Replace random() by arc4random() since random() can't be used in libraries, it may damage its predictable sequence --- eBones/lib/libkrb/des_rw.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'eBones') 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)); } -- cgit v1.1