Typo fix: doesnot => does not
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_leap / eap_leap.h
1 #ifndef _EAP_LEAP_H
2 #define _EAP_LEAP_H
3
4 RCSIDH(eap_leap_h, "$Id$")
5
6 #include "eap.h"
7
8 #define PW_LEAP_CHALLENGE       1
9 #define PW_LEAP_RESPONSE        2
10 #define PW_LEAP_SUCCESS         3
11 #define PW_LEAP_FAILURE         4
12 #define PW_LEAP_MAX_CODES       4
13
14 /*
15  *  Version + unused + count
16  */
17 #define LEAP_HEADER_LEN         3
18
19 /*
20  ****
21  * EAP - LEAP does not specify code, id & length but chap specifies them,
22  *      for generalization purpose, complete header should be sent
23  *      and not just value_size, value and name.
24  *      future implementation.
25  */
26
27 /* eap packet structure */
28 typedef struct leap_packet_raw_t {
29         /*
30          *  EAP header, followed by type comes before this.
31          */
32         uint8_t version;
33         uint8_t unused;
34         uint8_t count;
35         uint8_t challenge[1];   /* 8 or 24, followed by user name */
36 } leap_packet_raw_t;
37
38 /*
39  *      Which is decoded into this.
40  */
41 typedef struct leap_packet {
42         unsigned char   code;
43         unsigned char   id;
44         size_t          length;
45         int             count;
46         unsigned char   *challenge;
47         size_t          name_len;
48         char            *name;
49 } leap_packet_t;
50
51 /*
52  *      The information which must be kept around
53  *      during the LEAP session.
54  */
55 typedef struct leap_session_t {
56         int             stage;
57         uint8_t         peer_challenge[8];
58         uint8_t         peer_response[24];
59 } leap_session_t;
60
61 /* function declarations here */
62
63 int             eapleap_compose(REQUEST *request, EAP_DS *auth, leap_packet_t *reply);
64 leap_packet_t   *eapleap_extract(REQUEST *request, EAP_DS *eap_ds);
65 leap_packet_t   *eapleap_initiate(REQUEST *request, EAP_DS *eap_ds, VALUE_PAIR *user_name);
66 int             eapleap_stage4(REQUEST *request, leap_packet_t *packet, VALUE_PAIR* password, leap_session_t *session);
67 leap_packet_t   *eapleap_stage6(REQUEST *request, leap_packet_t *packet, VALUE_PAIR *user_name, VALUE_PAIR* password,
68                                 leap_session_t *session);
69
70 void eapleap_mschap(unsigned char const *win_password, unsigned char const *challenge, unsigned char *response);
71
72 #endif /*_EAP_LEAP_H*/