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 10:05:50 +0000 (12:05 +0200)
commit12e9b74c513a8ed3c1c260cf25221a465ae14b84
tree14696c8af07f7b27035687ef085964aef8fb4894
parent6eba6a9b35e97f8fc9fee33a7bdfff0bed04a6dc
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/16027)
test/asn1_internal_test.c