#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [x] Related to issue #3502
#### Description From https://www.openssl.org/docs/man3.0/man7/migration_guide.html
> Use of low-level digest functions such as SHA1_Init(3) have been informally > discouraged from use for a long time. Applications should instead use the > high level EVP APIs EVP_DigestInit_ex(3), EVP_DigestUpdate(3) and > EVP_DigestFinal_ex(3), or the quick one-shot EVP_Q_digest(3).
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3518
-- Commit Summary --
* crypto: SHA1_Init deprecated at openssl 3.0
-- File Changes --
M src/modules/crypto/crypto_uuid.c (19)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3518.patch https://github.com/kamailio/kamailio/pull/3518.diff
Thanks!
I wonder if it would work to have:
``` static EVP_MD_CTX crypto_ctx = {0}; ```
instead of:
``` EVP_MD_CTX *crypto_ctx = NULL; ```
And then get rid of using EVP_MD_CTX_new()/_free() functions. That makes it look very similar like the old variant.
I don't think that would fly looking into the definition of the structure... https://github.com/openssl/openssl/blob/7551264186f176ca5801aa84d60c7b91d8fb...
It may require to add `EVP_MD_CTX_reset()` ... anyhow, you can merge as it is and later when I get some time I can look a bit more at libssl and see if we can avoid use of new/free for each execution.
Merged #3518 into master.