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

Arran Cudbard-Bell a.cudbardb at freeradius.org
Tue Feb 15 00:26:09 UTC 2022


> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20220214/27a17233/attachment.sig>


More information about the Freeradius-Users mailing list