Replies: 3 comments
-
(1) is also best matches how one typical applications use OpenSSL 1.1.1, and is more performant since you avoid making a dummy copy of the EVP_MD when you didn't need to. TBH you probably could just use that in 3.x too. While OpenSSL does say fetch is more performant, AIUI that's only if the application saves the EVP_MD to work around the various perf regressions in 3.x. |
Beta Was this translation helpful? Give feedback.
-
I agree solution 1 is the best way to go. |
Beta Was this translation helpful? Give feedback.
-
+1, that seems like the sensible way forward. As @davidben suggests, that could also let us drop the EVP_MD_fetch() call. |
Beta Was this translation helpful? Give feedback.
-
We removed
EVP_MD_meth_dup()
from LibreSSL 3.9.0 and later because it is part of a dangerous API that is essentially unused. In OpenBSD, I fixed this with this patch that simplifies and improves the code quite a bit in my opinion.I was going to send this diff in a PR earlier today, but, unfortunately, the combination of
-Werror
with-Wcast-qual
results in a compilation error.I see four solutions for this - assuming you want to keep both these compiler flags for all builds:
-Wcast-qual
is happy and use the fix I landed in OpenBSD.uintptr_t
:EVP_MD_meth_dup()
andEVP_MD_meth_free()
in the stable version of LibreSSL 3.9.const
in the LibreSSL/legacy OpenSSL path.If we ever add
EVP_MD_fetch()
to LibreSSL, it will basically be a version of 1. @davidben from BoringSSL is of the same opinion.Solution 4 will be quite ugly, I would love to avoid 3 if at all possible and I don't particularly like solution 2, which leaves me with a strong preference for solution 1.
Cc @djmdjm
Beta Was this translation helpful? Give feedback.
All reactions