OVMS3-idf/components/wpa_supplicant/src/eap_peer/chap.c
Deng Xin c139683024 supplicant/esp_wifi: move supplicant to idf
Move supplicant to idf and do following refactoring:
1. Make the folder structure consitent with supplicant upstream
2. Remove duplicated header files and minimize the public header files
3. Refactor for WiFi/supplicant interfaces
2019-06-29 22:46:52 +08:00

27 lines
498 B
C

/*
* CHAP-MD5
*
*/
#ifdef CHAP_MD5
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "wpa2/eap_peer/chap.h"
int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
size_t challenge_len, u8 *response)
{
const u8 *addr[3];
size_t len[3];
addr[0] = &id;
len[0] = 1;
addr[1] = secret;
len[1] = secret_len;
addr[2] = challenge;
len[2] = challenge_len;
return md5_vector(3, addr, len, response);
}
#endif /* CHAP_MD5 */