Skip to content

Commit

Permalink
Allow compact form of the PASSporT in the Identity header field
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Sep 2, 2021
1 parent afa7ebb commit 0029b8b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libsofia-sip-ua/sip/sip_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,7 @@ issize_t sip_identity_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)

if (p) {
ie = strchr(p, ';');
if (!ie) ie = strchr(p, '\0');
pp = strchr(p, '<');
ppp = strchr(p, '>');

Expand All @@ -2893,8 +2894,6 @@ issize_t sip_identity_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
alg = strchr(alg, ';');
if (alg) {
*alg = '\0';
} else {
id->id_info_alg = NULL;
}
}

Expand Down Expand Up @@ -2926,23 +2925,21 @@ issize_t sip_identity_e(char b[], isize_t bsiz, sip_header_t const *h, int flags

if (id->id_signed_identity_digest) {
MSG_STRING_E(b, end, id->id_signed_identity_digest);
MSG_CHAR_E(b, end, ';');
}

if (id->id_info) {
MSG_STRING_E(b, end, "info=<");
MSG_STRING_E(b, end, ";info=<");
MSG_STRING_E(b, end, id->id_info);
MSG_STRING_E(b, end, ">;");
MSG_STRING_E(b, end, ">");
}

if (id->id_info_alg) {
MSG_STRING_E(b, end, "alg=");
MSG_STRING_E(b, end, ";alg=");
MSG_STRING_E(b, end, id->id_info_alg);
MSG_CHAR_E(b, end, ';');
}

if (id->id_info_ppt) {
MSG_STRING_E(b, end, "ppt=");
MSG_STRING_E(b, end, ";ppt=");
MSG_STRING_E(b, end, id->id_info_ppt);
/* No need to put ';' as following MSG_PARAMS_E starts from ';' */
}
Expand Down

0 comments on commit 0029b8b

Please sign in to comment.