summaryrefslogtreecommitdiffstats
path: root/test/cmp_msg_test.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-19 20:16:53 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-11-27 16:53:32 +0100
commitee46dfbf2c117a9532f887b478c9c65d8f30d50c (patch)
tree1106cecd9a6cd196961caa1ccf7730508ee48d37 /test/cmp_msg_test.c
parent4f7e08c83eca6667722f3d5848f28d37c821dc37 (diff)
X509_dup: fix copying of libctx and propq using new ASN1_OP_DUP_POST cb operation
Fixes #12680 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12687)
Diffstat (limited to 'test/cmp_msg_test.c')
-rw-r--r--test/cmp_msg_test.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c
index cc5a6268fd..59b0a1777d 100644
--- a/test/cmp_msg_test.c
+++ b/test/cmp_msg_test.c
@@ -33,16 +33,6 @@ typedef struct test_fixture {
static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
-/* TODO(3.0) Clean this up - See issue #12680 */
-static X509 *X509_dup_ex(const X509 *cert)
-{
- X509 *dup = X509_dup(cert);
-
- if (dup != NULL)
- x509_set0_libctx(dup, libctx, NULL);
- return dup;
-}
-
static unsigned char ref[CMP_TEST_REFVALUE_LENGTH];
static void tear_down(CMP_MSG_TEST_FIXTURE *fixture)
@@ -296,7 +286,7 @@ static int test_cmp_create_certconf(void)
fixture->fail_info = 0;
fixture->expected = 1;
if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
- X509_dup_ex(cert)))) {
+ X509_dup(cert)))) {
tear_down(fixture);
fixture = NULL;
}
@@ -310,7 +300,7 @@ static int test_cmp_create_certconf_badAlg(void)
fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badAlg;
fixture->expected = 1;
if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
- X509_dup_ex(cert)))) {
+ X509_dup(cert)))) {
tear_down(fixture);
fixture = NULL;
}
@@ -324,7 +314,7 @@ static int test_cmp_create_certconf_fail_info_max(void)
fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_MAX;
fixture->expected = 1;
if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
- X509_dup_ex(cert)))) {
+ X509_dup(cert)))) {
tear_down(fixture);
fixture = NULL;
}
@@ -405,7 +395,7 @@ static int execute_certrep_create(CMP_MSG_TEST_FIXTURE *fixture)
cresp->certifiedKeyPair->certOrEncCert->type =
OSSL_CMP_CERTORENCCERT_CERTIFICATE;
if ((cresp->certifiedKeyPair->certOrEncCert->value.certificate =
- X509_dup_ex(cert)) == NULL
+ X509_dup(cert)) == NULL
|| !sk_OSSL_CMP_CERTRESPONSE_push(crepmsg->response, cresp))
goto err;
cresp = NULL;