2 * chap_ms.h - Challenge Handshake Authentication Protocol definitions.
4 * Copyright (c) 1995 Eric Rosenquist. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
18 * 3. The name(s) of the authors of this software must not be used to
19 * endorse or promote products derived from this software without
20 * prior written permission.
22 * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
23 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
25 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
28 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 * $Id: chap_ms.h,v 1.7 2002/12/04 23:03:32 paulus Exp $
33 #ifndef __CHAPMS_INCLUDE__
35 #define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */
36 #define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */
38 #define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */
39 #define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */
41 /* E=eeeeeeeeee error codes for MS-CHAP failure messages. */
42 #define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646
43 #define MS_CHAP_ERROR_ACCT_DISABLED 647
44 #define MS_CHAP_ERROR_PASSWD_EXPIRED 648
45 #define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649
46 #define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691
47 #define MS_CHAP_ERROR_CHANGING_PASSWORD 709
50 * Use MS_CHAP_RESPONSE_LEN, rather than sizeof(MS_ChapResponse),
51 * in case this struct gets padded.
54 u_char LANManResp[24];
56 u_char UseNT[1]; /* If 1, ignore the LANMan response field */
60 * Use MS_CHAP2_RESPONSE_LEN, rather than sizeof(MS_Chap2Response),
61 * in case this struct gets padded.
64 u_char PeerChallenge[16];
65 u_char Reserved[8]; /* Must be zero */
67 u_char Flags[1]; /* Must be zero */
71 #include <net/ppp-comp.h> /* MPPE_MAX_KEY_LEN */
72 extern u_char mppe_send_key[MPPE_MAX_KEY_LEN];
73 extern u_char mppe_recv_key[MPPE_MAX_KEY_LEN];
76 /* Are we the authenticator or authenticatee? For MS-CHAPv2 key derivation. */
77 #define MS_CHAP2_AUTHENTICATEE 0
78 #define MS_CHAP2_AUTHENTICATOR 1
80 #include "chap.h" /* chap_state, et al */
81 void ChapMS __P((chap_state *, u_char *, char *, int, MS_ChapResponse *));
82 void ChapMS2 __P((chap_state *, u_char *, u_char *, char *, char *, int,
83 MS_Chap2Response *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int));
85 void mppe_set_keys __P((u_char *, u_char[MD4_SIGNATURE_SIZE]));
88 #define __CHAPMS_INCLUDE__
89 #endif /* __CHAPMS_INCLUDE__ */