[Asterisk-code-review] res_pjsip_stir_shaken.c: Fix enabled when not configured. (asterisk[16])

Benjamin Keith Ford asteriskteam at digium.com
Tue Apr 26 09:38:15 CDT 2022


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18414 )


Change subject: res_pjsip_stir_shaken.c: Fix enabled when not configured.
......................................................................

res_pjsip_stir_shaken.c: Fix enabled when not configured.

There was an issue with the conditional where STIR/SHAKEN would be
enabled even when not configured. It has been changed to ensure that if
a profile does not exist and stir_shaken is not set in pjsip.conf, then
the conditional will return from the function without performing
STIR/SHAKEN operations.

ASTERISK-30024

Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6
---
M res/res_pjsip_stir_shaken.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/14/18414/1

diff --git a/res/res_pjsip_stir_shaken.c b/res/res_pjsip_stir_shaken.c
index 0637a66..2bd9e94 100644
--- a/res/res_pjsip_stir_shaken.c
+++ b/res/res_pjsip_stir_shaken.c
@@ -229,7 +229,7 @@
 
 	profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile);
 	if ((profile && !ast_stir_shaken_profile_supports_verification(profile))
-		&& ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) {
+		|| (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) {
 		return 0;
 	}
 
@@ -482,7 +482,7 @@
 
 	profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile);
 	if ((profile && !ast_stir_shaken_profile_supports_attestation(profile))
-		&& ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) {
+		|| (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) {
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18414
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6
Gerrit-Change-Number: 18414
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220426/9f4a571d/attachment.html>


More information about the asterisk-code-review mailing list