This file should be moved to src/lib.
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_md5 / eap_md5.h
index 00f1a66..6caf56d 100644 (file)
 #define PW_MD5_MAX_CODES       4
 
 #define MD5_HEADER_LEN                 4
+#define MD5_LEN                16
 
 /*
  ****
  * EAP - MD5 doesnot specify code, id & length but chap specifies them,
  *     for generalization purpose, complete header should be sent
  *     and not just value_size, value and name.
- *     future implementation.
+ *     future implementation.
  */
 
 /* eap packet structure */
@@ -31,11 +32,11 @@ typedef struct md5_packet_t {
 } md5_packet_t;
 
 typedef struct md5_packet {
-       int             code;
-       int             id;
-       int             length;
-       int             value_size;
-       uint8_t         *value;
+       unsigned char   code;
+       unsigned char   id;
+       unsigned int    length;
+       unsigned int    value_size;
+       unsigned char   *value;
        char            *name;
 /*     char            *message; */
 } MD5_PACKET;
@@ -50,12 +51,17 @@ typedef struct md5_list {
 
 /* function declarations here */
 
-MD5_PACKET *md5_alloc(void);
-void md5_free(MD5_PACKET **md5_packet_ptr);
-MD5_PACKET *extract_md5(EAP_DS *auth);
-MD5_PACKET *md5_initial_request(EAP_DS *eap_ds);
-MD5_PACKET * process_md5(MD5_PACKET *packet, int id, VALUE_PAIR *username, VALUE_PAIR* password, md5_packet_t *req);
-int chap_challenge(int id, char *password, int pass_len, char *challenge, int challenge_len, char *output);
-int compose_md5(EAP_DS *auth, MD5_PACKET *reply);
+MD5_PACKET     *eapmd5_alloc();
+void           eapmd5_free(MD5_PACKET **md5_packet_ptr);
+MD5_PACKET     *eapmd5_extract(EAP_DS *auth);
+int            eapmd5_compose(EAP_DS *auth, MD5_PACKET *reply);
+MD5_PACKET     *eapmd5_initiate(EAP_DS *eap_ds);
+MD5_PACKET     *eapmd5_process(MD5_PACKET *packet, int id, 
+                       VALUE_PAIR *username, VALUE_PAIR* password,
+                       md5_packet_t *req);
+int            eapmd5_challenge(int id,
+                       unsigned char *password, int pass_len,
+                       unsigned char *challenge, int challenge_len,
+                       unsigned char *output);
 
 #endif /*_EAP_MD5_H*/