summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/chap.h
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-02-11 10:14:08 +0000
committerbrian <brian@FreeBSD.org>1999-02-11 10:14:08 +0000
commit5dc50d8ed53887553c9cb516e2b7915e55171a9f (patch)
treef9ab8c0680569eb7727b37072506b8ada5abb174 /usr.sbin/ppp/chap.h
parent4ef23fab94c614e2e42029a09de004d3a1613d62 (diff)
downloadFreeBSD-src-5dc50d8ed53887553c9cb516e2b7915e55171a9f.zip
FreeBSD-src-5dc50d8ed53887553c9cb516e2b7915e55171a9f.tar.gz
When resending chap challenges, resend the same challenge
each time rather than making up a new one. Increase the authname/authkey max sizes to 100 characters. Allow ``authkey'' specifications beginning with ``!''. When a challenge is received, the text following the ``!'' is executed as a program (expanding stuff in the same way that ``sh'' and ``!bg'' do). The program is passed the peer name, peer challenge and local ``authname'' on standard input and is expected to output the name/key combination that should be used to build the CHAP response. This provides support for Secure ID cards (guess what I was given at work recently!) using CHAP. Examples will follow.
Diffstat (limited to 'usr.sbin/ppp/chap.h')
-rw-r--r--usr.sbin/ppp/chap.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/ppp/chap.h b/usr.sbin/ppp/chap.h
index 0aaea88..b5514d0 100644
--- a/usr.sbin/ppp/chap.h
+++ b/usr.sbin/ppp/chap.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: chap.h,v 1.10 1998/05/21 21:44:27 brian Exp $
+ * $Id: chap.h,v 1.11 1999/02/06 02:54:44 brian Exp $
*
* TODO:
*/
@@ -29,12 +29,24 @@ struct physical;
#define CHAP_FAILURE 4
struct chap {
+ struct descriptor desc;
+ struct {
+ pid_t pid;
+ int fd;
+ struct {
+ char ptr[AUTHLEN * 2 + 3]; /* Allow for \r\n at the end (- NUL) */
+ int len;
+ } buf;
+ } child;
struct authinfo auth;
char challenge[CHAPCHALLENGELEN + AUTHLEN];
unsigned using_MSChap : 1; /* A combination of MD4 & DES */
};
-#define auth2chap(a) ((struct chap *)(a))
+#define descriptor2chap(d) \
+ ((d)->type == CHAP_DESCRIPTOR ? (struct chap *)(d) : NULL)
+#define auth2chap(a) (struct chap *)((char *)a - (int)&((struct chap *)0)->auth)
extern void chap_Init(struct chap *, struct physical *);
+extern void chap_ReInit(struct chap *);
extern void chap_Input(struct physical *, struct mbuf *);
OpenPOWER on IntegriCloud