Skip to content

Commit

Permalink
fix arc4random, MFS from 4.x because arc4random has been broken in
Browse files Browse the repository at this point in the history
-current for over 3 months since 25-Jun-00

Special thanks to: markm for the breakage
  • Loading branch information
splbio committed Oct 6, 2000
1 parent d8e34cd commit a03f3ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/libkern/arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* $FreeBSD$
*/

#include <sys/types.h>
#include <sys/libkern.h>

#define ARC4_MAXRUNS 64
Expand All @@ -20,6 +19,8 @@ static int arc4_initialized = 0;
static int arc4_numruns = 0;
static u_int8_t arc4_sbox[256];

extern u_int read_random (void *, u_int);

static __inline void
arc4_swap(u_int8_t *a, u_int8_t *b)
{
Expand All @@ -39,8 +40,7 @@ arc4_randomstir (void)
u_int8_t key[256];
int r, n;

/* r = read_random(key, sizeof(key)); */
r = 0; /* XXX MarkM - revisit this when /dev/random is done */
r = read_random(key, sizeof(key));
/* if r == 0 || -1, just use what was on the stack */
if (r > 0)
{
Expand Down

0 comments on commit a03f3ec

Please sign in to comment.