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.
 }
 
 /*
- * 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
 
  * 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:
 #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,
 
 
 /*
- * 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];
 
 
 
 /*
- * 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];
 
 
  * 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:
      * 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;
 
 
  * 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: 
      * 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;
 
 
 
 #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:
     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];
 
 
  * 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:
      * 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)