backport #21933 to 3.0 branch #23102
Conversation
9540127 to
2286638
Compare
|
@nhorman , help! is the |
test/evp_test.c
Outdated
| int ok = 0, tmplen, chunklen, tmpflen, i; | ||
| EVP_CIPHER_CTX *ctx_base = NULL; | ||
| EVP_CIPHER_CTX *ctx = NULL; | ||
| int fips_dupctx_supported = (fips_provider_version_ge(libctx, 3, 0, 11) |
There was a problem hiding this comment.
I think this should be fips_provider_version_gt(libctx, 3, 0, 12)
| } | ||
| } |
There was a problem hiding this comment.
Add an else case where you do:
EVP_CIPHER_CTX_free(ctx_base);
ctx_base = NULL;
Yes the CI is relevant. |
|
Will look as soon as.i get to my desk |
|
Ack to @t8m comments, those changes should fix the ci |
There should be no reason that a cipher can't be duplicated Fixes openssl#21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#21933)
Add dupctx method support to to ciphers implemented with IMPLEMENT_aead_cipher This includes: aes-<kbits>-gcm aria-<kbits>-ccm aria-<kbits>-gcm Fixes openssl#21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#21933)
create a dupctx method for aes_WRAP implementations of all sizes Fixes openssl#21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#21933)
Same as chacha20 in the last commit, just clone the ctx and its underlying tlsmac array if its allocated Fixes openssl#21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#21933)
Pretty straightforward, just clone the requested context, no pointers to fixup Fixes openssl#21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#21933)
In the dupctx fixups I missed a pointer that needed to be repointed to the surrounding structures AES_KEY structure for the sm4/aes/aria ccm/gcm variants. This caused a colliding use of the key and possible use after free issues. Fixes openssl#22076 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from openssl#22102)
2286638 to
0e16f66
Compare
thx, I will fix these. |
|
This pull request is ready to merge |
|
This pull request is ready to merge |
|
Merged to the 3.0 branch. Thank you for your contribution. |
Add dupctx method support to to ciphers implemented with IMPLEMENT_aead_cipher This includes: aes-<kbits>-gcm aria-<kbits>-ccm aria-<kbits>-gcm Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23102)
In the dupctx fixups I missed a pointer that needed to be repointed to the surrounding structures AES_KEY structure for the sm4/aes/aria ccm/gcm variants. This caused a colliding use of the key and possible use after free issues. Fixes #22076 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23102)
Add dupctx method support to to ciphers implemented with IMPLEMENT_aead_cipher This includes: aes-<kbits>-gcm aria-<kbits>-ccm aria-<kbits>-gcm Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23102) (cherry picked from commit 879a853)
Same as chacha20 in the last commit, just clone the ctx and its underlying tlsmac array if its allocated Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23102) (cherry picked from commit e7ef50c)
In the dupctx fixups I missed a pointer that needed to be repointed to the surrounding structures AES_KEY structure for the sm4/aes/aria ccm/gcm variants. This caused a colliding use of the key and possible use after free issues. Fixes #22076 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #23102) (cherry picked from commit 0398bc2)
|
|
As we do not see the failures in our CI could you please open a new issue and report the failures that you see? |
|
Sorry for not answering earlier; GH needs a reaction that amounts to "ack, thanks for your answer, I'm currently looking into it and it might take me some time". I also didn't answer earlier because I had a weird feeling following the comments here. It turns out that the issue happens only when we also patch in a backport of at least one of commits 8a75952ba829784f5cb499c4883a5729c226e38c or 949108dd73de321fb93c8d81b846a2a1d015a9fd . Right now I see several possible causes:
@t8m I'll therefore open a bug when I can tell which one of these possibilities it is in order to make a proper one; this is taking a while as the builds are LTO (including tests) (and, checking whether the builds should be LTO is already scheduled in the coming weeks). |
|
I forgot to mention that these CPU feature patches require fairly recent hardware which is always annoying with Intel due to market segmentation but my laptop surprisingly has the features. On the AMD side, Zen 4 is needed and I fortunately have such a machine too now where the behavior is the same. Anyway, I guess hardware support is the reason why something (whatever that is) might have gone un-noticed. |
Include 7 commits: 1. make inability to dup/clone ciphers an error 2. Add dupctx support to aead ciphers 3. implement dupctx for aes_WRAP methods 4. implement dupctx for chacha20_poly1305 5. Add dupctx support to rc4_hmac_md5 algo 6. Fix a key repointing in various ciphers 7. Also with SM4 for Tongsuo, delete some codes tend to CI error. (Merged from openssl/openssl#23102)
Include 7 commits: 1. make inability to dup/clone ciphers an error 2. Add dupctx support to aead ciphers 3. implement dupctx for aes_WRAP methods 4. implement dupctx for chacha20_poly1305 5. Add dupctx support to rc4_hmac_md5 algo 6. Fix a key repointing in various ciphers 7. Also with SM4 for Tongsuo, delete some codes tend to CI error. (Merged from openssl/openssl#23102)
Checklist
relate to #23018