<div dir="ltr">Thanks Arend and Jouni for clarifying. <div><br></div><div>I do use an sqlite database connection to do this on the server! <div><br></div><div>Khali</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Aug 11, 2014 at 11:38 PM, Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Mon, Aug 11, 2014 at 11:27:23AM +0300, khali singh wrote:<br>
&gt; I use global variables at the top of the .C file containing my new EAP<br>
&gt; method. Is it possible that two connecting clients can write to each others<br>
&gt; data?<br>
<br>
</div>Yes. I would strongly discourage such design.<br>
<div class=""><br>
&gt; For example the C file contains a variable called as a global variable<br>
&gt; u8 sessid[17];<br>
&gt;<br>
&gt; Can two simultaneous clients cause a problem?<br>
<br>
</div>Yes. There is a reason why every EAP method implementation in hostap.git<br>
uses struct eap_*_data for per-session data.. There can be multiple<br>
concurrent instances of an EAP server method. While there is only a<br>
single thread running, that won&#39;t protect against this type of uses of<br>
global variables with multiple users being able to try to authenticate<br>
at the same time.<br>
<br>
That said, it should be noted that the EAP server methods do not have<br>
support for fast session resumption in a similar way to the EAP peer<br>
methods since they do not maintain any internal state between EAP<br>
sessions. The existing examples use either the TLS library to do this<br>
(EAP-TTLS/PEAP/TLS) or a separate component (EAP-SIM/AKA/AKA&#39; and<br>
eap_sim_db). The latter would likely be closer to what you are<br>
describing here.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jouni Malinen                                            PGP id EFC895FA<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</div></div></blockquote></div><br></div>