]> 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 19:41:14 +0000 (14:41 -0500)
commit66a7cff57ecc4514c28071981037afa72ef0d4b9
tree4ff16bbd21b0e79a359526eb8a0b6a39f79da8df
parentb33f92cbb56fb848d2a0aaeb416b7cac4813f804
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