Hi. <br><br>I was using wpa supplicant normally in my work, authenticating with TTLS/Mschapv2. <br>I changed wpasupplicant code to work as a class, creating a function interface where I send a Eap packet as parameter and the class return another Eap packet as response.<br>
To do this I used&nbsp; the GIT code: <a href="http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=tree">http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=tree</a>&nbsp; , changing some parts of the code based on my needs.<br><br>All is working fine, but something is very strange about the certificates.<br>
<br>In eap_example_peer.c the certificates are load as following:<br><br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.identity = (u8 *) os_strdup(&quot;user&quot;);<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.identity_len = 4;<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.password = (u8 *) os_strdup(&quot;password&quot;);<br>
&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.password_len = 8;<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.ca_cert = (u8 *) os_strdup(&quot;ca.pem&quot;);<br><br>In eap_example_server.c are loaded as:<br><br>&nbsp;&nbsp;&nbsp; tparams.ca_cert = &quot;ca.pem&quot;;<br>&nbsp;&nbsp;&nbsp; tparams.client_cert = &quot;server.pem&quot;;<br>
&nbsp;&nbsp;&nbsp; tparams.private_key = &quot;server.key&quot;;<br>&nbsp;&nbsp;&nbsp; tparams.private_key_passwd = &quot;whatever&quot;;<br><br>This someway works. Then I changed the code to point to my certs:<br><br>&nbsp;&nbsp;&nbsp; peer:<br><br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.identity = (u8 *) os_strdup(&quot;user&quot;);<br>
&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.identity_len = 4;<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.password = (u8 *) os_strdup(&quot;password&quot;);<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.password_len = 8;<br>&nbsp;&nbsp;&nbsp; eap_ctx.eap_config.ca_cert = (u8 *) os_strdup(&quot;/home/douglas/DougTesteWPA/certificates/cacert.pem&quot;);<br>
<br>&nbsp;&nbsp; server:<br><br>&nbsp;&nbsp;&nbsp; tparams.ca_cert = &quot;/home/douglas/DougTesteWPA/certificates/cacert.pem&quot;;<br>&nbsp;&nbsp;&nbsp; tparams.client_cert = &quot;/home/douglas/DougTesteWPA/certificates/server_keycert.pem&quot;;<br>&nbsp;&nbsp;&nbsp; tparams.private_key = &quot;/home/douglas/DougTesteWPA/certificates/server_keycert.pem&quot;;<br>
&nbsp;&nbsp;&nbsp; tparams.private_key_passwd = &quot;doug&quot;;<br><br>This also works, but the strange is:<br><br>1-)&nbsp; I can change private_key_passwd to any password and the authentication still works!!!&nbsp; This password must be the same used to create the cacert, right?<br>
<br>2-) I can change the server cacert to any other cacert and the authentication still works!!! In TLS/TTLS all Ca&#39;s must be the same, right?<br><br>If I change server cert/key or the client ca, the authentication fails. Its seems that I only must have the client cacert and the server cert/key (derived from the client cacert) to authentication works. Then its seems that server cacert and private_key_passwd are not necessary. <br>
The strange is that authentication works. The phase 2 is working normally. If I change the mschapv2 user/password from server or client, authentication fails. Then all is ok. <br><br>Someone knows what is happening?<br><br>
Thanks....<br><br>