diff options
author | Matt Caswell <matt@openssl.org> | 2021-05-21 15:50:43 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-05 17:39:10 +1000 |
commit | 62653483464b78ae57bff9b807ee3328e0f078f3 (patch) | |
tree | 34a9b38c9733f54d58b282463f3c2355d5d11d0d /test/evp_extra_test.c | |
parent | d6ded941c94803adf090f17093c8ff905f259ca8 (diff) |
Fix evp_extra_test to use libctx in an X509_PUBKEY
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15591)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r-- | test/evp_extra_test.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index f91784b3a9..f26330b5d8 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1945,11 +1945,13 @@ static int test_emptyikm_HKDF(void) static int test_X509_PUBKEY_inplace(void) { int ret = 0; - X509_PUBKEY *xp = NULL; + X509_PUBKEY *xp = X509_PUBKEY_new_ex(testctx, testpropq); const unsigned char *p = kExampleECPubKeyDER; size_t input_len = sizeof(kExampleECPubKeyDER); - if (!TEST_ptr(xp = d2i_X509_PUBKEY(NULL, &p, input_len))) + if (!TEST_ptr(xp)) + goto done; + if (!TEST_ptr(d2i_X509_PUBKEY(&xp, &p, input_len))) goto done; if (!TEST_ptr(X509_PUBKEY_get0(xp))) @@ -1978,7 +1980,9 @@ static int test_X509_PUBKEY_dup(void) const unsigned char *p = kExampleECPubKeyDER; size_t input_len = sizeof(kExampleECPubKeyDER); - if (!TEST_ptr(xp = d2i_X509_PUBKEY(NULL, &p, input_len)) + xp = X509_PUBKEY_new_ex(testctx, testpropq); + if (!TEST_ptr(xp) + || !TEST_ptr(d2i_X509_PUBKEY(&xp, &p, input_len)) || !TEST_ptr(xq = X509_PUBKEY_dup(xp)) || !TEST_ptr_ne(xp, xq)) goto done; |