Fix double-free in e_dasync.c#16751
Fix double-free in e_dasync.c#16751bernd-edlinger wants to merge 1 commit intoopenssl:OpenSSL_1_1_1-stablefrom
Conversation
When the cipher is copied, the inner_cihper_data need to be copied as well, using the EVP_CTRL_COPY method. The EVP_CIPH_CUSTOM_COPY bit needs to be set as well.
|
I wonder if it makes sense to try to fix the dasync engine. Apparently it was broken by many ways and nobody really used it. |
|
Yeah, it is probably not really useful in practice, is it just defers everything to a real crypto provider, |
|
But while there are obviously some minor problems in 1.1.1, because of missing tests, |
|
This pull request is ready to merge |
When the cipher is copied, the inner_cihper_data need to be copied as well, using the EVP_CTRL_COPY method. The EVP_CIPH_CUSTOM_COPY bit needs to be set as well. Reviewed-by: Tomas Mraz <[email protected]> (Merged from #16751)
|
Merged to 1.1.1 as 14357a5. Thanks! |
|
It seems that this would have applied just fine to master/3.0. I independently fixed the same problem there in #16846, and I only came to notice this PR when attempting to backport it to 1.1.1 and I realised it had already been fixed. |
When the cipher is copied, the inner_cihper_data
need to be copied as well, using the EVP_CTRL_COPY method.
The EVP_CIPH_CUSTOM_COPY bit needs to be set as well.
I've discovered this issue when playing with #16750
without this the test_cmac and test_evp fail with a double free.
This patch is for 1.1.1 only because the dasync engine is totally broken
in master, see #16734