import from HEAD:
[freeradius.git] / src / modules / rlm_otp / otp_mppe.h
1 /*
2  * $Id$
3  *
4  *   This program is free software; you can redistribute it and/or modify
5  *   it under the terms of the GNU General Public License as published by
6  *   the Free Software Foundation; either version 2 of the License, or
7  *   (at your option) any later version.
8  *
9  *   This program is distributed in the hope that it will be useful,
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *   GNU General Public License for more details.
13  *
14  *   You should have received a copy of the GNU General Public License
15  *   along with this program; if not, write to the Free Software
16  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  * Copyright 2001,2002  Google, Inc.
19  * Copyright 2005,2006 TRI-D Systems, Inc.
20  */
21
22 #ifndef OTP_MPPE_H
23 #define OTP_MPPE_H
24
25 /* Some hardcoding here ... because not all types have #defines */
26 #define PW_MS_CHAP_CHALLENGE  ((311 << 16) | 11)
27 #define PW_MS_CHAP_RESPONSE   ((311 << 16) | 1)
28 #define PW_MS_CHAP2_RESPONSE  ((311 << 16) | 25)
29
30 /* MPPE encryption policy */
31 #define MPPE_ENC_POL_ENCRYPTION_FORBIDDEN "0x00000000"
32 #define MPPE_ENC_POL_ENCRYPTION_ALLOWED   "0x00000001"
33 #define MPPE_ENC_POL_ENCRYPTION_REQUIRED  "0x00000002"
34
35 /* MPPE encryption types */
36 #define MPPE_ENC_TYPES_RC4_40     "0x00000002"
37 #define MPPE_ENC_TYPES_RC4_128    "0x00000004"
38 #define MPPE_ENC_TYPES_RC4_40_128 "0x00000006"
39
40 /* Translate the above into something easily usable. */
41 static const char *otp_mppe_policy[3] = {
42   MPPE_ENC_POL_ENCRYPTION_FORBIDDEN,
43   MPPE_ENC_POL_ENCRYPTION_ALLOWED,
44   MPPE_ENC_POL_ENCRYPTION_REQUIRED };
45
46 static const char *otp_mppe_types[3] = {
47   MPPE_ENC_TYPES_RC4_40,
48   MPPE_ENC_TYPES_RC4_128,
49   MPPE_ENC_TYPES_RC4_40_128 };
50
51 #endif /* OTP_MPPE_H */