summaryrefslogtreecommitdiff
path: root/accel-pppd/auth
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2011-01-13 09:00:23 +0300
committerDmitry Kozlov <xeb@mail.ru>2011-01-13 09:00:23 +0300
commit1e997d3ea80accb91a5f955637de4b09e8e496f8 (patch)
tree3ffdcdbcad0d1d40332452b83bcce55018680854 /accel-pppd/auth
parenta6266776efbe57dcf56e413d7b406331c5414206 (diff)
downloadaccel-ppp-1e997d3ea80accb91a5f955637de4b09e8e496f8.tar.gz
accel-ppp-1e997d3ea80accb91a5f955637de4b09e8e496f8.zip
auth: bugs fixes
Diffstat (limited to 'accel-pppd/auth')
-rw-r--r--accel-pppd/auth/auth_chap_md5.c11
-rw-r--r--accel-pppd/auth/auth_mschap_v1.c10
-rw-r--r--accel-pppd/auth/auth_mschap_v2.c9
3 files changed, 13 insertions, 17 deletions
diff --git a/accel-pppd/auth/auth_chap_md5.c b/accel-pppd/auth/auth_chap_md5.c
index d19634a5..647ba153 100644
--- a/accel-pppd/auth/auth_chap_md5.c
+++ b/accel-pppd/auth/auth_chap_md5.c
@@ -272,15 +272,18 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
if (msg->hdr.id != ad->id) {
if (conf_ppp_verbose)
- log_ppp_error("chap-md5: id mismatch\n");
- chap_send_failure(ad);
- ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
+ log_ppp_warn("chap-md5: id mismatch\n");
+ return;
}
if (msg->val_size != VALUE_SIZE) {
log_ppp_error("chap-md5: incorrect value-size (%i)\n", msg->val_size);
chap_send_failure(ad);
- ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
+ if (ad->started)
+ ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
+ else
+ ppp_auth_failed(ad->ppp, NULL);
+ return;
}
name = _strndup(msg->name,ntohs(msg->hdr.len) - sizeof(*msg) + 2);
diff --git a/accel-pppd/auth/auth_mschap_v1.c b/accel-pppd/auth/auth_mschap_v1.c
index 5b38db54..21d90a69 100644
--- a/accel-pppd/auth/auth_mschap_v1.c
+++ b/accel-pppd/auth/auth_mschap_v1.c
@@ -288,21 +288,17 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
if (msg->hdr.id != ad->id) {
if (conf_ppp_verbose)
- log_ppp_error("mschap-v1: id mismatch\n");
- chap_send_failure(ad);
- if (ad->started)
- ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
- else
- ppp_auth_failed(ad->ppp, NULL);
+ log_ppp_warn("mschap-v1: id mismatch\n");
+ return;
}
if (msg->val_size != RESPONSE_VALUE_SIZE) {
log_ppp_error("mschap-v1: incorrect value-size (%i)\n", msg->val_size);
- chap_send_failure(ad);
if (ad->started)
ppp_terminate(ad->ppp, TERM_AUTH_ERROR, 0);
else
ppp_auth_failed(ad->ppp, NULL);
+ return;
}
name = _strndup(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c
index e07c4f7e..61dd017f 100644
--- a/accel-pppd/auth/auth_mschap_v2.c
+++ b/accel-pppd/auth/auth_mschap_v2.c
@@ -362,12 +362,8 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
if (msg->hdr.id != ad->id) {
if (conf_ppp_verbose)
- log_ppp_error("mschap-v2: id mismatch\n");
- chap_send_failure(ad);
- if (ad->started)
- ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
- else
- ppp_auth_failed(ad->ppp, NULL);
+ log_ppp_warn("mschap-v2: id mismatch\n");
+ return;
}
if (msg->val_size != RESPONSE_VALUE_SIZE) {
@@ -377,6 +373,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
else
ppp_auth_failed(ad->ppp, NULL);
+ return;
}
name = _strndup(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);