From 8b75904980f7f7669fe35676a4042e387e29f352 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 6 Jun 2016 11:03:10 +0200 Subject: [PATCH] ims_auth: fix compilation warnigns > cxdx_avp.c:661:26: warning: comparison of constant 4 with boolean expression is always false [-Wtautological-constant-out-of-range-compare] > if (!avp||!avp->data.len==4) *item_number=0; > ~~~~~~~~~~~~~~^ ~ > 1 warning generated. > cxdx_mar.c:372:45: warning: comparison of constant 32 with boolean expression is always false [-Wtautological-constant-out-of-range-compare] > if (!tmp->response_auth.len == 32 > ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~ --- modules/ims_auth/cxdx_avp.c | 2 +- modules/ims_auth/cxdx_mar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ims_auth/cxdx_avp.c b/modules/ims_auth/cxdx_avp.c index a09e6b24b22..bd4031c8406 100644 --- a/modules/ims_auth/cxdx_avp.c +++ b/modules/ims_auth/cxdx_avp.c @@ -658,7 +658,7 @@ int cxdx_get_auth_data_item_answer(AAAMessage *msg, AAA_AVP **auth_data, avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number, IMS_vendor_id_3GPP,0); - if (!avp||!avp->data.len==4) *item_number=0; + if (!avp||avp->data.len!=4) *item_number=0; else *item_number = get_4bytes(avp->data.s); avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme, diff --git a/modules/ims_auth/cxdx_mar.c b/modules/ims_auth/cxdx_mar.c index 1f81d0c340b..a949edd5e25 100644 --- a/modules/ims_auth/cxdx_mar.c +++ b/modules/ims_auth/cxdx_mar.c @@ -373,7 +373,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *maa, long elaps &scscf_name_str, 0, result_hex); pkg_free(etsi_nonce.s); - if (!tmp->response_auth.len == 32 + if (tmp->response_auth.len != 32 || strncasecmp(tmp->response_auth.s, result_hex, 32)) { LM_ERR("The HSS' Response-Auth is different from what we compute locally!\n" " BUT! If you sent an MAR with auth scheme unknown (HSS-Selected Authentication), this is normal.\n"