X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fchap.c;h=b8a5d0f726ffe9f723d1eaf344a52d45b1591ef9;hb=739142cddb7369c7611eeed081a80d52b7b992c9;hp=b580d2cb40e1cc6ce82f40331cdc01e1b23f4c34;hpb=1e7bc3ea35208555bf233daacee9d85ded13f999;p=ppp.git diff --git a/pppd/chap.c b/pppd/chap.c index b580d2c..b8a5d0f 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -33,9 +33,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static char rcsid[] = "$Id: chap.c,v 1.20 1999/03/16 22:54:38 paulus Exp $"; -#endif +#define RCSID "$Id: chap.c,v 1.23 1999/08/13 06:46:11 paulus Exp $" /* * TODO: @@ -53,6 +51,8 @@ static char rcsid[] = "$Id: chap.c,v 1.20 1999/03/16 22:54:38 paulus Exp $"; #include "chap_ms.h" #endif +static const char rcsid[] = RCSID; + /* * Command-line options. */ @@ -436,8 +436,8 @@ ChapReceiveChallenge(cstate, inp, id, len) rhostname[len] = '\000'; /* Microsoft doesn't send their name back in the PPP packet */ - if (remote_name[0] != 0 && (explicit_remote || rhostname[0] == 0)) { - strlcpy(rhostname, sizeof(rhostname), remote_name); + if (explicit_remote || (remote_name[0] != 0 && rhostname[0] == 0)) { + strlcpy(rhostname, remote_name, sizeof(rhostname)); CHAPDEBUG(("ChapReceiveChallenge: using '%q' as remote name", rhostname)); } @@ -552,8 +552,8 @@ ChapReceiveResponse(cstate, inp, id, len) * do the hash ourselves, and compare the result. */ code = CHAP_FAILURE; - if (!get_secret(cstate->unit, rhostname, cstate->chal_name, - secret, &secret_len, 1)) { + if (!get_secret(cstate->unit, (explicit_remote? remote_name: rhostname), + cstate->chal_name, secret, &secret_len, 1)) { warn("No CHAP secret found for authenticating %q", rhostname); } else {