How to set values of authentication quintuplets received in a REST response from the AuC

amine mustapha smaali amine_mustapha at hotmail.com
Tue Feb 15 09:09:42 UTC 2022


Hi Arran,

Thanks a lot for your great support. Your proposal worked for me.

Thanks again and BRs,
Amine

________________________________
From: Freeradius-Users <freeradius-users-bounces+amine_mustapha=hotmail.com at lists.freeradius.org> on behalf of Arran Cudbard-Bell <a.cudbardb at freeradius.org>
Sent: Tuesday, February 15, 2022 01:26
To: FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Subject: Re: How to set values of authentication quintuplets received in a REST response from the AuC


> Now I'm struggling to find a solution for the following issues:
>
>  *   How can I send the %{Calling-Station-ID} parameter in json data from eap-aka-sim site

Sorry master is still under development, using foreign attributes in a nested request doesn't work well yet.

For now, at the top of the recv Access-Request section of the default virtual server add:

update request {
    &Tmp-String-0 := &Calling-Station-ID
    &Tmp-String-1 := &Called-Station-ID
}

Then in your rest expansion you can access Calling-Station-ID with %{outer.Tmp-String-0}, and Called-Station-Id with %{outer.Tmp-String-1}.

>  *   How can I convert the string data I received in 200 OK to hex value (e.g _RAND=​"11111111111111111111111111111111" to RAND=0x11111111111111111111111111111111)

In your original example you omitted control, and I omitted it in mine, but it is required for the code to work.

For converting hex to bin (which is what I'm assuming you want despite asking for the opposite) assign _RAND to Tmp-String-0 or another temporary attribute, and then after the map section:

send Challenge-Request {
        map json "%(rest:POST http://172.26.111.160/rest/hss/wlan/getAuthenticationVector/%{session-state.Permanent-Identity)" {
                  &control.AUTN := '$._AUTN'
                 &control.CK := '$._CK'
                  &control.IK := '$._IK'
           &control.XRES := '$._XRES'
           &control.Tmp-String-0 := '$._RAND'
        }

        update control {
                &RAND := %{bin:%{Tmp-String-0}}
        }
}

-Arran


More information about the Freeradius-Users mailing list