corrected typo
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_md5 / eap_md5.h
1 #ifndef _EAP_MD5_H
2 #define _EAP_MD5_H
3
4 #include "eap.h"
5
6 #define PW_MD5_CHALLENGE        1
7 #define PW_MD5_RESPONSE         2
8 #define PW_MD5_SUCCESS          3
9 #define PW_MD5_FAILURE          4
10 #define PW_MD5_MAX_CODES        4
11
12 #define MD5_HEADER_LEN          4
13 #define MD5_CHALLENGE_LEN       16
14
15 /*
16  ****
17  * EAP - MD5 doesnot specify code, id & length but chap specifies them,
18  *      for generalization purpose, complete header should be sent
19  *      and not just value_size, value and name.
20  *      future implementation.
21  *
22  *      Huh? What does that mean?
23  */
24
25 /* eap packet structure */
26 typedef struct md5_packet_t {
27 /*
28         uint8_t code;
29         uint8_t id;
30         uint16_t        length;
31 */
32         uint8_t value_size;
33         uint8_t value_name[1];
34 } md5_packet_t;
35
36 typedef struct md5_packet {
37         unsigned char   code;
38         unsigned char   id;
39         unsigned short  length;
40         unsigned char   value_size;
41         unsigned char   *value;
42         char            *name;
43 } MD5_PACKET;
44
45 /* function declarations here */
46
47 MD5_PACKET      *eapmd5_alloc(void);
48 void            eapmd5_free(MD5_PACKET **md5_packet_ptr);
49
50 int             eapmd5_compose(EAP_DS *auth, MD5_PACKET *reply);
51 MD5_PACKET      *eapmd5_extract(EAP_DS *auth);
52 int             eapmd5_verify(MD5_PACKET *pkt, VALUE_PAIR* pwd, uint8_t *ch);
53 #endif /*_EAP_MD5_H*/