X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fchap.c;h=d72c36d4a9896e964e97ddd13c6e8a72e0b3baad;hp=b7a95cc2b04517d3a3f0792407ed8df162c339f8;hb=e1746e5f6bc21a42ed4c0b35dc5271026d580a81;hpb=6a34bc9a3edf435bc67e81755b65acb6786c98b3 diff --git a/pppd/chap.c b/pppd/chap.c index b7a95cc..d72c36d 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap.c,v 1.5 1994/10/22 11:54:04 paulus Exp $"; +static char rcsid[] = "$Id: chap.c,v 1.8 1995/07/04 12:32:26 paulus Exp $"; #endif /* @@ -36,7 +36,7 @@ static char rcsid[] = "$Id: chap.c,v 1.5 1994/10/22 11:54:04 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)); @@ -67,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 */ } @@ -189,9 +189,6 @@ ChapRechallenge(arg) ChapGenChallenge(cstate); ChapSendChallenge(cstate); cstate->serverstate = CHAPSS_RECHALLENGE; - - if (cstate->chal_interval != 0) - TIMEOUT(ChapRechallenge, (caddr_t) cstate, cstate->chal_interval); } @@ -506,7 +503,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; @@ -806,18 +803,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