/[lwip]/lwip/src/netif/ppp/auth.c
ViewVC logotype

Diff of /lwip/src/netif/ppp/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.6.1 by marcbou, Fri Jun 27 19:35:10 2003 UTC revision 1.2.6.2 by jani, Wed Sep 10 18:10:14 2003 UTC
# Line 194  void link_terminated(int unit) Line 194  void link_terminated(int unit)
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    
# Line 257  void link_established(int unit) Line 257  void link_established(int unit)
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          }          }
# Line 294  void link_established(int unit) Line 294  void link_established(int unit)
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;
# Line 337  void auth_peer_success(int unit, u16_t p Line 337  void auth_peer_success(int unit, u16_t p
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            
# Line 400  void auth_withpeer_success(int unit, u16 Line 400  void auth_withpeer_success(int unit, u16
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            
# Line 541  int check_passwd( Line 541  int check_passwd(
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) {
# Line 616  int get_secret( Line 616  int get_secret(
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);
# Line 640  int get_secret( Line 640  int get_secret(
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);
# Line 753  static void check_idle(void *arg) Line 753  static void check_idle(void *arg)
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);
# Line 767  static void connect_time_expired(void *a Line 767  static void connect_time_expired(void *a
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    

Legend:
Removed from v.1.2.6.1  
changed lines
  Added in v.1.2.6.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26