Module: kamailio Branch: master Commit: 6c09e816c33cde4bc1da62c7e4a04613daca986f URL: https://github.com/kamailio/kamailio/commit/6c09e816c33cde4bc1da62c7e4a04613daca986f
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2026-06-30T18:52:53+02:00 gcrypt: export hmac sha256 function to intermodule api --- Modified: src/modules/gcrypt/api.h Modified: src/modules/gcrypt/gcrypt_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/6c09e816c33cde4bc1da62c7e4a04613daca986f.diff Patch: https://github.com/kamailio/kamailio/commit/6c09e816c33cde4bc1da62c7e4a04613daca986f.patch --- diff --git a/src/modules/gcrypt/api.h b/src/modules/gcrypt/api.h index ac2d874abe5..53f643006cf 100644 --- a/src/modules/gcrypt/api.h +++ b/src/modules/gcrypt/api.h @@ -24,6 +24,7 @@ #include <stdint.h> +#include "../../core/str.h" #include "../../core/sr_module.h" typedef void *(*gcrypt_aes128_context_init_f)(uint8_t key[16]); @@ -32,6 +33,8 @@ typedef int (*gcrypt_aes128_encrypt_f)( void *context, uint8_t *input, uint8_t *output); typedef int (*gcrypt_aes128_decrypt_f)( void *context, uint8_t *input, uint8_t *output); +typedef int (*gcrypt_hmac_sha256_f)(str *ins, str *key, str *outs); +int ksr_gcrypt_hmac_sha256_compute(str *ins, str *key, str *outs); typedef struct gcrypt_api { @@ -39,6 +42,7 @@ typedef struct gcrypt_api gcrypt_aes128_context_destroy_f aes128_context_destroy; gcrypt_aes128_encrypt_f aes128_encrypt; gcrypt_aes128_decrypt_f aes128_decrypt; + gcrypt_hmac_sha256_f hmac_sha256; } gcrypt_api_t; typedef int (*bind_gcrypt_f)(gcrypt_api_t *api); diff --git a/src/modules/gcrypt/gcrypt_mod.c b/src/modules/gcrypt/gcrypt_mod.c index d5efa4a542b..b7d1abb47d8 100644 --- a/src/modules/gcrypt/gcrypt_mod.c +++ b/src/modules/gcrypt/gcrypt_mod.c @@ -595,6 +595,7 @@ int bind_gcrypt(gcrypt_api_t *api) api->aes128_context_destroy = aes128_context_destroy; api->aes128_encrypt = aes128_encrypt; api->aes128_decrypt = aes128_decrypt; + api->hmac_sha256 = ksr_gcrypt_hmac_sha256_compute; return 0; } _______________________________________________ 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!
