]> git.ozlabs.org Git - ppp.git/commitdiff
Fixed the old chap.c so that it works with the new auth.c, since
authorJames Carlson <carlsonj@workingcode.com>
Mon, 28 Jul 2003 12:25:41 +0000 (12:25 +0000)
committerJames Carlson <carlsonj@workingcode.com>
Mon, 28 Jul 2003 12:25:41 +0000 (12:25 +0000)
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
pppd/chap.c
pppd/ipcp.c
pppd/ipv6cp.c
pppd/ipxcp.c
pppd/lcp.c

index ef002d1e1dd3c807b01d501d5c80a2a6a182d264..9b8f17643b8113237739985a20e114abc7e7433a 100644 (file)
@@ -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
index 0ac0a8b9199d542a9e85c39ed41c93edca688185..aa07d0e941e8dfede3df882c86bf818769136921 100644 (file)
@@ -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:
 #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];
 
index 1ed4c07796706e3a9e9ce63817e75f2b9600fdb2..c2a7f27337fa0c1874c01d68439a42dcce88b6e2 100644 (file)
@@ -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;
 
index 2d062c52b34b2c18ad6ba11755f8f4804cf323e7..b5e845a35a9d97a441cd77ee2d7f8a88e76dc4e9 100644 (file)
  * 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;
 
index 8fc05393d618d205d588230d7d2ba44c3d92911b..0cbd9da19990bffbdfc43f0e3c4990af079f5f73 100644 (file)
@@ -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];
 
index 88f43db1b66175d2b2cb8b80c56c6a97bb391b01..8d540715a0470775ea39516e83f199a28120ff94 100644 (file)
@@ -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)