1 /*
2 * CHAP-MD5
3 *
4 */
5 #ifndef CHAP_MD5
6 #define CHAP_MD5
7
8 #include "utils/includes.h"
9 #include "utils/common.h"
10 #include "crypto/crypto.h"
11 #include "eap_peer/chap.h"
12
chap_md5(u8 id,const u8 * secret,size_t secret_len,const u8 * challenge,size_t challenge_len,u8 * response)13 int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
14 size_t challenge_len, u8 *response)
15 {
16 const u8 *addr[3];
17 size_t len[3];
18
19 addr[0] = &id;
20 len[0] = 1;
21 addr[1] = secret;
22 len[1] = secret_len;
23 addr[2] = challenge;
24 len[2] = challenge_len;
25 return md5_vector(3, addr, len, response);
26 }
27
28 #endif /* CHAP_MD5 */
29