Issue 21887: Audit all ciphers to ensure dupctx method is implemented#21933
Closed
nhorman wants to merge 6 commits intoopenssl:masterfrom
Closed
Issue 21887: Audit all ciphers to ensure dupctx method is implemented#21933nhorman wants to merge 6 commits intoopenssl:masterfrom
nhorman wants to merge 6 commits intoopenssl:masterfrom
Conversation
Member
|
Needs rebase |
Contributor
Author
|
rebase complete |
t8m
reviewed
Sep 4, 2023
hlandau
suggested changes
Sep 4, 2023
00cb367 to
b39dcd5
Compare
t8m
reviewed
Sep 4, 2023
t8m
reviewed
Sep 4, 2023
t8m
reviewed
Sep 4, 2023
8e5c1be to
c13904d
Compare
There should be no reason that a cipher can't be duplicated Fixes openssl#21887
Add dupctx method support to to ciphers implemented with IMPLEMENT_aead_cipher This includes: aes-<kbits>-gcm aria-<kbits>-ccm aria-<kbits>-gcm sm4-<kibs>-gcm Fixes openssl#21887
create a dupctx method for aes_WRAP implementations of all sizes Fixes openssl#21887
This cipher family has a dupctx function, but was failing because it was attempting to memdup a field only if it was null Fix the conditional check to get it working again Fixes openssl#21887
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
Pretty straightforward, just clone the requested context, no pointers to fixup Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21933) Signed-off-by: fly2x <fly2x@hitls.org>
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
There should be no reason that a cipher can't be duplicated Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21933) (cherry picked from commit 39d857b) Signed-off-by: fly2x <fly2x@hitls.org>
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
Add dupctx method support to to ciphers implemented with IMPLEMENT_aead_cipher This includes: aes-<kbits>-gcm aria-<kbits>-ccm aria-<kbits>-gcm sm4-<kibs>-gcm Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21933) (cherry picked from commit 0239fb3) Signed-off-by: fly2x <fly2x@hitls.org>
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
create a dupctx method for aes_WRAP implementations of all sizes Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21933) (cherry picked from commit 2c021e7) Signed-off-by: fly2x <fly2x@hitls.org>
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
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> (Merged from openssl/openssl#21933) (cherry picked from commit df93b3c) Signed-off-by: fly2x <fly2x@hitls.org>
wanghao75
pushed a commit
to openeuler-mirror/openssl
that referenced
this pull request
Sep 23, 2023
Pretty straightforward, just clone the requested context, no pointers to fixup Fixes #21887 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21933) (cherry picked from commit 123c858) Signed-off-by: fly2x <fly2x@hitls.org>
Contributor
|
It looks like this was backported to 3.1, then reverted in #22081, but never re-applied. What needs to happen to get this + the fix for the regression re-applied to 3.1? |
Member
|
I am not sure it is a good idea to backport this. It is not a bug fix in a strict sense. |
Contributor
|
It is a regression compared to the 1.x series, where dup ctx worked on these ciphers. |
Member
|
Hmm... true, I forgot about that. @nhorman would you please create a backport PRs? I think they need to be separate for 3.1 and 3.0 branches if I am not mistaken. Also please do not forget to add all the later fixes that were applied after the initial PR. |
This was referenced Dec 12, 2023
Contributor
Author
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 20, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 21, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 21, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 21, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 21, 2023
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)
Liu-ErMeng
pushed a commit
to Liu-ErMeng/openssl
that referenced
this pull request
Dec 21, 2023
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)
kafei-cy
added a commit
to kafei-cy/Tongsuo
that referenced
this pull request
Apr 8, 2026
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was noted that several cipher implementations were missing their dupctx method, resulting in an inability to use EVP_CIPHER_CTX_dup/copy, which was then ignored because the cipher tests just assume that a failure there was a lack of support, and ignored them. Update the tests to fail on a missing dupctx method, and implement said method in all those that are missing it
Fixes #21887
Checklist