diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-08-13 13:01:38 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-08-13 13:01:38 +0200 |
commit | 33e8f03e98acdf3c505b2ee82dd7e595d11e3b6f (patch) | |
tree | 8fe2a0e606879a5e7253d492c52855ea38911a98 /test | |
parent | 331c4b59077603c88d27f9ab663d86843339d034 (diff) |
Revert "TEST: Check that i2d refuses to encode non-optional items with no content"
This reverts commit 12e9b74c513a8ed3c1c260cf25221a465ae14b84.
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/16308)
Diffstat (limited to 'test')
-rw-r--r-- | test/asn1_internal_test.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/asn1_internal_test.c b/test/asn1_internal_test.c index 146d8a8994..865e058421 100644 --- a/test/asn1_internal_test.c +++ b/test/asn1_internal_test.c @@ -107,47 +107,9 @@ static int test_standard_methods(void) return 0; } -/********************************************************************** - * - * Test of that i2d fail on non-existing non-optional items - * - ***/ - -#include <openssl/rsa.h> - -static int test_empty_nonoptional_content(void) -{ - RSA *rsa = NULL; - BIGNUM *n = NULL; - BIGNUM *e = NULL; - int ok = 0; - - if (!TEST_ptr(rsa = RSA_new()) - || !TEST_ptr(n = BN_new()) - || !TEST_ptr(e = BN_new()) - || !TEST_true(RSA_set0_key(rsa, n, e, NULL))) - goto end; - - n = e = NULL; /* They are now "owned" by |rsa| */ - - /* - * This SHOULD fail, as we're trying to encode a public key as a private - * key. The private key bits MUST be present for a proper RSAPrivateKey. - */ - if (TEST_int_le(i2d_RSAPrivateKey(rsa, NULL), 0)) - ok = 1; - - end: - RSA_free(rsa); - BN_free(n); - BN_free(e); - return ok; -} - int setup_tests(void) { ADD_TEST(test_tbl_standard); ADD_TEST(test_standard_methods); - ADD_TEST(test_empty_nonoptional_content); return 1; } |