diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/enginetest.c | 19 | ||||
-rw-r--r-- | test/evp_extra_test.c | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/test/enginetest.c b/test/enginetest.c index d865488770..04e61743a1 100644 --- a/test/enginetest.c +++ b/test/enginetest.c @@ -23,6 +23,7 @@ # include <openssl/engine.h> # include <openssl/rsa.h> # include <openssl/err.h> +# include <openssl/x509.h> static void display_engine_list(void) { @@ -357,6 +358,7 @@ static int test_x509_dup_w_engine(void) { ENGINE *e = NULL; X509 *cert = NULL, *dupcert = NULL; + X509_PUBKEY *pubkey, *duppubkey = NULL; int ret = 0; BIO *b = NULL; RSA_METHOD *rsameth = NULL; @@ -370,6 +372,16 @@ static int test_x509_dup_w_engine(void) goto err; X509_free(dupcert); dupcert = NULL; + + if (!TEST_ptr(pubkey = X509_get_X509_PUBKEY(cert)) + || !TEST_ptr(duppubkey = X509_PUBKEY_dup(pubkey)) + || !TEST_ptr_ne(duppubkey, pubkey) + || !TEST_ptr_ne(X509_PUBKEY_get0(duppubkey), X509_PUBKEY_get0(pubkey))) + goto err; + + X509_PUBKEY_free(duppubkey); + duppubkey = NULL; + X509_free(cert); cert = NULL; @@ -395,11 +407,18 @@ static int test_x509_dup_w_engine(void) if (!TEST_ptr(dupcert = X509_dup(cert))) goto err; + if (!TEST_ptr(pubkey = X509_get_X509_PUBKEY(cert)) + || !TEST_ptr(duppubkey = X509_PUBKEY_dup(pubkey)) + || !TEST_ptr_ne(duppubkey, pubkey) + || !TEST_ptr_ne(X509_PUBKEY_get0(duppubkey), X509_PUBKEY_get0(pubkey))) + goto err; + ret = 1; err: X509_free(cert); X509_free(dupcert); + X509_PUBKEY_free(duppubkey); if (e != NULL) { ENGINE_unregister_RSA(e); ENGINE_free(e); diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 2c604daae9..58c4a590e7 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -2278,7 +2278,7 @@ static int test_X509_PUBKEY_dup(void) if (!TEST_ptr(X509_PUBKEY_get0(xq)) || !TEST_ptr(X509_PUBKEY_get0(xp)) - || !TEST_ptr_eq(X509_PUBKEY_get0(xq), X509_PUBKEY_get0(xp))) + || !TEST_ptr_ne(X509_PUBKEY_get0(xq), X509_PUBKEY_get0(xp))) goto done; X509_PUBKEY_free(xq); |