mirror of
https://github.com/pine64/bl_iot_sdk.git
synced 2024-10-06 06:50:19 +00:00
commit
bc112954be
@ -1325,6 +1325,12 @@ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
|||||||
int fd;
|
int fd;
|
||||||
#endif /* USE_SRP */
|
#endif /* USE_SRP */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore requests if we're not open
|
||||||
|
*/
|
||||||
|
if (esp->es_client.ea_state <= eapClosed)
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: we update es_client.ea_id *only if* a Response
|
* Note: we update es_client.ea_id *only if* a Response
|
||||||
* message is being generated. Otherwise, we leave it the
|
* message is being generated. Otherwise, we leave it the
|
||||||
@ -1417,7 +1423,7 @@ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Not so likely to happen. */
|
/* Not so likely to happen. */
|
||||||
if (vallen >= len + sizeof (rhostname)) {
|
if (len - vallen >= sizeof (rhostname)) {
|
||||||
ppp_dbglog("EAP: trimming really long peer name down");
|
ppp_dbglog("EAP: trimming really long peer name down");
|
||||||
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
||||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||||
@ -1737,6 +1743,12 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
|||||||
u_char dig[SHA_DIGESTSIZE];
|
u_char dig[SHA_DIGESTSIZE];
|
||||||
#endif /* USE_SRP */
|
#endif /* USE_SRP */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore responses if we're not open
|
||||||
|
*/
|
||||||
|
if (esp->es_server.ea_state <= eapClosed)
|
||||||
|
return;
|
||||||
|
|
||||||
if (pcb->eap.es_server.ea_id != id) {
|
if (pcb->eap.es_server.ea_id != id) {
|
||||||
ppp_dbglog("EAP: discarding Response %d; expected ID %d", id,
|
ppp_dbglog("EAP: discarding Response %d; expected ID %d", id,
|
||||||
pcb->eap.es_server.ea_id);
|
pcb->eap.es_server.ea_id);
|
||||||
@ -1845,7 +1857,7 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Not so likely to happen. */
|
/* Not so likely to happen. */
|
||||||
if (vallen >= len + sizeof (rhostname)) {
|
if (len - vallen >= sizeof (rhostname)) {
|
||||||
ppp_dbglog("EAP: trimming really long peer name down");
|
ppp_dbglog("EAP: trimming really long peer name down");
|
||||||
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
||||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||||
@ -2043,6 +2055,12 @@ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
|||||||
static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
||||||
LWIP_UNUSED_ARG(id);
|
LWIP_UNUSED_ARG(id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore responses if we're not open
|
||||||
|
*/
|
||||||
|
if (esp->es_client.ea_state <= eapClosed)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!eap_client_active(pcb)) {
|
if (!eap_client_active(pcb)) {
|
||||||
ppp_dbglog("EAP unexpected failure message in state %s (%d)",
|
ppp_dbglog("EAP unexpected failure message in state %s (%d)",
|
||||||
eap_state_name(pcb->eap.es_client.ea_state),
|
eap_state_name(pcb->eap.es_client.ea_state),
|
||||||
|
Loading…
Reference in New Issue
Block a user