STIR/SHAKEN: Add Date header, dest->tn, and URL checking.

STIR/SHAKEN requires a Date header alongside the Identity header, so
that has been added. Still on the outgoing side, we were missing the
dest->tn section of the JSON payload, so that has been added as well.
Moving to the incoming side, URL checking has been added to the public
cert URL to ensure that it starts with http.

https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021

Change-Id: Idee5b1b5e45bc3b483b3070e46ce322dca5b3f1c
This commit is contained in:
Ben Ford
2021-05-19 13:45:16 -05:00
committed by Friendly Automation
parent 16e4a9d8cf
commit 26a38c4084
4 changed files with 89 additions and 26 deletions

View File

@@ -3285,6 +3285,18 @@ static pj_sockaddr host_ip_ipv6;
/*! Local host address for IPv6 (string form) */
static char host_ip_ipv6_string[PJ_INET6_ADDRSTRLEN];
void ast_sip_add_date_header(pjsip_tx_data *tdata)
{
char date[256];
struct tm tm;
time_t t = time(NULL);
gmtime_r(&t, &tm);
strftime(date, sizeof(date), "%a, %d %b %Y %T GMT", &tm);
ast_sip_add_header(tdata, "Date", date);
}
static int register_service(void *data)
{
pjsip_module **module = data;