[sr-dev] git:master: auth: skip processing of PRACK in consume_credentials()

Daniel-Constantin Mierla miconda at gmail.com
Sun Apr 14 10:15:50 CEST 2013


Module: sip-router
Branch: master
Commit: 2a77ed2bdc9341ecf7d7200e420a1f49e4e9b6ab
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2a77ed2bdc9341ecf7d7200e420a1f49e4e9b6ab

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Apr 14 10:11:29 2013 +0200

auth: skip processing of PRACK in consume_credentials()

- report and patch suggestions by Jorj Bauer

---

 modules/auth/auth_mod.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/auth/auth_mod.c b/modules/auth/auth_mod.c
index 861f92f..cdfe459 100644
--- a/modules/auth/auth_mod.c
+++ b/modules/auth/auth_mod.c
@@ -397,16 +397,16 @@ int consume_credentials(struct sip_msg* msg)
 {
     struct hdr_field* h;
     int len;
-    
+
+	/* skip requests that can't be authenticated */
+	if (msg->REQ_METHOD & (METHOD_ACK|METHOD_CANCEL|METHOD_PRACK))
+		return -1;
     get_authorized_cred(msg->authorization, &h);
     if (!h) {
 		get_authorized_cred(msg->proxy_auth, &h);
 		if (!h) { 
-			if (msg->REQ_METHOD != METHOD_ACK 
-				&& msg->REQ_METHOD != METHOD_CANCEL) {
-				LOG(L_ERR, "auth:consume_credentials: No authorized "
+			LOG(L_ERR, "auth:consume_credentials: No authorized "
 					"credentials found (error in scripts)\n");
-			}
 			return -1;
 		}
     }




More information about the sr-dev mailing list