Module: kamailio
Branch: master
Commit: 4fb835e7aa5b0a8ef7a40ce4f30001014bace0cb
URL: 
https://github.com/kamailio/kamailio/commit/4fb835e7aa5b0a8ef7a40ce4f30001014bace0cb

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-06-29T11:29:44+02:00

gcrypt: hex conversion for uuid generation

---

Modified: src/modules/gcrypt/gcrypt_uuid.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/4fb835e7aa5b0a8ef7a40ce4f30001014bace0cb.diff
Patch: 
https://github.com/kamailio/kamailio/commit/4fb835e7aa5b0a8ef7a40ce4f30001014bace0cb.patch

---

diff --git a/src/modules/gcrypt/gcrypt_uuid.c b/src/modules/gcrypt/gcrypt_uuid.c
index 1d4f56712e8..097c9097f06 100644
--- a/src/modules/gcrypt/gcrypt_uuid.c
+++ b/src/modules/gcrypt/gcrypt_uuid.c
@@ -68,7 +68,7 @@ static inline int gcrypt_bytes2hex(
        if(sbuf_len < 2 * buf_len)
                return -1;
        for(i = 0, j = (2 * buf_len) - 1; i < sbuf_len; i++, j--) {
-               sbuf[i] = gcrypt_byte2hex((buf[j / 2] >> (j % 2 ? 0 : 4)) % 
0x0f);
+               sbuf[i] = gcrypt_byte2hex((buf[j / 2] >> (j % 2 ? 0 : 4)) & 
0x0f);
                if(j == 0)
                        break;
        }
@@ -120,7 +120,7 @@ static inline int gcrypt_format_rfc4122_uuid(
                        sbuf[i] = '-';
                        continue;
                }
-               sbuf[i] = gcrypt_byte2hex((buf[j / 2] >> (j % 2 ? 0 : 4)) % 
0x0f);
+               sbuf[i] = gcrypt_byte2hex((buf[j / 2] >> (j % 2 ? 0 : 4)) & 
0x0f);
                if(!(++j / 2 < buf_len))
                        break;
        }

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to