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 |
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; |
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; |
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 |
*/ |
*/ |
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 |
*/ |
*/ |