]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_stir_shaken: Fix JSON field ordering and disallowed TN characters.
authorNaveen Albert <asterisk@phreaknet.org>
Fri, 17 Feb 2023 13:45:16 +0000 (13:45 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 10 Apr 2023 22:31:07 +0000 (17:31 -0500)
commit0119f3ad48654a27a811cf4ee5b0cbd1b52480c0
tree9ce44b8ace7d4bdba3edbaa60fb6fd89142246fc
parentecf49ff7464f62ed1f8b2c7f8c3d340d88eca3ad
res_pjsip_stir_shaken: Fix JSON field ordering and disallowed TN characters.

The current STIR/SHAKEN signing process is inconsistent with the
RFCs in a couple ways that can cause interoperability issues.

RFC8225 specifies that the keys must be ordered lexicographically, but
currently the fields are simply ordered according to the order
in which they were added to the JSON object, which is not
compliant with the RFC and can cause issues with some carriers.

To fix this, we now leverage libjansson's ability to dump a JSON
object sorted by key value, yielding the correct field ordering.

Additionally, telephone numbers must have any leading + prefix removed
and must not contain characters outside of 0-9, *, and # in order
to comply with the RFCs. Numbers are now properly formatted as such.

ASTERISK-30407 #close

Change-Id: Iab76d39447c4b8cf133de85657dba02fda07f9a2
include/asterisk/json.h
main/json.c
res/ari/cli.c
res/res_pjsip_stir_shaken.c
res/res_stir_shaken.c