-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[defect]: RLM_REST JSON body for octets values #5285
Comments
I suspect it's better to use hex encoding. But the problem there is that json doesn't have data types. So hex strings will still need to be double quoted. |
yes, but now JSON contains unexpected characters in the string and JSON is not valid |
OK. So octets is preferable. |
Shouldn't be presented as hex, it's using JSON escape sequences. Maybe some chars aren't being handled correctly? |
Hex really isn't correct. If you use json escape sequences the string you get out of the json decoder is the binary data. If you use hex/base64 there's a manual step for decoding. |
Checking v4, we now use the json-c functions. So this is very likely to be <= v3.2 only |
@levide could you check this change works? |
@arr2036 sorry, I forgot to say that this is in master branch attr value in urlencode: 0xf44007d40000000395169ad1 |
In that case you want to raise your bug report against json-c, and request they escape chars > 0x7E, or better, implement UTF8 char detection: freeradius-server/src/lib/util/print.c Line 39 in 45f465b
https://github.com/json-c/json-c/blob/dabed80523fa5101e30f0ee57ba06b02beae73eb/json_object.c#L233 |
Hi, I encounter the same issue on docker freeradius-3.2-alpine latest. |
@ntikhoa You might be looking at the wrong data. Since your output uses single quotes, this is not the original JSON input, JSON requires double quote. My guess is that your EAP-Message originally was "\x02\xe6\x00\x06\x0d\x00", and something in your output decided to interpret that as UTF8 instead of binary (or possibly a different encoding). I think the easiest way to validate would to use |
What type of defect/bug is this?
Unexpected behaviour (obvious or verified by project member)
How can the issue be reproduced?
In
https://github.com/FreeRADIUS/freeradius-server/blob/be1ec67a48e4cb7769f8ae55760d5b5ba33c1a13/src/lib/json/json.c#L222C7-L222C21
present as string and in request render as
"State":{"type":"octets","value":["?@\u0007?\u0000\u0000\u0000\u0003?\u0016??"]},
maybee need to present octets values in JSON as HEX?
Log output from the FreeRADIUS daemon
Relevant log output from client utilities
No response
Backtrace from LLDB or GDB
No response
The text was updated successfully, but these errors were encountered: