summaryrefslogtreecommitdiff
path: root/accel-pppd/auth/auth_mschap_v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/auth/auth_mschap_v2.c')
-rw-r--r--accel-pppd/auth/auth_mschap_v2.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c
index aeb4907..ffb6fbf 100644
--- a/accel-pppd/auth/auth_mschap_v2.c
+++ b/accel-pppd/auth/auth_mschap_v2.c
@@ -165,7 +165,7 @@ static void chap_timeout_timer(struct triton_timer_t *t)
if (++d->failure == conf_max_failure) {
if (d->started)
- ppp_terminate(d->ppp, TERM_USER_ERROR, 0);
+ ap_session_terminate(&d->ppp->ses, TERM_USER_ERROR, 0);
else
ppp_auth_failed(d->ppp, NULL);
} else {
@@ -254,7 +254,7 @@ static int generate_response(struct chap_auth_data_t *ad, struct chap_response_t
0x6E};
- passwd = pwdb_get_passwd(ad->ppp,name);
+ passwd = pwdb_get_passwd(&ad->ppp->ses, name);
if (!passwd)
return -1;
@@ -324,7 +324,7 @@ static void chap_send_challenge(struct chap_auth_data_t *ad, int new)
ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
if (conf_timeout && !ad->timeout.tpd)
- triton_timer_add(ad->ppp->ctrl->ctx, &ad->timeout, 0);
+ triton_timer_add(ad->ppp->ses.ctrl->ctx, &ad->timeout, 0);
}
static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *hdr)
@@ -361,7 +361,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
log_ppp_error("mschap-v2: incorrect value-size (%i)\n", msg->val_size);
chap_send_failure(ad, mschap_error, reply_msg);
if (ad->started)
- ppp_terminate(ad->ppp, TERM_USER_ERROR, 0);
+ ap_session_terminate(&ad->ppp->ses, TERM_USER_ERROR, 0);
else
ppp_auth_failed(ad->ppp, NULL);
return;
@@ -371,13 +371,13 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
if (!name) {
log_emerg("mschap-v2: out of memory\n");
if (ad->started)
- ppp_terminate(ad->ppp, TERM_NAS_ERROR, 0);
+ ap_session_terminate(&ad->ppp->ses, TERM_NAS_ERROR, 0);
else
ppp_auth_failed(ad->ppp, NULL);
return;
}
- r = pwdb_check(ad->ppp, name, PPP_CHAP, MSCHAP_V2, ad->id, ad->val, msg->peer_challenge, msg->reserved, msg->nt_hash, msg->flags, authenticator, &mschap_error, &reply_msg);
+ r = pwdb_check(&ad->ppp->ses, name, PPP_CHAP, MSCHAP_V2, ad->id, ad->val, msg->peer_challenge, msg->reserved, msg->nt_hash, msg->flags, authenticator, &mschap_error, &reply_msg);
if (r == PWDB_NO_IMPL) {
r = chap_check_response(ad, msg, name);
@@ -390,7 +390,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, mschap_error, reply_msg);
if (ad->started)
- ppp_terminate(ad->ppp, TERM_AUTH_ERROR, 0);
+ ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0);
else
ppp_auth_failed(ad->ppp, name);
_free(name);
@@ -398,13 +398,13 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h
if (!ad->started) {
if (ppp_auth_successed(ad->ppp, name)) {
chap_send_failure(ad, mschap_error, reply_msg);
- ppp_terminate(ad->ppp, TERM_AUTH_ERROR, 0);
+ ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0);
_free(name);
} else {
chap_send_success(ad, msg, authenticator);
ad->started = 1;
if (conf_interval)
- triton_timer_add(ad->ppp->ctrl->ctx, &ad->interval, 0);
+ triton_timer_add(ad->ppp->ses.ctrl->ctx, &ad->interval, 0);
}
} else {
chap_send_success(ad, msg, authenticator);
@@ -453,7 +453,7 @@ static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response
char *u_passwd;
int i;
- passwd = pwdb_get_passwd(ad->ppp, name);
+ passwd = pwdb_get_passwd(&ad->ppp->ses, name);
if (!passwd) {
if (conf_ppp_verbose)
log_ppp_warn("mschap-v2: user not found\n");