Module: kamailio
Branch: 5.7
Commit: 449155221586294d716e760fbabbd4e101ad1be2
URL:
https://github.com/kamailio/kamailio/commit/449155221586294d716e760fbabbd4e…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-01-15T21:34:46+08:00
outbound: update to OpenSSL 3 API
(cherry-pick from fe5c7125c66e37d2db032a63328ad713738a4b0c)
---
Modified: src/modules/outbound/outbound_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/449155221586294d716e760fbabbd4e…
Patch:
https://github.com/kamailio/kamailio/commit/449155221586294d716e760fbabbd4e…
---
diff --git a/src/modules/outbound/outbound_mod.c b/src/modules/outbound/outbound_mod.c
index 32f10f6cdb9..e2e3a86a73b 100644
--- a/src/modules/outbound/outbound_mod.c
+++ b/src/modules/outbound/outbound_mod.c
@@ -79,8 +79,13 @@ static void *mod_init_openssl(void *arg) {
if(flow_token_secret.s) {
assert(ob_key.len == SHA_DIGEST_LENGTH);
LM_DBG("flow_token_secret mod param set. use persistent ob_key");
+#if OPENSSL_VERSION_NUMBER < 0x030000000L
SHA1((const unsigned char *)flow_token_secret.s, flow_token_secret.len,
(unsigned char *)ob_key.s);
+#else
+ EVP_Q_digest(NULL, "SHA1", NULL, flow_token_secret.s,
+ flow_token_secret.len, (unsigned char *)ob_key.s, NULL);
+#endif
} else {
if(RAND_bytes((unsigned char *)ob_key.s, ob_key.len) == 0) {
LM_ERR("unable to get %d cryptographically strong pseudo-"