openssl/providers
Neil Horman 61cfc22b60 Implement dupctx for chacha20 cipher
Implement the dupctx method for the chacha20 cipher, so that
EVP_PKEY_CTX_copy works

Its pretty straightforward, its basically just a memdup.  Checking the
pointers that might need fixing up:

in PROV_CHACHA20_CTX all members are statically declared, so memduping
should be fine

in PROV_CHACHA20_CTX->base (PROV_CIPHER_CTX):
        Non statically declared members:
                *tlsmac needs to get memduped to avoid double free
                 conditions, but only if base.alloced is set
                *hw pointer is always assigned to the chacha20_hw global
                 variable, so can be left alone
                *libctx can be left alone as provctx is always NULL in
                 chacha20_newctx
                *ks appears unused by chacha20, so can be ignored
Fixes #20978

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21878)
2023-09-04 10:15:58 +10:00
..
common fips: update DSA security check to fix legacy verify strengths 2023-06-15 09:21:30 +10:00
fips fips: use tsan counter instead of tsan_add to increment 2023-06-16 20:10:23 +10:00
implementations Implement dupctx for chacha20 cipher 2023-09-04 10:15:58 +10:00
baseprov.c Replaced '{ 0, NULL }' with OSSL_DISPATCH_END in OSSL_DISPATCH arrays 2023-04-21 16:19:11 +02:00
build.info Add VERSIONINFO resource to legacy provider if it is not builtin 2022-06-02 11:09:10 -04:00
decoders.inc configure: introduce no-ecx to remove ECX related feature 2023-06-14 13:06:22 +10:00
defltprov.c Add support for SHA256/192 2023-06-28 08:00:43 +10:00
encoders.inc configure: introduce no-ecx to remove ECX related feature 2023-06-14 13:06:22 +10:00
fips-sources.checksums Update the FIPS checksums 2023-05-22 15:14:31 +02:00
fips.checksum Update the FIPS checksums 2023-05-22 15:14:31 +02:00
fips.module.sources Update the FIPS checksums 2023-05-22 15:14:31 +02:00
legacyprov.c Replaced '{ 0, NULL }' with OSSL_DISPATCH_END in OSSL_DISPATCH arrays 2023-04-21 16:19:11 +02:00
nullprov.c Replaced '{ 0, NULL }' with OSSL_DISPATCH_END in OSSL_DISPATCH arrays 2023-04-21 16:19:11 +02:00
prov_running.c keygen: add FIPS error state management to conditional self tests 2020-09-12 16:46:51 +10:00
stores.inc Add support for loading root CAs from Windows crypto API 2022-09-14 14:10:18 +01:00