json encoding (Freeradius 3.0.13)

Durand fabrice fdurand at inverse.ca
Wed Nov 23 00:10:06 CET 2016


Thanks for the commit Alan, i will make a try and let you know.

Regard

Fabrice



Le 2016-11-22 à 16:27, Alan DeKok a écrit :
> On Nov 22, 2016, at 3:39 PM, Fabrice Durand <fdurand at inverse.ca> wrote:
>> i am trying to implement cisco Device sensor
>> (http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750/software/release/15-0_1_se/device_sensor/guide/sensor_guide.html)
>> that allow to have endpoint data like DHCP, LLDP in the radius
>> accounting packet.
>>
>> I am able to receive these specific attributes but when i want to send
>> them to my api (PacketFence) through rlm_rest module , it looks that
>> these attributes are not well encoded.
>>
>> You can see in the raddebug trace this attribute Cisco-AVPair =
>> "dhcp-option=\0007\000\r\001\017\003\006,./\037!y\371\374+" received
>> from the cisco switch which is encoded to that
>> "dhcp-option=\u00007\u0000\r\u0001\u000F\u0003\u0006,.\/\u001F!y\uFFFFFFF9\uFFFFFFFC+"
>    The json spec says that binary data is \uXXXX where "XXXX" is 4 hex digits.  So the above *mostly* looks OK.  Except for the FFFFF issue... which is a sign problem.
>
>    Fixing that should be as simple as making the data unsigned...
>
>> and i am not able to decode it.
>>
>> On my side i did some test with a perl json encoding code and the
>> encoding string is suppose to be
>> \\0007\\000\\r\\001\\017\\003\\006,.\/\\037!y\\371\\374+
>    Which doesn't follow the json spec.
>
>    Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



More information about the Freeradius-Users mailing list