X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fchap.c;h=72870c52af404fbdd0dc409db90a976e12ee0478;hp=c11d5416a0d5deedbb8227caa2a457da4bedd743;hb=35db9b26511273fc41366dad861545b418083ef2;hpb=a3396b002507d72b3e1f1169bd02ae018539654b diff --git a/pppd/chap.c b/pppd/chap.c index c11d541..72870c5 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap.c,v 1.4 1994/09/21 06:47:37 paulus Exp $"; +static char rcsid[] = "$Id: chap.c,v 1.7 1995/04/24 05:59:12 paulus Exp $"; #endif /* @@ -27,6 +27,7 @@ static char rcsid[] = "$Id: chap.c,v 1.4 1994/09/21 06:47:37 paulus Exp $"; */ #include +#include #include #include #include @@ -35,7 +36,7 @@ static char rcsid[] = "$Id: chap.c,v 1.4 1994/09/21 06:47:37 paulus Exp $"; #include "chap.h" #include "md5.h" -chap_state chap[N_PPP]; /* CHAP state; one for each unit */ +chap_state chap[NUM_PPP]; /* CHAP state; one for each unit */ static void ChapChallengeTimeout __P((caddr_t)); static void ChapResponseTimeout __P((caddr_t)); @@ -66,7 +67,7 @@ ChapInit(unit) cstate->serverstate = CHAPSS_INITIAL; cstate->timeouttime = CHAP_DEFTIMEOUT; cstate->max_transmits = CHAP_DEFTRANSMITS; - srand48((long) time(NULL)); /* joggle random number generator */ + /* random number generator is initialized in magic_init */ } @@ -505,7 +506,7 @@ ChapReceiveResponse(cstate, inp, id, len) MD5Final(&mdContext); /* compare local and remote MDs and send the appropriate status */ - if (bcmp (mdContext.digest, remmd, MD5_SIGNATURE_SIZE) == 0) + if (memcmp (mdContext.digest, remmd, MD5_SIGNATURE_SIZE) == 0) code = CHAP_SUCCESS; /* they are the same! */ break; @@ -805,18 +806,3 @@ ChapPrintPkt(p, plen, printer, arg) return len + CHAP_HEADERLEN; } - -#ifdef NO_DRAND48 - -double drand48() -{ - return (double)random() / (double)0x7fffffffL; /* 2**31-1 */ -} - -void srand48(seedval) -long seedval; -{ - srand((int)seedval); -} - -#endif