From 96a47326d0073d66e287fb05fa34d119f46744ed Mon Sep 17 00:00:00 2001 From: James Carlson Date: Mon, 28 Jul 2003 12:25:41 +0000 Subject: [PATCH] Fixed the old chap.c so that it works with the new auth.c, since existing makefiles still refer to chap.c for all but Linux. Fixed unsolicited Configure-Nak handling in *_nakci -- usenet report that 'while' loop terminates too early if there's a boolean. Fixed tiny typo in chap-new.c comment. --- pppd/chap-new.c | 2 +- pppd/chap.c | 22 +++++----------------- pppd/ipcp.c | 6 +++--- pppd/ipv6cp.c | 8 ++++---- pppd/ipxcp.c | 6 +++--- pppd/lcp.c | 4 ++-- 6 files changed, 18 insertions(+), 30 deletions(-) diff --git a/pppd/chap-new.c b/pppd/chap-new.c index ef002d1..9b8f176 100644 --- a/pppd/chap-new.c +++ b/pppd/chap-new.c @@ -216,7 +216,7 @@ chap_auth_peer(int unit, char *our_name, int digest_code) } /* - * chap_auth_peer - Prepare to authenticate ourselves to the peer. + * chap_auth_with_peer - Prepare to authenticate ourselves to the peer. * There isn't much to do until we receive a challenge. */ void diff --git a/pppd/chap.c b/pppd/chap.c index 0ac0a8b..aa07d0e 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -49,7 +49,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: chap.c,v 1.40 2003/05/12 07:47:06 fcusack Exp $" +#define RCSID "$Id: chap.c,v 1.41 2003/07/28 12:25:41 carlsonj Exp $" /* * TODO: @@ -68,12 +68,6 @@ #include "chap_ms.h" #endif -/* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */ -int (*chap_check_hook) __P((void)) = NULL; - -/* Hook for a plugin to get the CHAP password for authenticating us */ -int (*chap_passwd_hook) __P((char *user, char *passwd)) = NULL; - /* Hook for a plugin to validate CHAP challenge */ int (*chap_auth_hook) __P((char *user, u_char *remmd, @@ -183,14 +177,11 @@ ChapInit(unit) /* - * ChapAuthWithPeer - Authenticate us with our peer (start client). + * chap_auth_with_peer - Authenticate us with our peer (start client). * */ void -ChapAuthWithPeer(unit, our_name, digest) - int unit; - char *our_name; - int digest; +chap_auth_with_peer(int unit, char *our_name, int digest) { chap_state *cstate = &chap[unit]; @@ -214,13 +205,10 @@ ChapAuthWithPeer(unit, our_name, digest) /* - * ChapAuthPeer - Authenticate our peer (start server). + * chap_auth_peer - Authenticate our peer (start server). */ void -ChapAuthPeer(unit, our_name, digest) - int unit; - char *our_name; - int digest; +chap_auth_peer(int unit, char *our_name, int digest) { chap_state *cstate = &chap[unit]; diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 1ed4c07..c2a7f27 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: ipcp.c,v 1.63 2003/06/29 10:06:14 paulus Exp $" +#define RCSID "$Id: ipcp.c,v 1.64 2003/07/28 12:25:41 carlsonj Exp $" /* * TODO: @@ -1098,10 +1098,10 @@ ipcp_nakci(f, p, len) * If they want to negotiate about IP addresses, we comply. * If they want us to ask for compression, we refuse. */ - while (len > CILEN_VOID) { + while (len >= CILEN_VOID) { GETCHAR(citype, p); GETCHAR(cilen, p); - if( (len -= cilen) < 0 ) + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) goto bad; next = p + cilen - 2; diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c index 2d062c5..b5e845a 100644 --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c @@ -135,10 +135,10 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ipv6cp.c,v 1.17 2002/12/04 23:03:32 paulus Exp $ + * $Id: ipv6cp.c,v 1.18 2003/07/28 12:25:41 carlsonj Exp $ */ -#define RCSID "$Id: ipv6cp.c,v 1.17 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: ipv6cp.c,v 1.18 2003/07/28 12:25:41 carlsonj Exp $" /* * TODO: @@ -752,10 +752,10 @@ ipv6cp_nakci(f, p, len) * If they want to negotiate about interface identifier, we comply. * If they want us to ask for compression, we refuse. */ - while (len > CILEN_VOID) { + while (len >= CILEN_VOID) { GETCHAR(citype, p); GETCHAR(cilen, p); - if( (len -= cilen) < 0 ) + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) goto bad; next = p + cilen - 2; diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c index 8fc0539..0cbd9da 100644 --- a/pppd/ipxcp.c +++ b/pppd/ipxcp.c @@ -42,7 +42,7 @@ #ifdef IPX_CHANGE -#define RCSID "$Id: ipxcp.c,v 1.21 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: ipxcp.c,v 1.22 2003/07/28 12:25:41 carlsonj Exp $" /* * TODO: @@ -777,11 +777,11 @@ ipxcp_nakci(f, p, len) BZERO(&no, sizeof(no)); try = *go; - while (len > CILEN_VOID) { + while (len >= CILEN_VOID) { GETCHAR (citype, p); GETCHAR (cilen, p); len -= cilen; - if (len < 0) + if (cilen < CILEN_VOID || len < 0) goto bad; next = &p [cilen - CILEN_VOID]; diff --git a/pppd/lcp.c b/pppd/lcp.c index 88f43db..8d54071 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: lcp.c,v 1.69 2003/06/11 23:56:26 paulus Exp $" +#define RCSID "$Id: lcp.c,v 1.70 2003/07/28 12:25:41 carlsonj Exp $" /* * TODO: @@ -1220,7 +1220,7 @@ lcp_nakci(f, p, len) * An option we don't recognize represents the peer asking to * negotiate some option we don't support, so ignore it. */ - while (len > CILEN_VOID) { + while (len >= CILEN_VOID) { GETCHAR(citype, p); GETCHAR(cilen, p); if (cilen < CILEN_VOID || (len -= cilen) < 0) -- 2.39.2