Kaynağa Gözat

auth: skip processing of PRACK in consume_credentials()

- report and patch suggestions by Jorj Bauer
Daniel-Constantin Mierla 12 yıl önce
ebeveyn
işleme
2a77ed2bdc
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      modules/auth/auth_mod.c

+ 5 - 5
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;
 		}
     }