[sr-dev] git:master: modules/pv: added pseudo-variable ($aa) for access to algorithm in autorization header

Jason Penton jason.penton at gmail.com
Wed Sep 3 20:02:50 CEST 2014


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

Author: Jason Penton <jason.penton at gmail.com>
Committer: Jason Penton <jason.penton at gmail.com>
Date:   Wed Sep  3 19:57:22 2014 +0200

modules/pv: added pseudo-variable ($aa) for access to algorithm in autorization header

---

 modules/pv/pv.c      |    3 +++
 modules/pv/pv_core.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/pv/pv.c b/modules/pv/pv.c
index 8488b67..02726e2 100644
--- a/modules/pv/pv.c
+++ b/modules/pv/pv.c
@@ -115,6 +115,9 @@ static pv_export_t mod_pvs[] = {
 	{{"aU", (sizeof("aU")-1)}, /* */
 		PVT_OTHER, pv_get_authattr, 0,
 		0, 0, pv_init_iname, 5},
+	{{"aa", (sizeof("aa")-1)}, /* auth algorithm */
+		PVT_OTHER, pv_get_authattr, 0,
+		0, 0, pv_init_iname, 6},	
 	{{"Au", (sizeof("Au")-1)}, /* */
 		PVT_OTHER, pv_get_acc_username, 0,
 		0, 0, pv_init_iname, 1},
diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
index d41a399..c0943e8 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -1242,6 +1242,9 @@ int pv_get_authattr(struct sip_msg *msg, pv_param_t *param,
 	}
 	switch(param->pvn.u.isname.name.n)
 	{
+		case 6:
+			return pv_get_strval(msg, param, res,
+					&((auth_body_t*)(hdr->parsed))->digest.alg.alg_str);
 		case 4:
 			return pv_get_strval(msg, param, res,
 					&((auth_body_t*)(hdr->parsed))->digest.username.domain);




More information about the sr-dev mailing list