diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2010-10-25 16:21:25 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2010-10-25 16:21:25 +0400 |
commit | 788923a042b90bc5ff1922b9b46648c4f4c0218c (patch) | |
tree | 70ef58296a98960975d07dbeda504999396802ef /accel-pptpd/auth | |
parent | 5d039c59acb58eb90f8d1256245b2c99aea129b0 (diff) | |
download | accel-ppp-788923a042b90bc5ff1922b9b46648c4f4c0218c.tar.gz accel-ppp-788923a042b90bc5ff1922b9b46648c4f4c0218c.zip |
implemented chap-secrets module which reads username,password and ip address from pppd compatible chap-secrets file
Diffstat (limited to 'accel-pptpd/auth')
-rw-r--r-- | accel-pptpd/auth/auth_chap_md5.c | 1 | ||||
-rw-r--r-- | accel-pptpd/auth/auth_mschap_v1.c | 3 | ||||
-rw-r--r-- | accel-pptpd/auth/auth_mschap_v2.c | 4 | ||||
-rw-r--r-- | accel-pptpd/auth/auth_pap.c | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/accel-pptpd/auth/auth_chap_md5.c b/accel-pptpd/auth/auth_chap_md5.c index 0e22908..a29cedb 100644 --- a/accel-pptpd/auth/auth_chap_md5.c +++ b/accel-pptpd/auth/auth_chap_md5.c @@ -316,7 +316,6 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h auth_successed(ad->ppp, name); } } - _free(name); _free(passwd); } else if (r == PWDB_DENIED) { chap_send_failure(ad); diff --git a/accel-pptpd/auth/auth_mschap_v1.c b/accel-pptpd/auth/auth_mschap_v1.c index d1dccef..d74f8e9 100644 --- a/accel-pptpd/auth/auth_mschap_v1.c +++ b/accel-pptpd/auth/auth_mschap_v1.c @@ -307,7 +307,8 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h r = pwdb_check(ad->ppp, name, PPP_CHAP, MSCHAP_V1, ad->id, ad->val, VALUE_SIZE, msg->lm_hash, msg->nt_hash, msg->flags); if (r == PWDB_NO_IMPL) - r = chap_check_response(ad, msg, name); + if (chap_check_response(ad, msg, name)) + r = PWDB_DENIED; if (r == PWDB_DENIED) { chap_send_failure(ad); diff --git a/accel-pptpd/auth/auth_mschap_v2.c b/accel-pptpd/auth/auth_mschap_v2.c index 3b2da7b..8e4a7c0 100644 --- a/accel-pptpd/auth/auth_mschap_v2.c +++ b/accel-pptpd/auth/auth_mschap_v2.c @@ -384,7 +384,9 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h if (r == PWDB_NO_IMPL) { r = chap_check_response(ad, msg, name); - if (generate_response(ad, msg, name, authenticator)) + if (r) + r = PWDB_DENIED; + else if (generate_response(ad, msg, name, authenticator)) r = PWDB_DENIED; } diff --git a/accel-pptpd/auth/auth_pap.c b/accel-pptpd/auth/auth_pap.c index e1b48bd..814d02d 100644 --- a/accel-pptpd/auth/auth_pap.c +++ b/accel-pptpd/auth/auth_pap.c @@ -170,7 +170,7 @@ static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr) int ret, r; char *peer_id; char *passwd; - const char *passwd2; + char *passwd2; int peer_id_len; int passwd_len; uint8_t *ptr = (uint8_t*)(hdr + 1); @@ -204,6 +204,7 @@ static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr) r = PWDB_DENIED; else r = PWDB_SUCCESS; + _free(passwd2); } if (r == PWDB_DENIED) { if (conf_ppp_verbose) |