TEST: Check that i2d refuses to encode non-optional items with no content
authorRichard Levitte <levitte@openssl.org>
Thu, 8 Jul 2021 11:33:28 +0000 (13:33 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 10 Jul 2021 15:05:07 +0000 (17:05 +0200)
commit2296cc34f3c700b0bc5c45f35e56641fbb840db3
treee37d3dfca2c112545ce93de7529391f20a7b3f82
parentf159b83a75c8d5e5c43ae4b2dec62086a5e36189
TEST: Check that i2d refuses to encode non-optional items with no content

The test case creates an RSA public key and tries to pass it through
i2d_PrivateKey().  This SHOULD fail, since the private bits are missing.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16036)
test/asn1_internal_test.c