NameDateSize

..Today11

chat/H12-Oct-20155

FAQH A D20-Feb-200525.3 KiB

PLUGINSH A D29-Jun-200612.1 KiB

ppp2netbsdH A D30-Apr-20083.8 KiB

pppd/H12-Oct-201548

pppdump/H12-Oct-20157

pppstats/H12-Oct-20155

READMEH A D29-Jun-200610.6 KiB

README.cbcpH A D20-Feb-20052 KiB

README.eap-srpH A D20-Feb-20056.2 KiB

README.MPPEH A D20-Feb-20053.4 KiB

README.MSCHAP80H A D20-Feb-20058.2 KiB

README.MSCHAP81H A D20-Feb-20052.4 KiB

README.pwfdH A D20-Feb-20053.5 KiB

SETUPH A D20-Feb-20054.1 KiB

README

1This is the README file for ppp-2.4, a package which implements the
2Point-to-Point Protocol (PPP) to provide Internet connections over
3serial lines.
4
5
6Introduction.
7*************
8
9The Point-to-Point Protocol (PPP) provides a standard way to establish
10a network connection over a serial link.  At present, this package
11supports IP and the protocols layered above IP, such as TCP and UDP.
12The Linux and Solaris ports of this package have optional support for
13IPV6; the Linux port of this package also has support for IPX.
14
15This software consists of two parts:
16
17- Kernel code, which establishes a network interface and passes
18packets between the serial port, the kernel networking code and the
19PPP daemon (pppd).  This code is implemented using STREAMS modules on
20Solaris, and as a line discipline under Linux.
21
22- The PPP daemon (pppd), which negotiates with the peer to establish
23the link and sets up the ppp network interface.  Pppd includes support
24for authentication, so you can control which other systems may make a
25PPP connection and what IP addresses they may use.
26
27The platforms supported by this package are Linux and Solaris.  I have
28code for NeXTStep, FreeBSD, SunOS 4.x, SVR4, Tru64 (Digital Unix), AIX
29and Ultrix but no active maintainers for these platforms.  Code for
30all of these except AIX is included in the ppp-2.3.11 release.
31
32
33Installation.
34*************
35
36The file SETUP contains general information about setting up your
37system for using PPP.  There is also a README file for each supported
38system, which contains more specific details for installing PPP on
39that system.  The supported systems, and the corresponding README
40files, are:
41
42	Linux				README.linux
43	Solaris				README.sol2
44
45In each case you start by running the ./configure script.  This works
46out which operating system you are using and creates the appropriate
47makefiles.  You then run `make' to compile the user-level code, and
48(as root) `make install' to install the user-level programs pppd, chat
49and pppstats.
50
51N.B. Since 2.3.0, leaving the permitted IP addresses column of the
52pap-secrets or chap-secrets file empty means that no addresses are
53permitted.  You need to put a "*" in that column to allow the peer to
54use any IP address.  (This only applies where the peer is
55authenticating itself to you, of course.)
56
57
58What's new in ppp-2.4.4.
59************************
60
61* Pppd will now run /etc/ppp/ip-pre-up, if it exists, after creating
62  the ppp interface and configuring its IP addresses but before
63  bringing it up.  This can be used, for example, for adding firewall
64  rules for the interface.
65
66* Lots of bugs fixed, particularly in the area of demand-dialled and
67  persistent connections.
68
69* The rp-pppoe plugin now accepts any interface name (that isn't an
70  existing pppd option name) without putting "nic-" on the front of
71  it, not just eth*, nas*, tap* and br*.
72
73
74What was new in ppp-2.4.3.
75**************************
76
77* The configure script now accepts --prefix and --sysconfdir options.
78  These default to /usr/local and /etc.  If you want pppd put in
79  /usr/sbin as before, use ./configure --prefix=/usr.
80
81* Doing `make install' no longer puts example configuration files in
82  /etc/ppp.  Use `make install-etcppp' if you want that.
83
84* The code has been updated to work with version 0.8.3 of libpcap.
85  Unfortunately the libpcap maintainers removed support for the
86  "inbound" and "outbound" keywords on PPP links, meaning that if you
87  link pppd with libpcap-0.8.3, you can't use those keywords in the
88  active-filter and pass-filter expressions.  The support has been
89  reinstated in the CVS version and should be in future libpcap
90  releases.  If you need the in/outbound keywords, use a later release
91  than 0.8.3, or get the CVS version from http://www.tcpdump.org.
92
93* There is a new option, child-timeout, which sets the length of time
94  that pppd will wait for child processes (such as the command
95  specified with the pty option) to exit before exiting itself.  It
96  defaults to 5 seconds.  After the timeout, pppd will send a SIGTERM
97  to any remaining child processes and exit.  A value of 0 means no
98  timeout.
99
100* Various bugs have been fixed, including some CBCP packet parsing
101  bugs that could lead to the peer being able to crash pppd if CBCP
102  support is enabled.
103
104* Various fixes and enhancements to the radius and rp-pppoe plugins
105  have been added.
106
107* There is a new winbind plugin, from Andrew Bartlet of the Samba
108  team, which provides the ability to authenticate the peer against an
109  NT domain controller using MS-CHAP or MS-CHAPV2.
110
111* There is a new pppoatm plugin, by various authors, sent in by David
112  Woodhouse.
113
114* The multilink code has been substantially reworked.  The first pppd
115  for a bundle still controls the ppp interface, but it doesn't exit
116  until all the links in the bundle have terminated.  If the first
117  pppd is signalled to exit, it signals all the other pppds
118  controlling links in the bundle.
119
120* The TDB code has been updated to the latest version.  This should
121  eliminate the problem that some people have seen where the database
122  file (/var/run/pppd.tdb) keeps on growing.  Unfortunately, however,
123  the new code uses an incompatible database format.  For this reason,
124  pppd now uses /var/run/pppd2.tdb as the database filename.
125
126
127What was new in ppp-2.4.2.
128**************************
129
130* The CHAP code has been rewritten.  Pppd now has support for MS-CHAP
131  V1 and V2 authentication, both as server and client.  The new CHAP
132  code is cleaner than the old code and avoids some copyright problems
133  that existed in the old code.
134
135* MPPE (Microsoft Point-to-Point Encryption) support has been added,
136  although the current implementation shouldn't be considered
137  completely secure.  (There is no assurance that the current code
138  won't ever transmit an unencrypted packet.)
139
140* James Carlson's implementation of the Extensible Authentication
141  Protocol (EAP) has been added.
142
143* Support for the Encryption Control Protocol (ECP) has been added.
144
145* Some new plug-ins have been included:
146  - A plug-in for kernel-mode PPPoE (PPP over Ethernet)
147  - A plug-in for supplying the PAP password over a pipe from another
148    process
149  - A plug-in for authenticating using a Radius server.
150
151* Updates and bug-fixes for the Solaris port.
152
153* The CBCP (Call Back Control Protocol) code has been updated.  There
154  are new options `remotenumber' and `allow-number'.
155
156* Extra hooks for plugins to use have been added.
157
158* There is now a `maxoctets' option, which causes pppd to terminate
159  the link once the number of bytes passed on the link exceeds a given
160  value.
161
162* There are now options to control whether pppd can use the IPCP
163  IP-Address and IP-Addresses options: `ipcp-no-address' and
164  `ipcp-no-addresses'.
165
166* Fixed several bugs, including potential buffer overflows in chat.
167
168
169What was new in ppp-2.4.1.
170**************************
171
172* Pppd can now print out the set of options that are in effect.  The
173  new `dump' option causes pppd to print out the option values after
174  option parsing is complete.  The `dryrun' option causes pppd to
175  print the options and then exit.
176
177* The option parsing code has been fixed so that options in the
178  per-tty options file are parsed correctly, and don't override values
179  from the command line in most cases.
180
181* The plugin option now looks in /usr/lib/pppd/<pppd-version> (for
182  example, /usr/lib/pppd/2.4.1b1) for shared objects for plugins if
183  there is no slash in the plugin name.
184
185* When loading a plugin, pppd will now check the version of pppd for
186  which the plugin was compiled, and refuse to load it if it is
187  different to pppd's version string.  To enable this, the plugin
188  source needs to #include "pppd.h" and have a line saying:
189	char pppd_version[] = VERSION;
190
191* There is a bug in zlib, discovered by James Carlson, which can cause
192  kernel memory corruption if Deflate is used with the lowest setting,
193  8.  As a workaround pppd will now insist on using at least 9.
194
195* Pppd should compile on Solaris and SunOS again.
196
197* Pppd should now set the MTU correctly on demand-dialled interfaces.
198
199
200What was new in ppp-2.4.0.
201**************************
202
203* Multilink: this package now allows you to combine multiple serial
204  links into one logical link or `bundle', for increased bandwidth and
205  reduced latency.  This is currently only supported under the
206  2.4.x and later Linux kernels.
207
208* All the pppd processes running on a system now write information
209  into a common database.  I used the `tdb' code from samba for this.
210
211* New hooks have been added.
212
213For a list of the changes made during the 2.3 series releases of this
214package, see the Changes-2.3 file.
215
216
217Compression methods.
218********************
219
220This package supports two packet compression methods: Deflate and
221BSD-Compress.  Other compression methods which are in common use
222include Predictor, LZS, and MPPC.  These methods are not supported for
223two reasons - they are patent-encumbered, and they cause some packets
224to expand slightly, which pppd doesn't currently allow for.
225BSD-Compress and Deflate (which uses the same algorithm as gzip) don't
226ever expand packets.
227
228
229Patents.
230********
231
232The BSD-Compress algorithm used for packet compression is the same as
233that used in the Unix "compress" command.  It was apparently covered
234by U.S. patents 4,814,746 (owned by IBM) and 4,558,302 (owned by
235Unisys), and corresponding patents in various other countries (but not
236Australia).  Apparently the Unisys patent expired in the US on 20 June
2372003, but the IBM patent is still pending.
238
239If these patents are of concern in your situation, you can build the
240package without including BSD-Compress.  To do this, edit
241net/ppp-comp.h to change the definition of DO_BSD_COMPRESS to 0.  The
242bsd-comp.c files are then no longer needed, so the references to
243bsd-comp.o may optionally be removed from the Makefiles.
244
245
246Contacts.
247*********
248
249The comp.protocols.ppp newsgroup is a useful place to get help if you
250have trouble getting your ppp connections to work.  Please do not send
251me questions of the form "please help me get connected to my ISP" -
252I'm sorry, but I simply do not have the time to answer all the
253questions like this that I get.
254
255If you find bugs in this package, please report them to the maintainer
256for the port for the operating system you are using:
257
258Linux			Paul Mackerras <paulus@samba.org>
259Solaris			James Carlson <carlson@workingcode.com>
260
261
262Copyrights:
263***********
264
265All of the code can be freely used and redistributed.  The individual
266source files each have their own copyright and permission notice.
267Pppd, pppstats and pppdump are under BSD-style notices.  Some of the
268pppd plugins are GPL'd.  Chat is public domain.
269
270
271Distribution:
272*************
273
274The primary site for releases of this software is:
275
276	ftp://ftp.samba.org/pub/ppp/
277
278
279(Id: README,v 1.37 2006/05/29 23:51:29 paulus Exp)
280

README.cbcp

1	     Microsoft Call Back Configuration Protocol.
2			by Pedro Roque Marques
3			(updated by Paul Mackerras)
4
5The CBCP is a method by which the Microsoft Windows NT Server may
6implement additional security. It is possible to configure the server
7in such a manner so as to require that the client systems which
8connect with it are required that following a valid authentication to
9leave a method by which the number may be returned call.
10
11It is a requirement of servers to be so configured that the protocol be
12exchanged.
13
14So, this set of patches may be applied to the pppd process to enable
15the cbcp client *only* portion of the specification. It is primarily
16meant to permit connection with Windows NT Servers.
17
18The ietf-working specification may be obtained from ftp.microsoft.com
19in the developr/rfc directory.
20
21The ietf task group has decided to recommend that the LCP sequence be
22extended to permit the callback operation. For this reason, these
23patches are not 'part' of pppd but are an adjunct to the code.
24
25To enable CBCP support, all that is required is to uncomment the line
26in Makefile.linux that sets CBCP=y and recompile pppd.
27
28I use such script to make a callback:
29
30pppd debug nodetach /dev/modem 115200 crtscts modem	\
31callback 222222 name NAME remotename SERVER	\
32connect 'chat -v "" atz OK atdt111111 CONNECT ""'
33sleep 1
34pppd debug /dev/modem 115200 crtscts modem	\
35name NAME remotename SERVER defaultroute	\
36connect 'chat -v RING ATA CONNECT "\c"'
37
38First we invoke pppd with 'nodetach' option in order to not detach from
39the controlling terminal and 'callback NUMBER' option, then wait for
401 second and invoke pppd again which waits for a callback (RING) and
41then answers (ATA). Number 222222 is a callback number, i.e. server will
42call us back at this number, while number 111111 is the number we are
43calling to.
44
45You have to put in /etc/ppp/chap-secrets the following two lines:
46
47NAME SERVER PASSWORD
48SERVER NAME PASSWORD
49
50You have to use your real login name, remote server name and password.
51
52

README.eap-srp

1EAP with MD5-Challenge and SRP-SHA1 support
2by James Carlson, Sun Microsystems
3Version 2, September 22nd, 2002
4
5
61.  What it does
7
8    The Extensible Authentication Protocol (EAP; RFC 2284) is a
9    security protocol that can be used with PPP.  It provides a means
10    to plug in multiple optional authentication methods.
11
12    This implementation includes the required default MD5-Challenge
13    method, which is similar to CHAP (RFC 1994), as well as the new
14    SRP-SHA1 method.  This latter method relies on an exchange that is
15    not vulnerable to dictionary attacks (as is CHAP), does not
16    require the server to keep a cleartext copy of the secret (as in
17    CHAP), supports identity privacy, and produces a temporary shared
18    key that could be used for data encryption.
19
20    The SRP-SHA1 method is based on draft-ietf-pppext-eap-srp-03.txt,
21    a work in progress.
22
232.  Required libraries
24
25    Two other packages are required first.  Download and install
26    OpenSSL and Thomas Wu's SRP implementation.
27
28	http://www.openssl.org/ (or ftp://ftp.openssl.org/source/)
29	http://srp.stanford.edu/
30
31    Follow the directions in each package to install the SSL and SRP
32    libraries.  Once SRP is installed, you may run tconf as root to
33    create known fields, if desired.  (This step is not required.)
34
353.  Installing the patch
36
37    The EAP-SRP patch described here is integrated into this version
38    of pppd.  The following patch may be used with older pppd sources:
39
40	ftp://playground.sun.com/carlsonj/eap/ppp-2.4.1-eap-1.tar.gz
41
42    Configure, compile, and install as root.  You may want to edit
43    pppd/Makefile after configuring to enable or disable optional
44    features.
45
46	% ./configure
47	% make
48	% su
49	# make install
50
51    If you use csh or tcsh, run "rehash" to pick up the new commands.
52
53    If you're using Solaris, and you run into trouble with the
54    pseudonym feature on the server side ("no DES here" shows in the
55    log file), make sure that you have the "domestic" versions of the
56    DES libraries linked.  You should see "crypt_d" in "ldd
57    /usr/local/bin/pppd".  If you see "crypt_i" instead, then make
58    sure that /usr/lib/libcrypt.* links to /usr/lib/libcrypt_d.*.  (If
59    you have the international version of Solaris, then you won't have
60    crypt_d.  You might want to find an alternative DES library.)
61
624.  Adding the secrets
63
64    On the EAP SRP-SHA1 client side, access to the cleartext secret is
65    required.  This can be done in two ways:
66
67	- Enter the client name, server name, and password in the
68          /etc/ppp/srp-secrets file.  This file has the same format as
69          the existing chap-secrets and pap-secrets files.
70
71	  clientname servername "secret here"
72
73	- Use the "password" option in any of the standard
74          configuration files (or the command line) to specify the
75          secret.
76
77	  password "secret here"
78
79    On the EAP SRP-SHA1 server side, a secret verifier is required.
80    This is a one-way hash of the client's name and password.  To
81    generate this value, run the srp-entry program (see srp-entry(8)).
82    This program prompts for the client name and the passphrase (the
83    secret).  The output will be an entry, such as the following,
84    suitable for use in the server's srp-secrets file.  Note that if
85    this is transferred by cut-and-paste, the entry must be a single
86    line of text in the file.
87
88pppuser srpserver 0:LFDpwg4HBLi4/kWByzbZpW6pE95/iIWBSt7L.DAkHsvwQphtiq0f6reoUy/1LC1qYqjcrV97lCDmQHQd4KIACGgtkhttLdP3KMowvS0wLXLo25FPJeG2sMAUEWu/HlJPn2/gHyh9aT.ZxUs5MsoQ1E61sJkVBc.2qze1CdZiQGTK3qtWRP6DOpM1bfhKtPoVm.g.MiCcTMWzc54xJUIA0mgKtpthE3JrqCc81cXUt4DYi5yBzeeGTqrI0z2/Gj8Jp7pS4Fkq3GmnYjMxnKfQorFXNwl3m7JSaPa8Gj9/BqnorJOsnSMlIhBe6dy4CYytuTbNb4Wv/nFkmSThK782V:2cIyMp1yKslQgE *
89
90    The "secret" field consists of three entries separated by colons.
91    The first entry is the index of the modulus and generator from
92    SRP's /etc/tpasswd.conf.  If the special value 0 is used, then the
93    well-known modulus/generator value is used (this is recommended,
94    because it is much faster).  The second value is the verifier
95    value.  The third is the password "salt."  These latter two values
96    are encoded in base64 notation.
97
98    For EAP MD5-Challenge, both client and server use the existing
99    /etc/ppp/chap-secrets file.
100
1015.  Configuration options
102
103    There are two main options relating to EAP available for the
104    client.  These are:
105
106	refuse-eap		- refuse to authenticate with EAP
107	srp-use-pseudonym	- use the identity privacy if
108				  offered by server
109
110    The second option stores a pseudonym, if offered by the EAP
111    SRP-SHA1 server, in the $HOME/.ppp_pseudonym file.  The pseudonym
112    is typically an encrypted version of the client identity.  During
113    EAP start-up, the pseudonym stored in this file is offered to the
114    peer as the identity.  If this is accepted by the peer, then
115    eavesdroppers will be unable to determine the identity of the
116    client.  Each time the client is authenticated, the server will
117    offer a new pseudoname to the client using an obscured (reversibly
118    encrypted) message.  Thus, access across successive sessions
119    cannot be tracked.
120
121    There are two main options for EAP on the server:
122
123	require-eap		- require client to use EAP
124	srp-pn-secret "string"	- set server's pseudoname secret
125
126    The second option sets the long-term secret used on the server to
127    encrypt the user's identity to produce pseudonames.  The
128    pseudoname is constructed by hashing this string with the current
129    date (to the nearest day) with SHA1, then using this hash as the
130    key for a DES encryption of the client's name.  The date is added
131    to the hash for two reasons.  First, this allows the pseudonym to
132    change daily.  Second, it allows the server to decode any previous
133    pseudonym by trying previous dates.
134
135    See the pppd(8) man page for additional options.
136
1376.  Comments welcome!
138
139    This is still an experimental implementation.  It has been tested
140    and reviewed carefully for correctness, but may still be
141    incomplete or have other flaws.  All comments are welcome.  Please
142    address them to the author:
143
144		james.d.carlson@sun.com
145
146    or, for EAP itself or the SRP extensions to EAP, to the IETF PPP
147    Extensions working group:
148
149		ietf-ppp@merit.edu
150

README.MPPE

1PPP Support for MPPE (Microsoft Point to Point Encryption)
2==========================================================
3
4Frank Cusack		frank@google.com
5Mar 19, 2002
6
7
8DISCUSSION
9
10MPPE is Microsoft's encryption scheme for PPP links.  It is pretty much
11solely intended for use with PPP over Internet links -- if you have a true
12point to point link you have little need for encryption.  It is generally
13used with PPTP.
14
15MPPE is negotiated within CCP (Compression Control Protocol) as option
1618.  In order for MPPE to work, both peers must agree to do it.  This
17complicates things enough that I chose to implement it as strictly a binary
18option, off by default.  If you turn it on, all other compression options
19are disabled and MPPE *must* be negotiated successfully in both directions
20(CCP is unidirectional) or the link will be disconnected.  I think this is
21reasonable since, if you want encryption, you want encryption.  That is,
22I am not convinced that optional encryption is useful.
23
24While PPP regards MPPE as a "compressor", it actually expands every frame
25by 4 bytes, the MPPE overhead (encapsulation).
26
27Because of the data expansion, you'll see that ppp interfaces get their
28mtu reduced by 4 bytes whenever MPPE is negotiated.  This is because
29when MPPE is active, it is *required* that *every* packet be encrypted.
30PPPD sets the mtu = MIN(peer mru, configured mtu).  To ensure that
31MPPE frames are not larger than the peer's mru, we reduce the mtu by 4
32bytes so that the network layer never sends ppp a packet that's too large.
33
34There is an option to compress the data before encrypting (MPPC), however
35the algorithm is patented and requires execution of a license with Hifn.
36MPPC as an RFC is a complete farce.  I have no further details on MPPC.
37
38Some recommendations:
39
40- Use stateless mode.  Stateful mode is disabled by default.  Unfortunately,
41  stateless mode is very expensive as the peers must rekey for every packet.
42- Use 128-bit encryption.
43- Use MS-CHAPv2 only.
44
45Reference documents:
46
47    <http://www.ietf.org/rfc/rfc3078.txt> MPPE
48    <http://www.ietf.org/rfc/rfc3079.txt> MPPE Key Derivation
49    <http://www.ietf.org/rfc/rfc2118.txt> MPPC
50    <http://www.ietf.org/rfc/rfc2637.txt> PPTP
51    <http://www.ietf.org/rfc/rfc2548.txt> MS RADIUS Attributes
52
53You might be interested in PoPToP, a Linux PPTP server.  You can find it at
54<http://www.poptop.org/>
55
56RADIUS support for MPPE is from Ralf Hofmann, <ralf.hofmann@elvido.net>.
57
58
59BUILDING THE PPPD
60
61The userland component of PPPD has no additional requirements above
62those for MS-CHAP and MS-CHAPv2.  The kernel, however, requires SHA-1
63and ARCFOUR.  Public domain implementations of these are provided.
64
65Until such time as MPPE support ships with kernels, you can use
66the Linux 2.2 or 2.4 implementation that comes with PPPD.  Run the
67ppp/linux/mppe/mppeinstall.sh script, giving it the location to your
68kernel source.  Then add the CONFIG_PPP_MPPE option to your config and
69rebuild the kernel.  The ppp_mppe.o module is added, and the ppp.o module
70(2.2) or ppp_generic.o (2.4) is modified (unfortunately).  You'll need
71the new ppp.o/ppp_generic.o since it does the right thing for the 4
72extra bytes problem discussed above.
73
74
75CONFIGURATION
76
77See pppd(8) for the MPPE options.  Under Linux, if your modutils is earlier
78than 2.4.15, you will need to add
79
80    alias ppp-compress-18 ppp_mppe
81
82to /etc/modules.conf.  (A patch for earlier versions of modutils is included
83with the kernel patches.)
84
85
86

README.MSCHAP80

1PPP Support for Microsoft's CHAP-80
2===================================
3
4Eric Rosenquist          rosenqui@strataware.com
5(updated by Paul Mackerras)
6(updated by Al Longyear)
7(updated by Farrell Woods)
8(updated by Frank Cusack)
9
10INTRODUCTION
11
12Microsoft has introduced an extension to the Challenge/Handshake
13Authentication Protocol (CHAP) which avoids storing cleartext
14passwords on a server.  (Unfortunately, this is not as secure as it
15sounds, because the encrypted password stored on a server can be used
16by a bogus client to gain access to the server just as easily as if
17the password were stored in cleartext.)  The details of the Microsoft
18extensions can be found in the document:
19
20    <http://www.ietf.org/rfc/rfc2433.txt>
21
22In short, MS-CHAP is identified as <auth chap 80> since the hex value
23of 80 is used to designate Microsoft's scheme.  Standard PPP CHAP uses
24a value of 5.  If you enable PPP debugging with the "debug" option and
25see something like the following in your logs, the remote server is
26requesting MS-CHAP:
27
28  rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap 80> <magic 0x46a3>]
29                                           ^^^^^^^^^^^^
30
31The standard pppd implementation will indicate its lack of support for
32MS-CHAP by NAKing it:
33
34  sent [LCP ConfNak id=0x2 <auth chap 05>]
35
36Windows NT Server systems are often configured to "Accept only
37Microsoft Authentication" (this is intended to enhance security).  Up
38until now, that meant that you couldn't use this version of PPPD to
39connect to such a system.
40
41
42BUILDING THE PPPD
43
44MS-CHAP uses a combination of MD4 hashing and DES encryption for
45authentication.  You may need to get Eric Young's libdes library in
46order to use my MS-CHAP extensions.  A lot of UNIX systems already
47have DES encryption available via the crypt(3), encrypt(3) and
48setkey(3) interfaces.  Some may (such as that on Digital UNIX)
49provide only the encryption mechanism and will not perform
50decryption.  This is okay.  We only need to encrypt to perform
51MS-CHAP authentication.
52
53If you have encrypt/setkey available, then hopefully you need only
54define these two things in your Makefile: -DUSE_CRYPT and -DCHAPMS.
55Skip the paragraphs below about obtaining and building libdes.  Do
56the "make clean" and "make" as described below.  Linux users
57should not need to modify their Makefiles.  Instead,
58just do "make CHAPMS=1 USE_CRYPT=1".
59
60If you don't have encrypt and setkey, you will need Eric Young's
61libdes library.  You can find it in:
62
63ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.psy.uq.oz.au/DES/libdes-3.06.tar.gz
64
65Australian residents can get libdes from Eric Young's site:
66
67ftp://ftp.psy.uq.oz.au/pub/Crypto/DES/libdes-3.06.tar.gz
68
69It is also available on many other sites (ask Archie).
70
71I used libdes-3.06, but hopefully anything newer than that will work
72also.  Get the library, build and test it on your system, and install
73it somewhere (typically /usr/local/lib and /usr/local/include).
74
75
76
77You should now be ready to (re)compile the PPPD.  Go to the pppd
78subdirectory and make sure the Makefile contains "-DCHAPMS" in the
79CFLAGS or COMPILE_FLAGS macro, and that the LIBS macro (or LDADD for
80BSD systems) contains "-ldes".  Depending on your system and where the
81DES library was installed, you may also need to alter the include and
82library paths used by your compiler.
83
84Do a "make clean" and then a "make" to rebuild pppd.  Assuming all
85goes well, install the new pppd and move on to the CONFIGURATION
86section.
87
88
89CONFIGURATION
90
91If you've never used PPPD with CHAP before, read the man page (type
92"man pppd") and read the description in there.  Basically, you need to
93edit the "chap-secrets" file typically named /etc/ppp/chap-secrets.
94This should contain the following two lines for each system with which
95you use CHAP (with no leading blanks):
96
97    RemoteHost  Account     Secret
98    Account     RemoteHost  Secret
99
100Note that you need both lines and that item 1 and 2 are swapped in the
101second line.  I'm not sure why you need it twice, but it works and I didn't
102have time to look into it further.  The "RemoteHost" is a somewhat
103arbitrary name for the remote Windows NT system you're dialing.  It doesn't
104have to match the NT system's name, but it *does* have to match what you
105use with the "remotename" parameter.  The "Account" is the Windows NT
106account name you have been told to use when dialing, and the "Secret" is
107the password for that account.  For example, if your service provider calls
108their machine "DialupNT" and tells you your account and password are
109"customer47" and "foobar", add the following to your chap-secrets file:
110
111    DialupNT    customer47  foobar
112    customer47  DialupNT    foobar
113
114The only other thing you need to do for MS-CHAP (compared to normal CHAP)
115is to always use the "remotename" option, either on the command line or in
116your "options" file (see the pppd man page for details).  In the case of
117the above example, you would need to use the following command line:
118
119    pppd name customer47 remotename DialupNT <other options>
120
121or add:
122
123    name customer47
124    remotename DialupNT
125
126to your PPPD "options" file.
127
128The "remotename" option is required for MS-CHAP since Microsoft PPP servers
129don't send their system name in the CHAP challenge packet.
130
131
132E=691 (AUTHENTICATION_FAILURE) ERRORS WHEN YOU HAVE THE VALID SECRET (PASSWORD)
133
134If your RAS server is not the domain controller and is not a 'stand-alone'
135server then it must make a query to the domain controller for your domain.
136
137You need to specify the domain name with the user name when you attempt to
138use this type of a configuration. The domain name is specified with the
139local name in the chap-secrets file and with the option for the 'name'
140parameter.
141
142For example, the previous example would become:
143
144    DialupNT            domain\\customer47   foobar
145    domain\\customer47  DialupNT             foobar
146
147and
148
149    pppd name 'domain\\customer47' remotename DialupNT <other options>
150
151or add:
152
153    name domain\\customer47
154    remotename DialupNT
155
156when the Windows NT domain name is simply called 'domain'.
157
158
159TROUBLESHOOTING
160
161Assuming that everything else has been configured correctly for PPP and
162CHAP, the MS-CHAP-specific problems you're likely to encounter are mostly
163related to your Windows NT account and its settings.  A Microsoft server
164returns error codes in its CHAP response.  The following are extracted from
165RFC 2433:
166
167 646 ERROR_RESTRICTED_LOGON_HOURS
168 647 ERROR_ACCT_DISABLED
169 648 ERROR_PASSWD_EXPIRED
170 649 ERROR_NO_DIALIN_PERMISSION
171 691 ERROR_AUTHENTICATION_FAILURE
172 709 ERROR_CHANGING_PASSWORD
173
174You'll see these in your pppd log as a line similar to:
175
176   Remote message: E=649 R=0
177
178The "E=" is the error number from the table above, and the "R=" flag
179indicates whether the error is transient and the client should retry.  If
180you consistently get error 691, then either you're using the wrong account
181name/password, or the DES library or MD4 hashing (in md4.c) aren't working
182properly.  Verify your account name and password (use a Windows NT or
183Windows 95 system to dial-in if you have one available).  If that checks
184out, test the DES library with the "destest" program included with the DES
185library.  If DES checks out, the md4.c routines are probably failing
186(system byte ordering may be a problem) or my code is screwing up.  I've
187only got access to a Linux system, so you're on your own for anything else.
188
189Another thing that might cause problems is that some RAS servers won't
190respond at all to LCP config requests without seeing the word "CLIENT"
191from the other end.  If you see pppd sending out LCP config requests
192without getting any reply, try putting something in your chat script
193to send the word CLIENT after the modem has connected.
194
195STILL TO DO
196
197A site using only MS-CHAP to authenticate has no need to store cleartext
198passwords in the "chap-secrets" file.  A utility that spits out the ASCII
199hex MD4 hash of a given password would be nice, and would allow that hash
200to be used in chap-secrets in place of the password.  The code to do this
201could quite easily be lifted from chap_ms.c (you have to convert the
202password to Unicode before hashing it).  The chap_ms.c file would also have
203to be changed to recognize a password hash (16 binary bytes == 32 ASCII hex
204characters) and skip the hashing stage.  This would have no real security
205value as the hash is plaintext-equivalent.
206

README.MSCHAP81

1PPP Support for Microsoft's CHAP-81
2===================================
3
4Frank Cusack		frank@google.com
5
6Some text verbatim from README.MSCHAP80,
7by Eric Rosenquist, rosenqui@strataware.com
8
9INTRODUCTION
10
11First, please read README.MSCHAP80; almost everything there applies here.
12MS-CHAP was basically devised by Microsoft because rather than store
13plaintext passwords, they (Microsoft) store the md4 hash of passwords.
14It provides no advantage over standard CHAP, since the hash is used
15as plaintext-equivalent.  (Well, the Change-Password packet is arguably
16an advantage.)  It does introduce a significant weakness if the LM hash
17is used.  Additionally, the format of the failure packet potentially
18gives information to an attacker.  The weakness of the LM hash is partly
19addressed in RFC 2433, which deprecates its use.
20
21MS-CHAPv2 adds 2 benefits to MS-CHAP.  (1) The LM hash is no longer
22used.  (2) Mutual authentication is required.  Note that the mutual
23authentication in MS-CHAPv2 is different than the case where both PPP
24peers require authentication from the other; the former proves that
25the server has access to the client's password, the latter proves that
26the server has access to a secret which the client also has -- which
27may or may not be the same as the client's password (but should not be
28the same, per RFC 1994).  Whether this provides any actual benefit is
29outside the scope of this document.  The details of MS-CHAPv2 can be
30found in the document:
31
32    <http://www.ietf.org/rfc/rfc2759.txt>
33
34
35BUILDING THE PPPD
36
37In addition to the requirements for MS-CHAP, MS-CHAPv2 uses the SHA-1
38hash algorithm.  A public domain implementation is provided with pppd.
39
40
41TROUBLESHOOTING
42
43Assuming that everything else has been configured correctly for PPP and
44CHAP, the MS-CHAPv2-specific problems you're likely to encounter are mostly
45related to your Windows NT account and its settings.  A Microsoft server
46returns error codes in its CHAP response.  The following are extracted from
47RFC 2759:
48
49 646 ERROR_RESTRICTED_LOGON_HOURS
50 647 ERROR_ACCT_DISABLED
51 648 ERROR_PASSWD_EXPIRED
52 649 ERROR_NO_DIALIN_PERMISSION
53 691 ERROR_AUTHENTICATION_FAILURE
54 709 ERROR_CHANGING_PASSWORD
55
56You'll see these in your pppd log as a line similar to:
57
58   Remote message: E=649 No dialin permission
59
60Previously, pppd would log this as:
61
62   Remote message: E=649 R=0
63
64Now, the text message is logged (both for MS-CHAP and MS-CHAPv2).
65
66

README.pwfd

1
2	Support to pass the password via a pipe to the pppd
3	---------------------------------------------------
4
5	Arvin Schnell <arvin@suse.de>
6	2002-02-08
7
8
91. Introduction
10---------------
11
12Normally programs like wvdial or kppp read the online password from their
13config file and store them in the pap- and chap-secrets before they start the
14pppd and remove them afterwards. Sure they need special privileges to do so.
15
16The passwordfd feature offers a simpler and more secure solution. The program
17that starts the pppd opens a pipe and writes the password into it. The pppd
18simply reads the password from that pipe.
19
20This methods is used for quiet a while on SuSE Linux by the programs wvdial,
21kppp and smpppd.
22
23
242. Example
25----------
26
27Here is a short C program that uses the passwordfd feature. It starts the pppd
28to buildup a pppoe connection.
29
30
31--snip--
32
33#include <stdio.h>
34#include <stdlib.h>
35#include <unistd.h>
36#include <signal.h>
37#include <string.h>
38#include <paths.h>
39
40#ifndef _PATH_PPPD
41#define _PATH_PPPD "/usr/sbin/pppd"
42#endif
43
44
45// Of course these values can be read from a configuration file or
46// entered in a graphical dialog.
47char *device = "eth0";
48char *username = "1122334455661122334455660001@t-online.de";
49char *password = "hello";
50
51pid_t pid = 0;
52
53
54void
55sigproc (int src)
56{
57    fprintf (stderr, "Sending signal %d to pid %d\n", src, pid);
58    kill (pid, src);
59    exit (EXIT_SUCCESS);
60}
61
62
63void
64sigchild (int src)
65{
66    fprintf (stderr, "Daemon died\n");
67    exit (EXIT_SUCCESS);
68}
69
70
71int
72start_pppd ()
73{
74    signal (SIGINT, &sigproc);
75    signal (SIGTERM, &sigproc);
76    signal (SIGCHLD, &sigchild);
77
78    pid = fork ();
79    if (pid < 0) {
80	fprintf (stderr, "unable to fork() for pppd: %m\n");
81	return 0;
82    }
83
84    if (pid == 0) {
85
86	int i, pppd_argc = 0;
87	char *pppd_argv[20];
88	char buffer[32] = "";
89	int pppd_passwdfd[2];
90
91	for (i = 0; i < 20; i++)
92	    pppd_argv[i] = NULL;
93
94	pppd_argv[pppd_argc++] = "pppd";
95
96	pppd_argv[pppd_argc++] = "call";
97	pppd_argv[pppd_argc++] = "pwfd-test";
98
99	// The device must be after the call, since the call loads the plugin.
100	pppd_argv[pppd_argc++] = device;
101
102	pppd_argv[pppd_argc++] = "user";
103	pppd_argv[pppd_argc++] = username;
104
105	// Open a pipe to pass the password to pppd.
106	if (pipe (pppd_passwdfd) == -1) {
107	    fprintf (stderr, "pipe failed: %m\n");
108	    exit (EXIT_FAILURE);
109	}
110
111	// Of course this only works it the password is shorter
112	// than the pipe buffer. Otherwise you have to fork to
113	// prevent that your main program blocks.
114	write (pppd_passwdfd[1], password, strlen (password));
115	close (pppd_passwdfd[1]);
116
117	// Tell the pppd to read the password from the fd.
118	pppd_argv[pppd_argc++] = "passwordfd";
119	snprintf (buffer, 32, "%d", pppd_passwdfd[0]);
120	pppd_argv[pppd_argc++] = buffer;
121
122	if (execv (_PATH_PPPD, (char **) pppd_argv) < 0) {
123	    fprintf (stderr, "cannot execl %s: %m\n", _PATH_PPPD);
124	    exit (EXIT_FAILURE);
125	}
126    }
127
128    pause ();
129
130    return 1;
131}
132
133
134int
135main (int argc, char **argv)
136{
137    if (start_pppd ())
138	exit (EXIT_SUCCESS);
139
140    exit (EXIT_FAILURE);
141}
142
143---snip---
144
145
146Copy this file to /etc/ppp/peers/pwfd-test. The plugins can't be loaded on the
147command line (unless you are root) since the plugin option is privileged.
148
149
150---snip---
151
152#
153# PPPoE plugin for kernel 2.4
154#
155plugin pppoe.so
156
157#
158# This plugin enables us to pipe the password to pppd, thus we don't have
159# to fiddle with pap-secrets and chap-secrets. The user is also passed
160# on the command line.
161#
162plugin passwordfd.so
163
164noauth
165usepeerdns
166defaultroute
167hide-password
168nodetach
169nopcomp
170novjccomp
171noccp
172
173---snip---
174
175