openssl/providers/implementations/ciphers
Benjamin Kaduk 8489026850 Support cipher provider "iv state"
Some modes (e.g., CBC and OFB) update the effective IV with each
block-cipher invocation, making the "IV" stored in the (historically)
EVP_CIPHER_CTX or (current) PROV_CIPHER_CTX distinct from the initial
IV passed in at cipher initialization time.  The latter is stored in
the "oiv" (original IV) field, and has historically been accessible
via the EVP_CIPHER_CTX_original_iv() API.  The "effective IV" has
also historically been accessible, via both EVP_CIPHER_CTX_iv()
and EVP_CIPHER_CTX_iv_noconst(), the latter of which allows for
*write* access to the internal cipher state.  This is particularly
problematic given that provider-internal cipher state need not, in
general, even be accessible from the same address space as libcrypto,
so these APIs are not sustainable in the long term.  However, it still
remains necessary to provide access to the contents of the "IV state"
(e.g., when serializing cipher state for in-kernel TLS); a subsequent
reinitialization of a cipher context using the "IV state" as the
input IV will be able to resume processing of data in a compatible
manner.

This problem was introduced in commit
089cb623be, which effectively caused
all IV queries to return the "original IV", removing access to the
current IV state of the cipher.

These functions for accessing the (even the "original") IV had remained
undocumented for quite some time, presumably due to unease about
exposing the internals of the cipher state in such a manner.

Note that this also as a side effect "fixes" some "bugs" where things
had been referring to the 'iv' field that should have been using the
'oiv' field.  It also fixes the EVP_CTRL_GET_IV cipher control,
which was clearly intended to expose the non-original IV, for
use exporting the cipher state into the kernel for kTLS.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12233)
2020-08-11 07:07:37 -07:00
..
build.info Add AES_CBC_CTS ciphers to providers 2020-07-15 23:11:50 +02:00
cipher_aes_cbc_hmac_sha1_hw.c Decreate the length after decryption for the stitched ciphers 2020-07-06 09:26:09 +01:00
cipher_aes_cbc_hmac_sha256_hw.c Decreate the length after decryption for the stitched ciphers 2020-07-06 09:26:09 +01:00
cipher_aes_cbc_hmac_sha.c Support cipher provider "iv state" 2020-08-11 07:07:37 -07:00
cipher_aes_cbc_hmac_sha.h Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_ccm_hw_aesni.inc
cipher_aes_ccm_hw_s390x.inc
cipher_aes_ccm_hw_t4.inc
cipher_aes_ccm_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_ccm.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
cipher_aes_ccm.h
cipher_aes_cts_fips.c Add AES_CBC_CTS ciphers to providers 2020-07-15 23:11:50 +02:00
cipher_aes_cts.h Add AES_CBC_CTS ciphers to providers 2020-07-15 23:11:50 +02:00
cipher_aes_cts.inc Add AES_CBC_CTS ciphers to providers 2020-07-15 23:11:50 +02:00
cipher_aes_gcm_hw_aesni.inc Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_gcm_hw_armv8.inc Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_gcm_hw_s390x.inc
cipher_aes_gcm_hw_t4.inc Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_gcm_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_gcm.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
cipher_aes_gcm.h
cipher_aes_hw_aesni.inc
cipher_aes_hw_s390x.inc
cipher_aes_hw_t4.inc
cipher_aes_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_ocb_hw.c Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
cipher_aes_ocb.c Support cipher provider "iv state" 2020-08-11 07:07:37 -07:00
cipher_aes_ocb.h
cipher_aes_siv_hw.c Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
cipher_aes_siv.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_aes_siv.h Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
cipher_aes_wrp.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_aes_xts_fips.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
cipher_aes_xts_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aes_xts.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_aes_xts.h
cipher_aes.c Add AES_CBC_CTS ciphers to providers 2020-07-15 23:11:50 +02:00
cipher_aes.h
cipher_aria_ccm_hw.c
cipher_aria_ccm.c Update copyright year 2020-06-25 14:13:12 +01:00
cipher_aria_ccm.h
cipher_aria_gcm_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_aria_gcm.c Update copyright year 2020-06-25 14:13:12 +01:00
cipher_aria_gcm.h
cipher_aria_hw.c
cipher_aria.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_aria.h
cipher_blowfish_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_blowfish.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_blowfish.h
cipher_camellia_hw_t4.inc
cipher_camellia_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_camellia.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_camellia.h
cipher_cast5_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_cast5.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_cast.h
cipher_chacha20_hw.c
cipher_chacha20_poly1305_hw.c Update copyright year 2020-07-16 14:47:04 +02:00
cipher_chacha20_poly1305.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_chacha20_poly1305.h
cipher_chacha20.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_chacha20.h Update copyright year 2020-06-25 14:13:12 +01:00
cipher_des_hw.c Add solaris assembler fixes for legacy provider 2020-05-02 17:55:07 +10:00
cipher_des.c Fix provider cipher reinit after init/update with a partial update block. 2020-08-05 08:45:29 +10:00
cipher_des.h
cipher_desx_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_desx.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_idea_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_idea.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_idea.h
cipher_null.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_rc2_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_rc2.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_rc2.h
cipher_rc4_hmac_md5_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_rc4_hmac_md5.c gettables: provider changes to pass the provider context. 2020-08-07 08:02:14 +10:00
cipher_rc4_hmac_md5.h
cipher_rc4_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_rc4.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_rc4.h
cipher_rc5_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_rc5.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_rc5.h
cipher_seed_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_seed.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_seed.h
cipher_sm4_hw.c
cipher_sm4.c Ensure any allocated MAC is freed in the provider code 2020-07-06 09:26:09 +01:00
cipher_sm4.h
cipher_tdes_common.c Fix provider cipher reinit after init/update with a partial update block. 2020-08-05 08:45:29 +10:00
cipher_tdes_default_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_tdes_default.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_tdes_default.h
cipher_tdes_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_tdes_wrap_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
cipher_tdes_wrap.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
cipher_tdes.c Move legacy ciphers into the legacy provider 2020-04-09 12:47:46 +10:00
cipher_tdes.h Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
ciphercommon_block.c Add provider support for TLS CBC padding and MAC removal 2020-07-06 09:26:09 +01:00
ciphercommon_ccm_hw.c
ciphercommon_ccm.c Support cipher provider "iv state" 2020-08-11 07:07:37 -07:00
ciphercommon_gcm_hw.c Update copyright year 2020-04-23 13:55:52 +01:00
ciphercommon_gcm.c Support cipher provider "iv state" 2020-08-11 07:07:37 -07:00
ciphercommon_hw.c
ciphercommon_local.h Update copyright year 2020-07-16 14:47:04 +02:00
ciphercommon.c Support cipher provider "iv state" 2020-08-11 07:07:37 -07:00