194 |
if (logged_in) |
if (logged_in) |
195 |
logout(); |
logout(); |
196 |
lcp_phase[unit] = PHASE_DEAD; |
lcp_phase[unit] = PHASE_DEAD; |
197 |
ppp_trace(LOG_NOTICE, "Connection terminated.\n"); |
AUTHDEBUG((LOG_NOTICE, "Connection terminated.\n")); |
198 |
pppMainWakeup(unit); |
pppMainWakeup(unit); |
199 |
} |
} |
200 |
|
|
257 |
* of "" and a password of "". If that's not OK, boot it out. |
* of "" and a password of "". If that's not OK, boot it out. |
258 |
*/ |
*/ |
259 |
if (!wo->neg_upap || !null_login(unit)) { |
if (!wo->neg_upap || !null_login(unit)) { |
260 |
ppp_trace(LOG_WARNING, "peer refused to authenticate\n"); |
AUTHDEBUG((LOG_WARNING, "peer refused to authenticate\n")); |
261 |
lcp_close(unit, "peer refused to authenticate"); |
lcp_close(unit, "peer refused to authenticate"); |
262 |
return; |
return; |
263 |
} |
} |
294 |
if (ppp_settings.passwd[0] == 0) { |
if (ppp_settings.passwd[0] == 0) { |
295 |
passwd_from_file = 1; |
passwd_from_file = 1; |
296 |
if (!get_pap_passwd(unit, ppp_settings.user, ppp_settings.passwd)) |
if (!get_pap_passwd(unit, ppp_settings.user, ppp_settings.passwd)) |
297 |
ppp_trace(LOG_ERR, "No secret found for PAP login\n"); |
AUTHDEBUG((LOG_ERR, "No secret found for PAP login\n")); |
298 |
} |
} |
299 |
upap_authwithpeer(unit, ppp_settings.user, ppp_settings.passwd); |
upap_authwithpeer(unit, ppp_settings.user, ppp_settings.passwd); |
300 |
auth |= PAP_WITHPEER; |
auth |= PAP_WITHPEER; |
337 |
pbit = PAP_PEER; |
pbit = PAP_PEER; |
338 |
break; |
break; |
339 |
default: |
default: |
340 |
ppp_trace(LOG_WARNING, "auth_peer_success: unknown protocol %x\n", |
AUTHDEBUG((LOG_WARNING, "auth_peer_success: unknown protocol %x\n", |
341 |
protocol); |
protocol)); |
342 |
return; |
return; |
343 |
} |
} |
344 |
|
|
400 |
pbit = PAP_WITHPEER; |
pbit = PAP_WITHPEER; |
401 |
break; |
break; |
402 |
default: |
default: |
403 |
ppp_trace(LOG_WARNING, "auth_peer_success: unknown protocol %x\n", |
AUTHDEBUG((LOG_WARNING, "auth_peer_success: unknown protocol %x\n", |
404 |
protocol); |
protocol)); |
405 |
pbit = 0; |
pbit = 0; |
406 |
} |
} |
407 |
|
|
541 |
* On 10'th, drop the connection. |
* On 10'th, drop the connection. |
542 |
*/ |
*/ |
543 |
if (attempts++ >= 10) { |
if (attempts++ >= 10) { |
544 |
ppp_trace(LOG_WARNING, "%d LOGIN FAILURES BY %s\n", attempts, user); |
AUTHDEBUG((LOG_WARNING, "%d LOGIN FAILURES BY %s\n", attempts, user)); |
545 |
/*ppp_panic("Excess Bad Logins");*/ |
/*ppp_panic("Excess Bad Logins");*/ |
546 |
} |
} |
547 |
if (attempts > 3) { |
if (attempts > 3) { |
616 |
|
|
617 |
len = strlen(ppp_settings.passwd); |
len = strlen(ppp_settings.passwd); |
618 |
if (len > MAXSECRETLEN) { |
if (len > MAXSECRETLEN) { |
619 |
ppp_trace(LOG_ERR, "Secret for %s on %s is too long\n", client, server); |
AUTHDEBUG((LOG_ERR, "Secret for %s on %s is too long\n", client, server)); |
620 |
len = MAXSECRETLEN; |
len = MAXSECRETLEN; |
621 |
} |
} |
622 |
BCOPY(ppp_settings.passwd, secret, len); |
BCOPY(ppp_settings.passwd, secret, len); |
640 |
|
|
641 |
len = strlen(secbuf); |
len = strlen(secbuf); |
642 |
if (len > MAXSECRETLEN) { |
if (len > MAXSECRETLEN) { |
643 |
ppp_trace(LOG_ERR, "Secret for %s on %s is too long\n", client, server); |
AUTHDEBUG((LOG_ERR, "Secret for %s on %s is too long\n", client, server)); |
644 |
len = MAXSECRETLEN; |
len = MAXSECRETLEN; |
645 |
} |
} |
646 |
BCOPY(secbuf, secret, len); |
BCOPY(secbuf, secret, len); |
753 |
itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); |
itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); |
754 |
if (itime >= ppp_settings.idle_time_limit) { |
if (itime >= ppp_settings.idle_time_limit) { |
755 |
/* link is idle: shut it down. */ |
/* link is idle: shut it down. */ |
756 |
ppp_trace(LOG_INFO, "Terminating connection due to lack of activity.\n"); |
AUTHDEBUG((LOG_INFO, "Terminating connection due to lack of activity.\n")); |
757 |
lcp_close(0, "Link inactive"); |
lcp_close(0, "Link inactive"); |
758 |
} else { |
} else { |
759 |
TIMEOUT(check_idle, NULL, ppp_settings.idle_time_limit - itime); |
TIMEOUT(check_idle, NULL, ppp_settings.idle_time_limit - itime); |
767 |
{ |
{ |
768 |
(void)arg; |
(void)arg; |
769 |
|
|
770 |
ppp_trace(LOG_INFO, "Connect time expired\n"); |
AUTHDEBUG((LOG_INFO, "Connect time expired\n")); |
771 |
lcp_close(0, "Connect time expired"); /* Close connection */ |
lcp_close(0, "Connect time expired"); /* Close connection */ |
772 |
} |
} |
773 |
|
|