Browse Source

outbound: update to OpenSSL 3 API

(cherry-pick from fe5c7125c66e37d2db032a63328ad713738a4b0c)
S-P Chan 1 year ago
parent
commit
4491552215
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/modules/outbound/outbound_mod.c

+ 5 - 0
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-"