diff options
Diffstat (limited to 'accel-pptpd/auth/auth_mschap_v1.c')
-rw-r--r-- | accel-pptpd/auth/auth_mschap_v1.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/accel-pptpd/auth/auth_mschap_v1.c b/accel-pptpd/auth/auth_mschap_v1.c index bc54ed4..818d60d 100644 --- a/accel-pptpd/auth/auth_mschap_v1.c +++ b/accel-pptpd/auth/auth_mschap_v1.c @@ -17,6 +17,8 @@ #include "ppp_lcp.h" #include "pwdb.h" +#include "memdebug.h" + #define MSCHAP_V1 0x80 #define CHAP_CHALLENGE 1 @@ -101,7 +103,7 @@ static void print_str(const char *buf,int size) static struct auth_data_t* auth_data_init(struct ppp_t *ppp) { - struct chap_auth_data_t *d=malloc(sizeof(*d)); + struct chap_auth_data_t *d=_malloc(sizeof(*d)); memset(d,0,sizeof(*d)); d->auth.proto=PPP_CHAP; @@ -114,7 +116,7 @@ static void auth_data_free(struct ppp_t *ppp,struct auth_data_t *auth) { struct chap_auth_data_t *d=container_of(auth,typeof(*d),auth); - free(d); + _free(d); } static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth) @@ -234,7 +236,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h auth_failed(ad->ppp); } - name = strndup(msg->name,ntohs(msg->hdr.len)-sizeof(*msg)+2); + name = _strndup(msg->name,ntohs(msg->hdr.len)-sizeof(*msg)+2); if (!name) { log_emerg("mschap-v2: out of memory\n"); auth_failed(ad->ppp); @@ -248,7 +250,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h if (r == PWDB_DENIED) { chap_send_failure(ad); auth_failed(ad->ppp); - free(name); + _free(name); } else { chap_send_success(ad); auth_successed(ad->ppp, name); @@ -301,7 +303,7 @@ static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response return PWDB_DENIED; } - u_passwd=malloc(strlen(passwd)*2); + u_passwd=_malloc(strlen(passwd)*2); for(i=0; i<strlen(passwd); i++) { u_passwd[i*2]=passwd[i]; @@ -317,8 +319,8 @@ static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response des_encrypt(ad->val,z_hash+7,nt_hash+8); des_encrypt(ad->val,z_hash+14,nt_hash+16); - free(passwd); - free(u_passwd); + _free(passwd); + _free(u_passwd); return memcmp(nt_hash,msg->nt_hash,24) ? PWDB_DENIED : PWDB_SUCCESS; } |