All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
eap_leap.h
Go to the documentation of this file.
1 #ifndef _EAP_LEAP_H
2 #define _EAP_LEAP_H
3 
4 RCSIDH(eap_leap_h, "$Id: eaef96b6ed31ea0e9ec9f8f49dcec61b206c3e29 $")
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 */
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;
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];
60 
61 /* function declarations here */
62 
63 int eap_leap_compose(REQUEST *request, eap_round_t *auth, leap_packet_t *reply);
66 int eap_leap_stage4(REQUEST *request, leap_packet_t *packet, VALUE_PAIR* password, leap_session_t *session);
67 leap_packet_t *eap_leap_stage6(REQUEST *request, leap_packet_t *packet, VALUE_PAIR *user_name, VALUE_PAIR* password,
68  leap_session_t *session);
69 
70 void eap_leap_mschap(unsigned char const *win_password, unsigned char const *challenge, unsigned char *response);
71 
72 #endif /*_EAP_LEAP_H*/
uint8_t challenge[1]
Definition: eap_leap.h:35
#define RCSIDH(h, id)
Definition: build.h:136
uint8_t unused
Definition: eap_leap.h:33
bfd_auth_t auth
Definition: proto_bfd.c:209
uint8_t version
Definition: eap_leap.h:32
unsigned char code
Definition: eap_leap.h:42
leap_packet_t * eap_leap_initiate(REQUEST *request, eap_round_t *eap_round, VALUE_PAIR *user_name)
Definition: eap_leap.c:346
leap_packet_t * eap_leap_extract(REQUEST *request, eap_round_t *eap_round)
Definition: eap_leap.c:59
size_t name_len
Definition: eap_leap.h:47
unsigned char * challenge
Definition: eap_leap.h:46
size_t length
Definition: eap_leap.h:44
uint8_t peer_response[24]
Definition: eap_leap.h:58
Stores an attribute, a value and various bits of other data.
Definition: pair.h:112
int eap_leap_compose(REQUEST *request, eap_round_t *auth, leap_packet_t *reply)
Definition: eap_leap.c:396
int eap_leap_stage4(REQUEST *request, leap_packet_t *packet, VALUE_PAIR *password, leap_session_t *session)
Definition: eap_leap.c:207
Contains a pair of request and response packets.
Definition: eap.h:43
struct leap_packet_raw_t leap_packet_raw_t
uint8_t count
Definition: eap_leap.h:34
leap_packet_t * eap_leap_stage6(REQUEST *request, leap_packet_t *packet, VALUE_PAIR *user_name, VALUE_PAIR *password, leap_session_t *session)
Definition: eap_leap.c:240
void eap_leap_mschap(unsigned char const *win_password, unsigned char const *challenge, unsigned char *response)
Definition: smbdes.c:317
struct leap_session_t leap_session_t
struct leap_packet leap_packet_t
uint8_t peer_challenge[8]
Definition: eap_leap.h:57
char * name
Definition: eap_leap.h:48
int count
Definition: eap_leap.h:45
unsigned char id
Definition: eap_leap.h:43