add new header ident.h
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_mschapv2 / eap_mschapv2.h
1 #ifndef _EAP_MSCHAPV2_H
2 #define _EAP_MSCHAPV2_H
3
4 #include "eap.h"
5
6 /*
7  *      draft-kamath-pppext-eap-mschapv2-00.txt says:
8  *
9  *      Supplicant              FreeRADIUS
10  *                      <--     challenge
11  *      response        -->
12  *                      <--     success
13  *      success         -->
14  *
15  *      But what we often see is:
16  *
17  *      Supplicant              FreeRADIUS
18  *                      <--     challenge
19  *      response        -->
20  *                      <--     success
21  *      ack             -->
22  */
23 #define PW_EAP_MSCHAPV2_ACK             0
24 #define PW_EAP_MSCHAPV2_CHALLENGE       1
25 #define PW_EAP_MSCHAPV2_RESPONSE        2
26 #define PW_EAP_MSCHAPV2_SUCCESS         3
27 #define PW_EAP_MSCHAPV2_FAILURE         4
28 #define PW_EAP_MSCHAPV2_MAX_CODES       4
29
30 #define MSCHAPV2_HEADER_LEN     5
31 #define MSCHAPV2_CHALLENGE_LEN  16
32 #define MSCHAPV2_RESPONSE_LEN  50
33
34 #define MSCHAPV2_FAILURE_MESSAGE "E=691 R=0"
35 #define MSCHAPV2_FAILURE_MESSAGE_LEN 9
36 typedef struct mschapv2_header_t {
37         uint8_t opcode;
38         uint8_t mschapv2_id;
39         uint8_t ms_length[2];
40         uint8_t value_size;
41 } mschapv2_header_t;
42
43 typedef struct mschapv2_opaque_t {
44         int             code;
45         uint8_t         challenge[MSCHAPV2_CHALLENGE_LEN];
46 } mschapv2_opaque_t;
47
48 #endif /*_EAP_MSCHAPV2_H*/