All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
eap_md5.h
Go to the documentation of this file.
1 #ifndef _EAP_MD5_H
2 #define _EAP_MD5_H
3 
4 RCSIDH(eap_md5_h, "$Id: e8d08fdbac82e7199ade38dd3546e9f1ea57152c $")
5 
6 #include "eap.h"
7 
8 #define PW_MD5_CHALLENGE 1
9 #define PW_MD5_RESPONSE 2
10 #define PW_MD5_SUCCESS 3
11 #define PW_MD5_FAILURE 4
12 #define PW_MD5_MAX_CODES 4
13 
14 #define MD5_HEADER_LEN 4
15 #define MD5_CHALLENGE_LEN 16
16 
17 /*
18  ****
19  * EAP - MD5 does not specify code, id & length but chap specifies them,
20  * for generalization purpose, complete header should be sent
21  * and not just value_size, value and name.
22  * future implementation.
23  *
24  * Huh? What does that mean?
25  */
26 
27 /* eap packet structure */
28 typedef struct md5_packet_t {
29 /*
30  uint8_t code;
31  uint8_t id;
32  uint16_t length;
33 */
34  uint8_t value_size;
35  uint8_t value_name[1];
36 } md5_packet_t;
37 
38 typedef struct md5_packet {
39  unsigned char code;
40  unsigned char id;
41  unsigned short length;
42  unsigned char value_size;
43  unsigned char *value;
44  char *name;
45 } MD5_PACKET;
46 
47 /* function declarations here */
48 
51 int eapmd5_verify(MD5_PACKET *pkt, VALUE_PAIR* pwd, uint8_t *ch);
52 #endif /*_EAP_MD5_H*/
#define RCSIDH(h, id)
Definition: build.h:136
struct md5_packet MD5_PACKET
bfd_auth_t auth
Definition: proto_bfd.c:209
unsigned char id
Definition: eap_md5.h:40
struct md5_packet_t md5_packet_t
int eapmd5_verify(MD5_PACKET *pkt, VALUE_PAIR *pwd, uint8_t *ch)
Definition: eap_md5.c:130
unsigned char code
Definition: eap_md5.h:39
uint8_t value_name[1]
Definition: eap_md5.h:35
Stores an attribute, a value and various bits of other data.
Definition: pair.h:112
unsigned short length
Definition: eap_md5.h:41
Contains a pair of request and response packets.
Definition: eap.h:43
char * name
Definition: eap_md5.h:44
int eapmd5_compose(eap_round_t *auth, MD5_PACKET *reply)
Definition: eap_md5.c:180
uint8_t value_size
Definition: eap_md5.h:34
MD5_PACKET * eapmd5_extract(eap_round_t *auth)
Definition: eap_md5.c:50
unsigned char value_size
Definition: eap_md5.h:42
unsigned char * value
Definition: eap_md5.h:43