summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/chap.c
Commit message (Collapse)AuthorAgeFilesLines
* Set the close-on-exec flag for all unused descriptors whenbrian1999-08-171-14/+10
| | | | exec()ing other programs.
* Don't declare `end' if we aren't compiling radius support.brian1999-07-151-2/+4
|
* Use the correct pid when substituting PROCESSID.brian1999-06-091-2/+4
| | | | Problem reported by: Amedeo Beck Peccoz <gea@gressoney.it>
* o Alter the mbuf type as it's processed by different layers.brian1999-06-021-2/+3
| | | | | | | | o Show more information about missing MP fragments in ``show mp''. o Do away with mbuf_Log(). It was showing mbuf stats twice on receipt of LCP/CCP/IPCP packets.... ???!!? o Pre-allocate a bit extra when creating LQR packets to avoid having to allocate another mbuf in mbuf_Prepend().
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-22/+32
| | | | | | | | | | | | | | | | | | | | | the layering. We now ``stack'' layers as soon as we open the device (when we figure out what we're dealing with). A static set of `dispatch' routines are also declared for dealing with incoming packets after they've been `pulled' up through the stacked layers. Physical devices are now assigned handlers based on the device type when they're opened. For the moment there are three device types; ttys, execs and tcps. o Increment version number to 2.2 o Make an entry in [uw]tmp for non-tty -direct invocations (after pap/chap authentication). o Make throughput counters quad_t's o Account for the absolute number of mbuf malloc()s and free()s in ``show mem''. o ``show modem'' becomes ``show physical''.
* Split the recorded chap challenge into two - one for thebrian1999-04-211-17/+20
| | | | | | | | receiver and one for the sender. This allows two simultaneous chap conversations - something that I *thought* I was already doing on a daily basis myself until the existence of the problem was Beaten into me by: sos
* Drop PAP & CHAP packets if we're not in NETWORK or AUTHENTICATEbrian1999-04-011-1/+8
| | | | phase.
* Handle empty PAP & CHAP packets (containing only an FSM header).brian1999-02-201-3/+4
| | | | | | Some CHAP implementations send no welcome message with their SUCCESS/FAILURE packets. This was being mis-identified as a truncated packet by the new authentication code :-(
* Build correctly when -DNOCRYPT is used.brian1999-02-181-18/+78
|
* Don't expect a chap response if we haven't negotiatedbrian1999-02-181-2/+3
| | | | chap 0x80.
* Fully support both NT and LANMan CHAP type 0x80 as bothbrian1999-02-181-56/+131
| | | | authenticator and authenticatee.
* When resending chap challenges, resend the same challengebrian1999-02-111-30/+241
| | | | | | | | | | | | | | | | | | | 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.
* Correct server-side chap authentication comparisonbrian1999-02-071-2/+2
| | | | (broken with last commit).
* Remove forgotten diagnosticsbrian1999-02-071-3/+1
|
* Decouple pap & chap output routines from the correspondingbrian1999-02-061-219/+273
| | | | | | | | | | | | | | | | | | | | | | | input routines and take advantage of the new init/continue interface in libradius. This allows a timely response on other links in an MP setup while RADIUS requests are in progress as well as the ability to handle other data from the peer in parallel. It should also make the future addition of PAM support trivial. While I'm in there, validate pap & chap header IDs if ``idcheck'' is enabled (the default) for other FSM packet types. NOTE: This involved integrating the generation of chap challenges and the validation of chap responses (and commenting what's going on in those routines). I currently have no way of testing ppps ability to respond to M$Chap CHALLENGEs correctly, so if someone could do the honours, it'd be much appreciated (it *looks* ok!). Sponsored by: Internet Business Solutions Ltd., Switzerland
* o Send a CHAP challenge of 16 random digits when RADIUS isbrian1999-01-291-37/+40
| | | | | | | | | | | | | | configured. This isn't strictly necessary according to the rfc, but it's suggested there.... o Don't forget to include our authname when sending a CHAP challenge when RADIUS is configured. o Don't supply the ``16'' representing the chap answer length to radius_Authenticate() - libradius does this for us. o When we successfully authenticate via radius_Authenticate(), continue with datalink_AuthOk() as expected. Sponsored by: Internet Business Solutions Ltd., Switzerland
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-14/+43
| | | | | | | | | | | | | | | | | | | details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland
* Fix some OpenBSD/alpha warningsbrian1998-08-261-2/+2
|
* o Support callback types NONE, E.164, AUTH and CBCP.brian1998-08-071-2/+3
| | | | | | | | | | | | | | (see the new ``set callback'' and ``set cbcp'' commands) o Add a ``cbcp'' log level and mbuf type. o Don't dump core when \T is given in ``set login'' or ``set hangup''. o Allow ``*'' and blanks as placeholders in ppp.secret and allow a fifth field for specifying auth/cbcp dialback parameters. o Remove a few extraneous #includes o Define the default number of REQs (restart counter) in defs.h rather than hardcoding ``5'' all over the place. o Fix a few man page inconsistencies.
* o Tidy up PAP and CHAP diagnostics. They're now all logged as PHASEbrian1998-07-281-13/+20
| | | | | | | diagnostics (which are on by default). o Deal correctly with both sides wanting CHAP. o Output a warning if we're using an empty ``authname''. This is *not* what we want to do.
* o Fix remaining sizeof problems for 64 bit machines.brian1998-06-271-1/+2
| | | | | | | | | | o Allow ``set ....'' when we have multiple links but aren't in multilink mode. o Do a TLS when we receive a ``Open'' event in ``Closed'' state, despite the rfc state transition table. This is clearly an error in the RFC as TLS cannot have yet been called (without TLF) in the ``Closed'' state. I've posted a message to comp.protocols.ppp for confirmation.
* Remove redundant includesbrian1998-06-271-2/+5
|
* o Add some missing #includesbrian1998-05-211-1/+4
| | | | o Calculate base device name correctly.
* MFMP: Make ppp multilink capable.brian1998-05-211-103/+98
| | | | See the file README.changes, and re-read the man page.
* Add extraneous braces to stiffle warnings from gcc-2.8brian1998-03-131-2/+3
|
* MFMP: Allow 8 character login names.brian1998-02-191-5/+4
| | | | Do the login()/logwtmp()/logout() as id 0.
* Cosmetic (style):brian1997-12-241-4/+4
| | | | | | | sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de>
* Fix PAP, CHAP & LQR req (I broke the byte ordering whenbrian1997-12-071-2/+2
| | | | | | | | I did the deflate re-org). Make PAP & CHAP negotiation prettier in the log file. If both PAP & CHAP are `enabled' and the peer NAKs CHAP suggesting PAP, be friendly and REQ PAP the next time. This is in line with the rfc.
* Fix prototypes.brian1997-11-221-4/+4
| | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
* When responding to a CHAP challenge, don't try to usebrian1997-11-091-13/+7
| | | | | | | | ppp.secret to get a key value based on the peers name, then send the value of AuthName with the encrypted result. This is *way* too confusing. Instead, always use AuthName and AuthKey as the documentation says.
* Cosmetic (no functional changes):brian1997-10-261-38/+48
| | | | | | | | | | | | | | | o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes
* Allow Microsoft CHAP authentication.brian1997-09-251-30/+59
| | | | | This is a combination of MD4 & DES. Submitted by: Gabor Kincses <gabor@acm.org>
* Don't allow accept/deny when it's not appropriate.brian1997-09-221-2/+23
| | | | | Log PAP/CHAP users in utmp & wtmp, allowing it to be avoided with "disable utmp"
* Support CHAP using MD4brian1997-09-171-9/+23
| | | | Suggested by: jordan
* Make the code format more in line with style(9).brian1997-08-251-22/+17
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* Remove srandomdev fallback codeache1997-06-141-3/+2
|
* Overhaul ppp:brian1997-06-091-40/+11
| | | | | | | | | | | | | | | | | | | | | | | | | o Use syslog o Remove references to stdout/stderr (incl perror()) o Introduce VarTerm - the interactive terminal or zero o Allow "set timeout" to affect current session o Change "set debug" to "set log" o Allow "set log [+|-]flag" o Make MSEXT and PASSWDAUTH stuff the default o Move all #ifdef DEBUG stuff into the code - this shouldn't be too much overhead. It's now controlled with "set log +debug" o Add "set log command, debug, tun, warn, error, alert" o Remove cdefs.h, and assume an ansi compiler. o Improve all diagnostic output o Don't trap SIGSEGV o SIGHUP now terminates again (log files are controlled by syslog) o Call CloseModem() when changing devices o Fix parsing of third arg of "delete" I think this fixes the "magic is same" problems that some people have been experiencing. The man page is being rewritten. It'll follow soon.
* De-couple ppp from libalias. If libalias isn't there, thebrian1997-05-261-1/+2
| | | | | | | | | alias commands simply won't work. Only root may specify the location of the alias lib (otherwise, it's hard-coded). Make logprintf silently fail if LogOpen hasn't been called. Suggested by: eivind
* Fix the reconnect option, and add an explanation to vars.hbrian1997-05-241-2/+2
|
* Mega update to sort out bad implementationsbrian1997-05-191-1/+2
| | | | | | | | | | | | | | | | | | of reconnect & -background. o Fix reconnect anomolies. o Make reconnect apply to failed LQR hangups (& mention in man page). o Make reconnect effective in -background mode. o Listen on socket in -background mode. o Try all phone numbers in -background mode. o Insist on system arg in -background mode. o Make a control-connection close command exit in -background mode. o Output status message to stdout on exit of parent in -background mode. o Don't notify parent of success too soon. o Describe termination EX_* code. o Miscelaneous diagnostic corrections. o Remove redundant connect_time from modem.c. o Don't repeatedly DownConnection().
* Tidy up the code - bounds checking, returnbrian1997-05-101-1/+5
| | | | | | value checking etc. Submitted by: eivind
* Use srandomdev() to initialize RNGache1997-03-241-2/+3
|
* Convert srandom() arg cast to Lite2 styleache1997-03-171-2/+2
|
* Do not re-initialize random numbers generator several times.ache1997-03-101-2/+6
| | | | Use ^ getpid() to produce better initial state.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* typophk1996-11-191-2/+2
|
* 1. Room to calculate MD5 for CHAP negotiation is shorter thanjkh1996-10-121-2/+3
| | | | | | | | | | | | | | | | required. a core is not dumped at first connecting time and dumped at second or third time. (patch I) 2. A routine for "show route" refers out of allocated space. Values pointed by "lp" should be read as CHAR, I think. there is also no free() for disallocation. (patch II) Here is also a patch for an improvement: In current imprementation, even if PPP connection is disconnected by time out, prompt of interactive mode does not change from "PPP>" to "ppp>" to indicate the disconnection on a terminal. So I modified the code to do that. (patch III) Submitted-By: NAKAMURA Motonori <motonori@econ.kyoto-u.ac.jp>
* Here is a diff of /usr/src/usr.sbin/ppp against current. The diffsphk1996-05-111-4/+4
| | | | | | | | | | | | | | | | | | | add some logging functionality which I find very useful. 'set debug link' will record just link up/down and address assignments. 'set debug connect' will record the entire chat dialog 'set debug carrier' will record just chat lines including 'CARRIER' (so that I can be sure I'm getting a 28.8 line). There was a global change required to permit LogPrintf to take a bit mask instead of a bit position value (to permit logging some events on either of two flags, so that no change in 'set debug lcp' would result from the code supporting 'link'. Thus the diffs are rather long for such a small change. The man page is also touched. Oh, and there was a slight syntax problem in route.c Reviewed by: phk Submitted by: Tony Kimball <alk@Think.COM>
* Some patches to ppp which improve stability. I have been running adfr1996-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ppp based on these patches for about 3 weeks with no downtime. The original submitters comments: Two features iijppp has over kernel ppp that I like are predictor1 compression and demand dialing. Here are a few bug fixes. I expanded the priority queueing scheme and discovered it was broken due to the assignment at ip.c line 300. All packets were being queued at the same priority. Fixing priority queueing broke predictor1 compression. Packets were compressed before being queued and predictor1 worked as long as the packets were popped off the queue in the same order they were pushed onto the queue. There were a few byte order problems in IP header tests also. There is a recursion problem in SendLqrReport(). LcpClose() is called when "Too many echo packets are lost" which winds up in SendLqrReport() again. I believe the original intention was to just stop the LQR timer with the call to StopLqr() but the side effects hurt. Submitted by: John Capo <jc@irbs.com>
OpenPOWER on IntegriCloud