ConnectivityFoundry / AwaLWM2M

Awa LWM2M is an implementation of the OMA Lightweight M2M protocol in C.
BSD 3-Clause "New" or "Revised" License
102 stars 66 forks source link

Static client fails on register if name uses '<' '>' characters. #343

Open thetoster opened 7 years ago

thetoster commented 7 years ago

Tried on contiki platform. If I set name to through AwaStaticClient_SetEndPointName then from contiki logs you get info about registered but calling awa-serverr-list-clients returns empty list. Removing '<', '>' characters make removes problem.

Checked on version 0.2.5

boyvinall commented 7 years ago

I'm guessing this might be more related to the IPC call for awa-server-list-clients than to the actual registration - did you test this against the deviceserver?

DavidAntliff commented 7 years ago

I suspect this is almost certainly due to using XML over IPC. The initial expectation was that endpoint names would only contain characters that can be specified in a CoAP URL (since it is used as a bootstrap parameter) however I don't think this is enforced. The endpoint name should be encoded/decoded over IPC to avoid reserved XML characters, and also encoded appropriately when used in the bootstrap URL.

thetoster commented 7 years ago

@boyvinall I didn't check with DS. No time to dig around this. @DavidAntliff I think you are right, when I tried to do awa-server-list-clients -o it crashes with some errors and NULLs. However I didn't copy those logs. I believe method AwaStaticClient_SetEndPointName should return some error if invalid name is passed, or it do some silent strip off wrong characters.