/[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 by jani, Mon Jun 2 11:12:56 2003 UTC revision 1.3 by marcbou, Fri Jun 27 20:46:11 2003 UTC
# Line 122  static int  get_pap_passwd (int, char *, Line 122  static int  get_pap_passwd (int, char *,
122  static int  have_pap_secret (void);  static int  have_pap_secret (void);
123  static int  have_chap_secret (char *, char *, u32_t);  static int  have_chap_secret (char *, char *, u32_t);
124  static int  ip_addr_check (u32_t, struct wordlist *);  static int  ip_addr_check (u32_t, struct wordlist *);
125  #if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0  #if 0 /* PAP_SUPPORT > 0 || CHAP_SUPPORT > 0 */
126  static void set_allowed_addrs(int unit, struct wordlist *addrs);  static void set_allowed_addrs(int unit, struct wordlist *addrs);
127  static void free_wordlist (struct wordlist *);  static void free_wordlist (struct wordlist *);
128  #endif  #endif
# Line 476  void auth_reset(int unit) Line 476  void auth_reset(int unit)
476            
477      AUTHDEBUG((LOG_INFO, "auth_reset: %d\n", unit));      AUTHDEBUG((LOG_INFO, "auth_reset: %d\n", unit));
478      ao->neg_upap = !ppp_settings.refuse_pap && (ppp_settings.passwd[0] != 0 || get_pap_passwd(unit, NULL, NULL));      ao->neg_upap = !ppp_settings.refuse_pap && (ppp_settings.passwd[0] != 0 || get_pap_passwd(unit, NULL, NULL));
479      ao->neg_chap = !ppp_settings.refuse_chap && have_chap_secret(ppp_settings.user, ppp_settings.remote_name, (u32_t)0);      ao->neg_chap = !ppp_settings.refuse_chap && ppp_settings.passwd[0] != 0 /*have_chap_secret(ppp_settings.user, ppp_settings.remote_name, (u32_t)0)*/;
480            
481      if (go->neg_upap && !have_pap_secret())      if (go->neg_upap && !have_pap_secret())
482          go->neg_upap = 0;          go->neg_upap = 0;
# Line 605  int get_secret( Line 605  int get_secret(
605  )  )
606  {  {
607  #if 1  #if 1
608        int len;
609        struct wordlist *addrs;
610        
611        addrs = NULL;
612    
613        if(!client || !client[0] && strcmp(client, ppp_settings.user)) {
614          return 0;          return 0;
615        }
616    
617        len = strlen(ppp_settings.passwd);
618        if (len > MAXSECRETLEN) {
619            ppp_trace(LOG_ERR, "Secret for %s on %s is too long\n", client, server);
620            len = MAXSECRETLEN;
621        }
622        BCOPY(ppp_settings.passwd, secret, len);
623        *secret_len = len;
624        
625        return 1;
626  #else  #else
627      int ret = 0, len;      int ret = 0, len;
628      struct wordlist *addrs;      struct wordlist *addrs;
# Line 841  static int have_chap_secret(char *client Line 858  static int have_chap_secret(char *client
858  }  }
859    
860    
861  #if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0  #if 0 /* PAP_SUPPORT > 0 || CHAP_SUPPORT > 0 */
862  /*  /*
863   * set_allowed_addrs() - set the list of allowed addresses.   * set_allowed_addrs() - set the list of allowed addresses.
864   */   */
# Line 891  static int ip_addr_check(u32_t addr, str Line 908  static int ip_addr_check(u32_t addr, str
908      return 1;      return 1;
909  }  }
910    
911  #if PAP_SUPPORT > 0 || CHAP_SUPPORT  #if 0 /* PAP_SUPPORT > 0 || CHAP_SUPPORT */
912  /*  /*
913   * free_wordlist - release memory allocated for a wordlist.   * free_wordlist - release memory allocated for a wordlist.
914   */   */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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