Deprecate and replace EVP_CIPHER_CTX_iv()/etc.
authorBenjamin Kaduk <bkaduk@akamai.com>
Sat, 20 Jun 2020 01:43:58 +0000 (18:43 -0700)
committerBenjamin Kaduk <bkaduk@akamai.com>
Tue, 11 Aug 2020 14:07:56 +0000 (07:07 -0700)
commit79f4417ed940793fe7d48d613c9b903d00630b69
tree9c5baacb912033464b21b32bf7d1111cea268268
parent8489026850b38447d8e3e68c4d4260585b7e8e3a
Deprecate and replace EVP_CIPHER_CTX_iv()/etc.

The EVP_CIPHER_CTX_iv() family of functions are incompatible with
the libcrypto/provider separation, since the implied API contract
(they are undocumented) involves a pointer into the active cipher
context structure.  However, the active IV data in a provider-side
context need not even be in the same address space as libcrypto,
so a replacement API is needed.

The existing 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.

Provide more maintainable new APIs for accessing the initial ("oiv") and
current-state ("iv") IV data, that copy the value into a caller-provided
array, eliminating the need to provide a pointer into the internal
cipher context, which accordingly no longer provides the ability to
write to the internal cipher state.

Unfortunately, in order to maintain API compatibility with OpenSSL
1.1.1, the old functionality is still available, but is marked as
deprecated for future removal.  This would entail removing the "octet
pointer" parameter access, leaving only the "octet string" parameter
type.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12233)
crypto/evp/evp_lib.c
include/openssl/evp.h
util/libcrypto.num