aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-02-02 09:40:47 +0000
committerBrian Somers <brian@FreeBSD.org>1999-02-02 09:40:47 +0000
commit7918d59eab708a0d5ee54c7426d5dfc237e2500d (patch)
tree413781c5b919ea6dcc3785b84b82982eae92270c
parent0b6040bfca8d50c14d0d29c574a6c94d9e6db849 (diff)
Notes
-rw-r--r--usr.sbin/ppp/auth.c19
-rw-r--r--usr.sbin/ppp/auth.h6
-rw-r--r--usr.sbin/ppp/datalink.c8
-rw-r--r--usr.sbin/ppp/pap.c10
-rw-r--r--usr.sbin/ppp/pap.h3
5 files changed, 20 insertions, 26 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c
index 9701ed4e7d6a..ce6ac8d3322c 100644
--- a/usr.sbin/ppp/auth.c
+++ b/usr.sbin/ppp/auth.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: auth.c,v 1.34 1998/12/17 00:28:12 brian Exp $
+ * $Id: auth.c,v 1.34.2.1 1999/02/01 13:48:24 brian Exp $
*
* TODO:
* o Implement check against with registered IP addresses.
@@ -31,10 +31,12 @@
#include <pwd.h>
#include <stdio.h>
#include <string.h>
+#include <termios.h>
#include <unistd.h>
#include "mbuf.h"
#include "defs.h"
+#include "log.h"
#include "timer.h"
#include "fsm.h"
#include "iplist.h"
@@ -53,6 +55,11 @@
#include "lcpproto.h"
#include "filter.h"
#include "mp.h"
+#include "cbcp.h"
+#include "chap.h"
+#include "async.h"
+#include "physical.h"
+#include "datalink.h"
#include "bundle.h"
const char *
@@ -244,8 +251,10 @@ AuthTimeout(void *vauthp)
if (--authp->retry > 0) {
timer_Start(&authp->authtimer);
(*authp->ChallengeFunc)(authp, ++authp->id, authp->physical);
- } else if (authp->FailedFunc)
- (*authp->FailedFunc)(authp->physical);
+ } else {
+ log_Printf(LogPHASE, "Auth: No response from server\n");
+ datalink_AuthNotOk(authp->physical->dl);
+ }
}
void
@@ -257,11 +266,9 @@ auth_Init(struct authinfo *authinfo)
void
auth_StartChallenge(struct authinfo *authp, struct physical *physical,
- void (*chal)(struct authinfo *, int, struct physical *),
- void (*fail)(struct physical *))
+ void (*chal)(struct authinfo *, int, struct physical *))
{
authp->ChallengeFunc = chal;
- authp->FailedFunc = fail;
authp->physical = physical;
timer_Stop(&authp->authtimer);
authp->authtimer.func = AuthTimeout;
diff --git a/usr.sbin/ppp/auth.h b/usr.sbin/ppp/auth.h
index 7ac577df90eb..4fef7bfe0dc3 100644
--- a/usr.sbin/ppp/auth.h
+++ b/usr.sbin/ppp/auth.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: auth.h,v 1.12 1998/08/07 18:42:47 brian Exp $
+ * $Id: auth.h,v 1.12.2.1 1999/02/01 13:48:24 brian Exp $
*
* TODO:
*/
@@ -25,7 +25,6 @@ struct bundle;
struct authinfo {
void (*ChallengeFunc)(struct authinfo *, int, struct physical *);
- void (*FailedFunc)(struct physical *);
struct pppTimer authtimer;
int retry;
int id;
@@ -41,8 +40,7 @@ extern void auth_Init(struct authinfo *);
extern void auth_StopTimer(struct authinfo *);
extern void auth_StartChallenge(struct authinfo *, struct physical *,
void (*)(struct authinfo *, int,
- struct physical *),
- void (*)(struct physical *));
+ struct physical *));
extern int auth_Validate(struct bundle *, const char *, const char *,
struct physical *);
extern char *auth_GetSecret(struct bundle *, const char *, int,
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 24b72e218e6c..2c697eba5006 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: datalink.c,v 1.25 1999/01/20 18:06:52 brian Exp $
+ * $Id: datalink.c,v 1.25.2.1 1999/02/01 13:48:24 brian Exp $
*/
#include <sys/types.h>
@@ -476,11 +476,9 @@ datalink_LayerUp(void *v, struct fsm *fp)
Auth2Nam(dl->physical->link.lcp.his_auth),
Auth2Nam(dl->physical->link.lcp.want_auth));
if (dl->physical->link.lcp.his_auth == PROTO_PAP)
- auth_StartChallenge(&dl->pap, dl->physical, pap_SendChallenge,
- pap_Failed);
+ auth_StartChallenge(&dl->pap, dl->physical, pap_SendChallenge);
if (dl->physical->link.lcp.want_auth == PROTO_CHAP)
- auth_StartChallenge(&dl->chap.auth, dl->physical, chap_SendChallenge,
- NULL);
+ auth_StartChallenge(&dl->chap.auth, dl->physical, chap_SendChallenge);
} else
datalink_AuthOk(dl);
}
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c
index a0cb45c3158e..3e8e84e6d887 100644
--- a/usr.sbin/ppp/pap.c
+++ b/usr.sbin/ppp/pap.c
@@ -18,7 +18,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: pap.c,v 1.27 1998/08/26 18:07:57 brian Exp $
+ * $Id: pap.c,v 1.27.2.1 1999/02/01 13:48:24 brian Exp $
*
* TODO:
*/
@@ -135,14 +135,6 @@ PapValidate(struct bundle *bundle, u_char *name, u_char *key,
}
void
-pap_Failed(struct physical *p)
-{
- auth_StopTimer(&p->dl->pap);
- log_Printf(LogPHASE, "Pap: No response from server\n");
- datalink_AuthNotOk(p->dl);
-}
-
-void
pap_Input(struct bundle *bundle, struct mbuf *bp, struct physical *physical)
{
int len = mbuf_Length(bp);
diff --git a/usr.sbin/ppp/pap.h b/usr.sbin/ppp/pap.h
index f0cd5e8ef068..d63024ae7e11 100644
--- a/usr.sbin/ppp/pap.h
+++ b/usr.sbin/ppp/pap.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: pap.h,v 1.6 1998/05/21 21:47:21 brian Exp $
+ * $Id: pap.h,v 1.6.2.1 1999/02/01 13:48:24 brian Exp $
*
* TODO:
*/
@@ -29,6 +29,5 @@ struct physical;
struct authinfo;
struct bundle;
-extern void pap_Failed(struct physical *);
extern void pap_Input(struct bundle *, struct mbuf *, struct physical *);
extern void pap_SendChallenge(struct authinfo *, int, struct physical *);