]> git.ozlabs.org Git - ppp.git/commitdiff
pppd/eap: Fix bug causing incorrect response length (#334)
authorEivind Næss <eivnaes@yahoo.com>
Thu, 3 Feb 2022 22:28:22 +0000 (14:28 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 22:28:22 +0000 (09:28 +1100)
Need to update the esp->ea_client.ea_namelen variable. A plugin can override the
name of the user, and the variable is passed onto the eap_chap2_response generating
the wrong response length.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
pppd/eap.c

index 54c3d42b85fe82edce41c3571e3a6af937b8dbae..6cb595f5b7c57b78cdd22ed790928535f4f29777 100644 (file)
@@ -2182,6 +2182,7 @@ eap_request(eap_state *esp, u_char *inp, int id, int len)
                    eap_send_nak(esp, id, EAPT_SRP);
                    break;
                }
+               esp->es_client.ea_namelen = strlen(esp->es_client.ea_name);
 
                /* Create the MSCHAPv2 response (and add to cache) */
                unsigned char response[MS_CHAP2_RESPONSE_LEN+1]; // VLEN + VALUE