Re: [EXTERNAL] Help in Configuring EAP-SIM
Hi Arran, Thanks for your response. For the purposes of testing, we have a sim client that will be using Comp128 versions 1 through 3, and we will want to test EAP-SIM with each of those algorithms. Regarding my original question, is there a misunderstanding on my part for how to set the SIM-Algo-Version on Freeradius? It appears that explicitly setting it vs not makes a difference. Thanks, Shane ________________________________ From: Arran Cudbard-Bell Sent: Monday, February 14, 2022 3:25 PM To: FreeRadius users mailing list Cc: Shane Guan; Davut Karabay; Corbin Phipps; Paul Irwin Subject: Re: [EXTERNAL] Help in Configuring EAP-SIM
On Feb 11, 2022, at 7:28 PM, Shane Guan via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Hi everyone,
Thanks for the quick fix in master. I pulled the newest changes and rebuilt the freeradius binary. I noticed that if I do not explicitly set the SIM-Algo-Version, thus leaving it to the default of 1, then eapol_test client is able to authenticate (*default.log). However, when I do explictely set the SIM-Algo-Version to 1, then eapol_test is unable to authenticate, stating a MAC invalidation (*explicit_set_1.log). Can someone help me understand why this would be the case, when I am merely explicitly setting a variable to its default, instead of leaving it alone? Perhaps I misunderstood what the purpose of SIM-Algo-Version is.
Sim-Algo-Version controls the algorithm FreeRADIUS uses to produce vectors for consumption by the EAP code. You need the same algorithm in use by FreeRADIUS and by your SIM card so that, given the same random value and Ki, both FreeRADIUS and the SIM produce the same AUTN, CK, IK and XRES values. You likely have a usim in which case it'll probably be using milenage, so you'll want algo 4. 1, 2, 3 refer to the Comp128v1/v2/v3 algorithms. Normally in a proper HLR this information would be recorded against the IMSI of the SIM. -Arran
Hi Shane,
Thanks for your response. For the purposes of testing, we have a sim client that will be using Comp128 versions 1 through 3, and we will want to test EAP-SIM with each of those algorithms. Regarding my original question, is there a misunderstanding on my part for how to set the SIM-Algo-Version on Freeradius?
No you're doing it correctly.
It appears that explicitly setting it vs not makes a difference.
Well you're contradicting yourself here. Previously you said setting it would cause authentication to fail... Which it would. Looking at your eapol test logs, eapol_test is using its internal milenage implementation not an external SIM card: EAP-SIM: GSM authentication algorithm EAP-SIM: Use internal GSM-Milenage implementation for authentication EAP-SIM: RAND - hexdump(len=16): c6 fe 5b 5c 48 28 da 45 ef 30 9d 49 ad f4 94 4f EAP-SIM: SRES - hexdump(len=4): ca 4f dd 0e EAP-SIM: Kc - hexdump(len=8): 53 16 4c cf c9 a6 a3 4f EAP-SIM: RAND - hexdump(len=16): fc d3 32 aa a9 0a 11 73 e7 6d 61 d1 d7 00 50 61 EAP-SIM: SRES - hexdump(len=4): 58 71 33 e8 EAP-SIM: Kc - hexdump(len=8): 37 ea fd eb 69 75 bc dc EAP-SIM: RAND - hexdump(len=16): 19 a1 2a 54 b3 6c 79 ec b3 4b 2f 79 88 14 67 6f EAP-SIM: SRES - hexdump(len=4): b4 8c e1 f7 EAP-SIM: Kc - hexdump(len=8): c8 74 d2 4c db 55 de 2f So yes, setting FreeRADIUS to use Comp128v1 when eapol_test is using milenage would cause authentication to fail. As I said previously, there's no negotiation of SIM algorithm, it's just stored against the IMSI in the HLR/AuC. That's not what the version negotiation at the start of EAP-SIM is doing. You need both sides to have been configured with the same algorithm. If you want to use eapol_test with an external SIM you need to compile eapol_test with smartcard reader support. There's examples on the internet of how to use a smartcard reader and SIM adaptor to do what you want. If you don't have the hardware the guys over at osmocom used to (and likely still do) sell adaptor cards. You could also submit patches for comp128v1/v2/v3 support to hostapd if they've not added it yet. The comp128v2/v3 algorithms were secret for a good number of years until someone decompiled a test utility and posted Python code online. I took the Python and rewrote it in C, and that's what's currently in the FreeRADIUS repo. Many projects do not have comp128v2/v3 support because the comp128v2/v3 algorithms were not available until relatively recently. Those that do likely did their own conversion of the original Python script, or lifted it from our repo. -Arran
participants (2)
-
Arran Cudbard-Bell -
Shane Guan