wakaama icon indicating copy to clipboard operation
wakaama copied to clipboard

Fix - Changed encoding from Base64 (with padding) to Base64URL (no padding) for SenML JSON format

Open parmi93 opened this issue 1 year ago • 3 comments

According to the SenML JSON specification defined at RFC8428§4.3- SenML Labels the Base64 URL safe alphabet must be used (without padding) for Data Value vd:

(*) Data Value is a base64-encoded string with the URL-safe alphabet as defined in Section 5 of [RFC4648], with padding omitted. (In CBOR, the octets in the Data Value are encoded using a definite-length byte string, major type 2.)

So, encoding and decoding has been changed from Base64 (with padding) to Base64Url (without padding) for data over SenML JSON format.

Note that the behavior of the code in data/json.c has not changed, data in JSON format will continue to be encoded in Base64 (with padding), see eclipse/leshan#1444 (comment).

New tests has been added in order to test the Base64Url (without padding) encode and decode functions, and the previous tests have been modified by adding a new entry to be tested.

Fix: https://github.com/eclipse/wakaama/issues/698 also see: https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/553

parmi93 avatar Jun 13 '23 12:06 parmi93

Fixed the commit message according to the rules.

parmi93 avatar Jun 16 '23 10:06 parmi93

Removed the history of commits, in order to be able to resolve errors related to commit messages that did not respect the rules.

parmi93 avatar Jun 16 '23 13:06 parmi93

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

sonarqubecloud[bot] avatar May 28 '24 16:05 sonarqubecloud[bot]