]> git.ozlabs.org Git - ppp.git/commitdiff
Make authentication success/failure messages uniform.
authorFrank Cusack <fcusack@fcusack.com>
Fri, 11 Oct 2002 22:11:13 +0000 (22:11 +0000)
committerFrank Cusack <fcusack@fcusack.com>
Fri, 11 Oct 2002 22:11:13 +0000 (22:11 +0000)
pppd/chap.c
pppd/upap.c

index a48f69f2158500a8d906d3c79a47e1b39453bde0..85c860fc6816f1c85fd95cec806fb0bed2cdcc54 100644 (file)
@@ -33,7 +33,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: chap.c,v 1.33 2002/09/01 12:00:15 dfs Exp $"
+#define RCSID  "$Id: chap.c,v 1.34 2002/10/11 22:11:13 fcusack Exp $"
 
 /*
  * TODO:
@@ -700,7 +700,7 @@ ChapReceiveResponse(cstate, inp, id, len)
        notice("CHAP peer authentication succeeded for %q", rhostname);
 
     } else {
-       error("CHAP peer authentication failed for remote host %q", rhostname);
+       error("CHAP peer authentication failed for %q", rhostname);
        cstate->serverstate = CHAPSS_BADAUTH;
        auth_peer_fail(cstate->unit, PPP_CHAP);
     }
@@ -768,6 +768,7 @@ ChapReceiveSuccess(cstate, inp, id, len)
 
     cstate->clientstate = CHAPCS_OPEN;
 
+    notice("CHAP authentication succeeded");
     auth_withpeer_success(cstate->unit, PPP_CHAP, cstate->resp_type);
 }
 
index d3d9d9f41d47635066bbbddf1d0069a4f082a308..e15c93c40db35b23331ecaf2cd9f40460e5c6851 100644 (file)
@@ -17,7 +17,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: upap.c,v 1.25 2002/04/02 13:54:59 dfs Exp $"
+#define RCSID  "$Id: upap.c,v 1.26 2002/10/11 22:11:13 fcusack Exp $"
 
 /*
  * TODO:
@@ -353,6 +353,7 @@ upap_rauthreq(u, inp, id, len)
 {
     u_char ruserlen, rpasswdlen;
     char *ruser, *rpasswd;
+    char rhostname[256];
     int retcode;
     char *msg;
     int msglen;
@@ -407,11 +408,18 @@ upap_rauthreq(u, inp, id, len)
 
     upap_sresp(u, retcode, id, msg, msglen);
 
+    if (ruserlen >= sizeof(rhostname))
+       ruserlen = sizeof(rhostname) - 1;
+    BCOPY(ruser, rhostname, ruserlen);
+    rhostname[ruserlen] = '\000';
+
     if (retcode == UPAP_AUTHACK) {
        u->us_serverstate = UPAPSS_OPEN;
+       notice("PAP peer authentication succeeded for %q", rhostname);
        auth_peer_success(u->us_unit, PPP_PAP, 0, ruser, ruserlen);
     } else {
        u->us_serverstate = UPAPSS_BADAUTH;
+       error("PAP peer authentication failed for %q", rhostname);
        auth_peer_fail(u->us_unit, PPP_PAP);
     }
 
@@ -456,12 +464,13 @@ upap_rauthack(u, inp, id, len)
 
     u->us_clientstate = UPAPCS_OPEN;
 
+    notice("PAP authentication succeeded");
     auth_withpeer_success(u->us_unit, PPP_PAP, 0);
 }
 
 
 /*
- * upap_rauthnak - Receive Authenticate-Nakk.
+ * upap_rauthnak - Receive Authenticate-Nak.
  */
 static void
 upap_rauthnak(u, inp, id, len)