]> git.ozlabs.org Git - ppp.git/blob - pppd/chap_ms.h
update_link_stats(): treat link stats as unsigned, not signed
[ppp.git] / pppd / chap_ms.h
1 /*
2  * chap_ms.h - Challenge Handshake Authentication Protocol definitions.
3  *
4  * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited.
5  * http://www.strataware.com/
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms are permitted
10  * provided that the above copyright notice and this paragraph are
11  * duplicated in all such forms and that any documentation,
12  * advertising materials, and other materials related to such
13  * distribution and use acknowledge that the software was developed
14  * by Eric Rosenquist.  The name of the author may not be used to
15  * endorse or promote products derived from this software without
16  * specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21  *
22  * $Id: chap_ms.h,v 1.6 2002/04/02 13:54:59 dfs Exp $
23  */
24
25 #ifndef __CHAPMS_INCLUDE__
26
27 #define MD4_SIGNATURE_SIZE      16      /* 16 bytes in a MD4 message digest */
28 #define MAX_NT_PASSWORD         256     /* Max (Unicode) chars in an NT pass */
29
30 #define MS_CHAP_RESPONSE_LEN    49      /* Response length for MS-CHAP */
31 #define MS_CHAP2_RESPONSE_LEN   49      /* Response length for MS-CHAPv2 */
32
33 /* E=eeeeeeeeee error codes for MS-CHAP failure messages. */
34 #define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS    646
35 #define MS_CHAP_ERROR_ACCT_DISABLED             647
36 #define MS_CHAP_ERROR_PASSWD_EXPIRED            648
37 #define MS_CHAP_ERROR_NO_DIALIN_PERMISSION      649
38 #define MS_CHAP_ERROR_AUTHENTICATION_FAILURE    691
39 #define MS_CHAP_ERROR_CHANGING_PASSWORD         709
40
41 /*
42  * Use MS_CHAP_RESPONSE_LEN, rather than sizeof(MS_ChapResponse),
43  * in case this struct gets padded.
44  */
45 typedef struct {
46     u_char LANManResp[24];
47     u_char NTResp[24];
48     u_char UseNT[1];            /* If 1, ignore the LANMan response field */
49 } MS_ChapResponse;
50
51 /*
52  * Use MS_CHAP2_RESPONSE_LEN, rather than sizeof(MS_Chap2Response),
53  * in case this struct gets padded.
54  */
55 typedef struct {
56     u_char PeerChallenge[16];
57     u_char Reserved[8];         /* Must be zero */
58     u_char NTResp[24];
59     u_char Flags[1];            /* Must be zero */
60 } MS_Chap2Response;
61
62 #ifdef MPPE
63 #include <net/ppp-comp.h>       /* MPPE_MAX_KEY_LEN */
64 extern u_char mppe_send_key[MPPE_MAX_KEY_LEN];
65 extern u_char mppe_recv_key[MPPE_MAX_KEY_LEN];
66 #endif
67
68 /* Are we the authenticator or authenticatee?  For MS-CHAPv2 key derivation. */
69 #define MS_CHAP2_AUTHENTICATEE 0
70 #define MS_CHAP2_AUTHENTICATOR 1
71
72 #include "chap.h" /* chap_state, et al */
73 void ChapMS __P((chap_state *, u_char *, char *, int, MS_ChapResponse *));
74 void ChapMS2 __P((chap_state *, u_char *, u_char *, char *, char *, int,
75                   MS_Chap2Response *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int));
76 #ifdef MPPE
77 void mppe_set_keys __P((u_char *, u_char[MD4_SIGNATURE_SIZE]));
78 #endif
79
80 #define __CHAPMS_INCLUDE__
81 #endif /* __CHAPMS_INCLUDE__ */