PPP, CORE: code cleaning

This commit is contained in:
Sylvain Rochet 2015-02-28 18:08:37 +01:00
parent 5ae7ee5276
commit 708e421ec3

View File

@ -1008,8 +1008,8 @@ int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int
int secretpasswdlen; int secretpasswdlen;
if (pcb->settings.user && pcb->settings.passwd) { if (pcb->settings.user && pcb->settings.passwd) {
secretuserlen = strlen(pcb->settings.user); secretuserlen = (int)strlen(pcb->settings.user);
secretpasswdlen = strlen(pcb->settings.passwd); secretpasswdlen = (int)strlen(pcb->settings.passwd);
if (secretuserlen == userlen if (secretuserlen == userlen
&& secretpasswdlen == passwdlen && secretpasswdlen == passwdlen
&& !memcmp(auser, pcb->settings.user, userlen) && !memcmp(auser, pcb->settings.user, userlen)
@ -1898,7 +1898,6 @@ have_srp_secret(client, server, need_ip, lacks_ipp)
*/ */
int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server) { int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server) {
int len; int len;
LWIP_UNUSED_ARG(server); LWIP_UNUSED_ARG(server);
LWIP_UNUSED_ARG(am_server); LWIP_UNUSED_ARG(am_server);
@ -1914,20 +1913,9 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre
MEMCPY(secret, pcb->settings.passwd, len); MEMCPY(secret, pcb->settings.passwd, len);
*secret_len = len; *secret_len = len;
return 1; return 1;
/* FIXME: clean that */ #if 0 /* UNUSED */
#if 0
strlcpy(rname, ppp_settings.user, sizeof(rname));
/*
strlcpy(rname, ppp_settings.user, sizeof(rname));
strlcpy(secret, ppp_settings.passwd, sizeof(secret));
secret_len = strlen(secret);
*/
FILE *f; FILE *f;
int ret, len; int ret, len;
char *filename; char *filename;
@ -1979,7 +1967,7 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre
*secret_len = len; *secret_len = len;
return 1; return 1;
#endif #endif /* UNUSED */
} }
#endif /* PPP_AUTH_SUPPORT */ #endif /* PPP_AUTH_SUPPORT */