1 New features were added:
2 + LM support to MS-CHAP
3 + support for SAMBA passwd files. It introduces new files smbpass.c and
5 + support for MS-CHAPv2. SHA1 digest support was added (sha1.c, sha1.h)
6 ! module is configurable via radiusd.conf and supports instances
7 ! module supports both authorization and authentication. Authorization
8 sets authentication to MS-CHAP if any NTLM-related things found.
9 During authorization new attributes added to config_items:
10 LM-Password - LM-encoded password
11 NT-Password - NT-encoded password
12 SMB-Account-CTRL - account control flags in SAMBA format
13 During authentication these attributes are checked against data
15 - RFC 2433 text with MS-CHAPv1 removed. Microsoft attributes are covered
16 by RFC 2458, MS-CHAPv2 - RFC 2759. You can obtain them from
20 3APA3A@security.nnov.ru
22 Below is original README by Jay Miller
24 This is a partial implementation of MS-CHAP for FreeRadius. The patch
25 was designed for Cistron-Radius 1.6.4, but the changes to source are
26 pretty minimal and should work with previous versions. It is based on
27 RFC 2433, which is included with this package.
29 I have tested this successfully using Windows 98 and Windows 2000 with Cisco
30 AS5300 terminal servers. I have not tested it in any other environment, so
31 I can't guarantee it's success everywhere. I also don't have time to do
32 much troubleshooting, though I am interested to hear about problems anyone
33 might have. If you can fix a problem, then I will incorporate the fix into
37 mschap.c - MS-CHAP functions
38 mschap.h - Definitions and prototypes
39 md4c.c, md4.h - RSA Data Security, Inc. MD4 Message-Digest Algorithm
42 des.h - Fast DES by Phil Karn (portable C version)
43 rfc2433.txt - RFC upon which this algorithm is based
48 I was driven to write this when a large customer demanded that they be
49 able to check "Require Encrypted Password" in their Windows Dial-up
50 Networking. Testing showed me that, in Windows 2000 at least, this meant
51 MS-CHAP. If you want to specify CHAP, then Windows 2000 requires you to
52 select "Allow unencrypted password". Duh.
54 MS-CHAP is similar to CHAP. The NAS creates a challenge string and gives it
55 to the client. The client then uses the password to encrypt the challenge
56 and gives it back to the NAS, who then gives them both to Radius. Radius
57 performs the same encryption of the challenge string using the locally stored
58 password, then compares the result to the response from the client.
60 The difference between MS-CHAP and CHAP is in the encryption method. CHAP
61 performs one MD5 hash to get the response. MS-CHAP first encrypts the password
62 with MD4. It then pads the 16-byte hash out to 21 bytes and divides this
63 string into 3 parts. Each 7-byte part is used as a key for a DES encryption
64 of the challenge string. The 8-byte results are then concatonated together
65 into a 24-byte response.
67 The method just described is called NT-encryption by the RFC. MS-CHAP is
68 actually designed for compatability with Microsoft LAN Manager as well.
69 The response returned by the client actually contains an LM encrypted
70 response as well as the NT-encrypted password. This implementation only
71 uses the NT-encrypted response, which seems to work fine for Windows 98
72 and Windows 2000. The RFC also has a number of other specs for allowing the
73 user to change password and things like that. None of that has been
76 A useful extension of this would be in the local storage of passwords.
77 Theoretically you should be able to store the MD4 hash rather than the
78 plain text password. Then the algorithm could pick it up at the next
79 step and still calculate the result. The trouble is that MD4 produces a
80 binary hash. That is, any values from 0 to 255 is a valid byte, and I
81 don't know how to store this in a users file. If it can be done, then
82 we could add a check attribute called "MS-CHAP-Hash" instead of password
83 and get both an encrypted protocol and encrypted password storage at the
84 same time (CHAP requires plain text passwords, while Crypt-Pass requires
85 an unencrypted protocol).
87 If you find this useful, please send me a note just so I can feel good