<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Tobias,</div><div><br></div><div>Finally, I was able to find the root cause. There is a bug in the eap-aka-3gpp plugin implementation regarding updating of SQN. Currently, strongswan increments the SQN number, which it receives from UE. However, based on [1] the SQN (32 bits) is composed of two elements: SEQ + IND. SEQ is the actual sequence indicator, while IND is some kind of the index and normally it occupies 5 bits. Thus, SQN should be updated with the value of SQN + 32 (32 = 2 ^ sizeof(IND)). The nice visualisation of this process is shown in [2]. <br><br>Once I have modified the eap-aka-3gpp code it works perfectly with commercial Samsung UE.<br><br></div><div>If you are interested I can prepare a fix for eap-aka-3gpp. <br></div><div><br>[1] 3GPP TS. 33.102<br>[2] <a href="https://diameter-protocol.blogspot.com/2013/06/umts-3g-utran-authentication-procedure.html">https://diameter-protocol.blogspot.com/2013/06/umts-3g-utran-authentication-procedure.html</a><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">śr., 24 kwi 2019 o 18:29 Tobias Brunner <<a href="mailto:tobias@strongswan.org">tobias@strongswan.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Tomek,<br>
<br>
> Thanks for your answer. The phone indicates the invalid value of SQN,<br>
> see the logs below:<br>
<br>
Check the implementation of resync() in your implementation of<br>
simaka_card_t (and whatever it actually calls/does) for details on this.<br>
 That it initially fails could be due to how the SQNs are generated.<br>
<br>
> Do you think<br>
> that the EPDG (strongswan) have been resynchronized?<br>
<br>
Initially probably not if the SQNs are generated differently.  But after<br>
the client sent its SQN and the server used that (+1) the client should<br>
be happy with it.  If not, something might be wrong (e.g. incorrect<br>
secrets).<br>
<br>
> And because of<br>
> time-based SQN generation it generates the invalid SQN?<br>
<br>
You have to check the client implementation for what it considers<br>
invalid.  In particular after it sent the SQN and then still does not<br>
like what it gets back.<br>
<br>
Regard,<br>
Tobias<br>
</blockquote></div>