Module: kamailio
Branch: master
Commit: 6364e05c8f3108d0bd4943b20448a096e126aec7
URL: 
https://github.com/kamailio/kamailio/commit/6364e05c8f3108d0bd4943b20448a096e126aec7

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-06-30T10:17:34+02:00

crypto: export hmac sha256 to intermodule api

---

Modified: src/modules/crypto/api.c
Modified: src/modules/crypto/api.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/6364e05c8f3108d0bd4943b20448a096e126aec7.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6364e05c8f3108d0bd4943b20448a096e126aec7.patch

---

diff --git a/src/modules/crypto/api.c b/src/modules/crypto/api.c
index 4c4f6bb15ba..9f038074208 100644
--- a/src/modules/crypto/api.c
+++ b/src/modules/crypto/api.c
@@ -27,6 +27,7 @@
 int load_crypto(struct crypto_binds *cb)
 {
        cb->SHA1 = crypto_generate_SHA1;
+       cb->hmac_sha256 = ksr_crypto_hmac_sha256_compute;
 
        return 1;
 }
diff --git a/src/modules/crypto/api.h b/src/modules/crypto/api.h
index 6fd2c0756b8..2ae9e5c20e1 100644
--- a/src/modules/crypto/api.h
+++ b/src/modules/crypto/api.h
@@ -28,9 +28,13 @@
 
 typedef int (*SHA1_hash_f)(str *, str *);
 
+typedef int (*hmac_sha256_f)(str *, str *, str *);
+int ksr_crypto_hmac_sha256_compute(str *ins, str *key, str *outs);
+
 typedef struct crypto_binds
 {
        SHA1_hash_f SHA1;
+       hmac_sha256_f hmac_sha256;
 } crypto_api_t;
 
 

_______________________________________________
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