Add a real type for OSSL_CORE_BIO which is distinct from and not castable to BIO
authorPauli <ppzgs1@gmail.com>
Thu, 4 Mar 2021 03:53:53 +0000 (13:53 +1000)
committerPauli <ppzgs1@gmail.com>
Wed, 10 Mar 2021 23:25:57 +0000 (09:25 +1000)
commit141cc94e44db93cded4ce3f0d97b9b5b928f43f2
tree111a6e47c2a86347a6d969d00844a5b2dc8a5805
parent7a45d51ce3268d16409405b9d54d7b4bb77a7fc3
Add a real type for OSSL_CORE_BIO which is distinct from and not castable to BIO

Providers (particularly the FIPS provider) needs access to BIOs from libcrypto.
Libcrypto is allowed to change the internal format of the BIO structure and it
is still expected to work with providers that were already built.  This means
that the libcrypto BIO must be distinct from and not castable to the provider
side OSSL_CORE_BIO.

Unfortunately, this requirement was broken in both directions.  This fixes
things by forcing the two to be different and any casts break loudly.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14419)
crypto/bio/build.info
crypto/bio/core_bio.c [new file with mode: 0644]
crypto/encode_decode/decoder_lib.c
crypto/encode_decode/encoder_lib.c
crypto/provider_core.c
crypto/store/store_lib.c
include/internal/bio.h
providers/common/bio_prov.c
providers/common/include/prov/bio.h
providers/implementations/storemgmt/file_store_der2obj.c
test/ossl_store_test.c