Module: kamailio
Branch: master
Commit: 3ef396813e7ff8a0b426a7a188bb01d7f34d814c
URL: 
https://github.com/kamailio/kamailio/commit/3ef396813e7ff8a0b426a7a188bb01d7f34d814c

Author: Federico Favaro <federico.fav...@athonet.com>
Committer: Federico Favaro <federico.fav...@athonet.com>
Date: 2016-09-29T10:15:12+02:00

ims_auth: Put fresh keys from HSS on top of list

If S-CSCF downloaded fresh keys from the HSS, put it
on the top of the list, as they are already been sent
to the UE via 401 message so it should be the first
to be retrived to comparison once REGISTER with challenge
comes from the UE

---

Modified: modules/ims_auth/authorize.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3ef396813e7ff8a0b426a7a188bb01d7f34d814c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3ef396813e7ff8a0b426a7a188bb01d7f34d814c.patch

---

diff --git a/modules/ims_auth/authorize.c b/modules/ims_auth/authorize.c
index 4facbb9..09c7137 100644
--- a/modules/ims_auth/authorize.c
+++ b/modules/ims_auth/authorize.c
@@ -1689,12 +1689,13 @@ int add_auth_vector(str private_identity, str 
public_identity, auth_vector * av)
         private_identity.len, private_identity.s, aud->hash);
 
 
-    av->prev = aud->tail;
-    av->next = 0;
+    av->prev = 0;
+    if (aud->head) {
+        av->next = aud->head;
+        aud->head->prev = av;
+    }
 
-    if (!aud->head) aud->head = av;
-    if (aud->tail) aud->tail->next = av;
-    aud->tail = av;
+    aud->head = av;
 
     auth_data_unlock(aud->hash);
     return 1;


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to