X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmagic.c;h=2fb23ff4adf48b68e6da309eb90373cd6bcc1d0f;hp=2e0426c5c6af9839469c7568206541a6977a1138;hb=3e451dfe42426b51e6ce1d66a3e04de43e055568;hpb=f53a48eb9d74db3c71938e114b7f489c339bc003 diff --git a/pppd/magic.c b/pppd/magic.c index 2e0426c..2fb23ff 100644 --- a/pppd/magic.c +++ b/pppd/magic.c @@ -40,9 +40,10 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: magic.c,v 1.10 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: magic.c,v 1.11 2003/06/11 23:56:26 paulus Exp $" #include +#include #include #include #include @@ -82,6 +83,18 @@ magic() return (u_int32_t) mrand48(); } +/* + * random_bytes - Fill a buffer with random bytes. + */ +void +random_bytes(unsigned char *buf, int len) +{ + int i; + + for (i = 0; i < len; ++i) + buf[i] = mrand48() >> 24; +} + #ifdef NO_DRAND48 /* * Substitute procedures for those systems which don't have