]> git.ozlabs.org Git - ppp.git/commitdiff
moved protos here from upap.h; zero out passwords
authorPaul Mackerras <paulus@samba.org>
Mon, 1 Jul 1996 01:21:35 +0000 (01:21 +0000)
committerPaul Mackerras <paulus@samba.org>
Mon, 1 Jul 1996 01:21:35 +0000 (01:21 +0000)
pppd/upap.c

index 6f99daf50d5005e67fb0831d8c562dc4f950b167..f6bb3ac83f2321634d2cdf70b12241354eb45747 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: upap.c,v 1.9 1996/05/26 23:57:19 paulus Exp $";
+static char rcsid[] = "$Id: upap.c,v 1.10 1996/07/01 01:21:35 paulus Exp $";
 #endif
 
 /*
 #endif
 
 /*
@@ -34,10 +34,33 @@ static char rcsid[] = "$Id: upap.c,v 1.9 1996/05/26 23:57:19 paulus Exp $";
 #include "pppd.h"
 #include "upap.h"
 
 #include "pppd.h"
 #include "upap.h"
 
+/*
+ * Protocol entry points.
+ */
+static void upap_init __P((int));
+static void upap_lowerup __P((int));
+static void upap_lowerdown __P((int));
+static void upap_input __P((int, u_char *, int));
+static void upap_protrej __P((int));
+static int  upap_printpkt __P((u_char *, int,
+                              void (*) __P((void *, char *, ...)), void *));
+
 struct protent pap_protent = {
 struct protent pap_protent = {
-    PPP_PAP, upap_init, upap_input, upap_protrej,
-    upap_lowerup, upap_lowerdown, NULL, NULL,
-    upap_printpkt, NULL, 1, "PAP", NULL, NULL
+    PPP_PAP,
+    upap_init,
+    upap_input,
+    upap_protrej,
+    upap_lowerup,
+    upap_lowerdown,
+    NULL,
+    NULL,
+    upap_printpkt,
+    NULL,
+    1,
+    "PAP",
+    NULL,
+    NULL,
+    NULL
 };
 
 upap_state upap[NUM_PPP];              /* UPAP state; one for each unit */
 };
 
 upap_state upap[NUM_PPP];              /* UPAP state; one for each unit */
@@ -54,7 +77,7 @@ static void upap_sresp __P((upap_state *, int, int, char *, int));
 /*
  * upap_init - Initialize a UPAP unit.
  */
 /*
  * upap_init - Initialize a UPAP unit.
  */
-void
+static void
 upap_init(unit)
     int unit;
 {
 upap_init(unit)
     int unit;
 {
@@ -174,7 +197,7 @@ upap_reqtimeout(arg)
  *
  * Start authenticating if pending.
  */
  *
  * Start authenticating if pending.
  */
-void
+static void
 upap_lowerup(unit)
     int unit;
 {
 upap_lowerup(unit)
     int unit;
 {
@@ -201,7 +224,7 @@ upap_lowerup(unit)
  *
  * Cancel all timeouts.
  */
  *
  * Cancel all timeouts.
  */
-void
+static void
 upap_lowerdown(unit)
     int unit;
 {
 upap_lowerdown(unit)
     int unit;
 {
@@ -222,7 +245,7 @@ upap_lowerdown(unit)
  *
  * This shouldn't happen.  In any case, pretend lower layer went down.
  */
  *
  * This shouldn't happen.  In any case, pretend lower layer went down.
  */
-void
+static void
 upap_protrej(unit)
     int unit;
 {
 upap_protrej(unit)
     int unit;
 {
@@ -243,7 +266,7 @@ upap_protrej(unit)
 /*
  * upap_input - Input UPAP packet.
  */
 /*
  * upap_input - Input UPAP packet.
  */
-void
+static void
 upap_input(unit, inpacket, l)
     int unit;
     u_char *inpacket;
 upap_input(unit, inpacket, l)
     int unit;
     u_char *inpacket;
@@ -359,12 +382,13 @@ upap_rauthreq(u, inp, id, len)
      */
     retcode = check_passwd(u->us_unit, ruser, ruserlen, rpasswd,
                           rpasswdlen, &msg, &msglen);
      */
     retcode = check_passwd(u->us_unit, ruser, ruserlen, rpasswd,
                           rpasswdlen, &msg, &msglen);
+    BZERO(rpasswd, rpasswdlen);
 
     upap_sresp(u, retcode, id, msg, msglen);
 
     if (retcode == UPAP_AUTHACK) {
        u->us_serverstate = UPAPSS_OPEN;
 
     upap_sresp(u, retcode, id, msg, msglen);
 
     if (retcode == UPAP_AUTHACK) {
        u->us_serverstate = UPAPSS_OPEN;
-       auth_peer_success(u->us_unit, PPP_PAP);
+       auth_peer_success(u->us_unit, PPP_PAP, ruser, ruserlen);
     } else {
        u->us_serverstate = UPAPSS_BADAUTH;
        auth_peer_fail(u->us_unit, PPP_PAP);
     } else {
        u->us_serverstate = UPAPSS_BADAUTH;
        auth_peer_fail(u->us_unit, PPP_PAP);
@@ -519,11 +543,11 @@ upap_sresp(u, code, id, msg, msglen)
 /*
  * upap_printpkt - print the contents of a PAP packet.
  */
 /*
  * upap_printpkt - print the contents of a PAP packet.
  */
-char *upap_codenames[] = {
+static char *upap_codenames[] = {
     "AuthReq", "AuthAck", "AuthNak"
 };
 
     "AuthReq", "AuthAck", "AuthNak"
 };
 
-int
+static int
 upap_printpkt(p, plen, printer, arg)
     u_char *p;
     int plen;
 upap_printpkt(p, plen, printer, arg)
     u_char *p;
     int plen;
@@ -579,7 +603,7 @@ upap_printpkt(p, plen, printer, arg)
        msg = (char *) (p + 1);
        p += mlen + 1;
        len -= mlen + 1;
        msg = (char *) (p + 1);
        p += mlen + 1;
        len -= mlen + 1;
-       printer(arg, "msg=");
+       printer(arg, " ");
        print_string(msg, mlen, printer, arg);
        break;
     }
        print_string(msg, mlen, printer, arg);
        break;
     }