Module: kamailio
Branch: master
Commit: 7a65b3ce11a3afc0f5be47f61235166cb8938c78
URL: 
https://github.com/kamailio/kamailio/commit/7a65b3ce11a3afc0f5be47f61235166cb8938c78

Author: Gustavo Almeida <gustavo.abc...@hotmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-02-14T12:39:50+01:00

ims_auth: Fix CentOS 7 Build

- ims_auth: Fix non C99 compliant code

---

Modified: src/modules/ims_auth/auth_vector.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7a65b3ce11a3afc0f5be47f61235166cb8938c78.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7a65b3ce11a3afc0f5be47f61235166cb8938c78.patch

---

diff --git a/src/modules/ims_auth/auth_vector.c 
b/src/modules/ims_auth/auth_vector.c
index 19fbad91409..26acf36a8da 100644
--- a/src/modules/ims_auth/auth_vector.c
+++ b/src/modules/ims_auth/auth_vector.c
@@ -40,6 +40,8 @@ auth_vector *auth_vector_make_local(uint8_t k[16], uint8_t 
op[16], int opIsOPc,
        uint8_t ak[6];
        uint8_t authenticate[16 + 6 + 2 + 8];
 
+       int i = 0;
+
        // f0 - generate random
        f0(rand);
 
@@ -58,7 +60,7 @@ auth_vector *auth_vector_make_local(uint8_t k[16], uint8_t 
op[16], int opIsOPc,
        // AUTN = SQN ^ AK || AMF || MAC-A
        // Authenticate = RAND || AUTN
        memcpy(authenticate, rand, 16);
-       for(int i = 0; i < 6; i++)
+       for(i = 0; i < 6; i++)
                authenticate[16 + i] = sqn[i] ^ ak[i];
        memcpy(authenticate + 22, amf, 2);
        memcpy(authenticate + 24, mac_a, 8);
@@ -90,6 +92,8 @@ int auth_vector_resync_local(uint8_t sqnMSout[6], auth_vector 
*av,
        uint8_t mac_s[8];
        uint8_t xmac_s[8];
 
+       int i = 0;
+
        if(!av->is_locally_generated) {
                LM_ERR("auth_vector is not locally generated - let the HSS 
handle "
                           "resync\n");
@@ -114,7 +118,6 @@ int auth_vector_resync_local(uint8_t sqnMSout[6], 
auth_vector *av,
        f5star(ak, k, op_c, rand);
 
        // Unpack the AUTS = (SQN_MS ^ AK) || MAC-S
-       int i = 0;
        for(i = 0; i < 6; i++)
                sqnMS[i] = auts[i] ^ ak[i];
        memcpy(mac_s, auts + 6, 8);

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to