summaryrefslogtreecommitdiffstats
path: root/test/cmp_client_test.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-09-14 17:37:27 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-11-25 09:19:34 +0100
commit1c04866c671db4a6db0a1784399b351ea061bc16 (patch)
treeeaed7780bd1644a107b2eb44b151c777de475072 /test/cmp_client_test.c
parent7e3034939b40ee15013bdba9ff6178de6bcc26d4 (diff)
OSSL_CMP_CTX_reinit(): fix missing reset of ctx->genm_ITAVs
Otherwise, further OSSL_CMP_exec_GENM_ses() calls will go wrong. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/19216)
Diffstat (limited to 'test/cmp_client_test.c')
-rw-r--r--test/cmp_client_test.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c
index b25d98eb9f..1727703d26 100644
--- a/test/cmp_client_test.c
+++ b/test/cmp_client_test.c
@@ -94,9 +94,13 @@ static int execute_exec_RR_ses_test(CMP_SES_TEST_FIXTURE *fixture)
OSSL_CMP_exec_RR_ses(fixture->cmp_ctx) == 1);
}
-static int execute_exec_GENM_ses_test(CMP_SES_TEST_FIXTURE *fixture)
+static int execute_exec_GENM_ses_test_single(CMP_SES_TEST_FIXTURE *fixture)
{
- STACK_OF(OSSL_CMP_ITAV) *itavs = NULL;
+ ASN1_OBJECT *type = OBJ_txt2obj("1.3.6.1.5.5.7.4.2", 1);
+ OSSL_CMP_ITAV *itav = OSSL_CMP_ITAV_create(type, NULL);
+ STACK_OF(OSSL_CMP_ITAV) *itavs;
+
+ OSSL_CMP_CTX_push0_genm_ITAV(fixture->cmp_ctx, itav);
if (!TEST_ptr(itavs = OSSL_CMP_exec_GENM_ses(fixture->cmp_ctx)))
return 0;
@@ -104,6 +108,13 @@ static int execute_exec_GENM_ses_test(CMP_SES_TEST_FIXTURE *fixture)
return 1;
}
+static int execute_exec_GENM_ses_test(CMP_SES_TEST_FIXTURE *fixture)
+{
+ return execute_exec_GENM_ses_test_single(fixture)
+ && OSSL_CMP_CTX_reinit(fixture->cmp_ctx)
+ && execute_exec_GENM_ses_test_single(fixture);
+}
+
static int execute_exec_certrequest_ses_test(CMP_SES_TEST_FIXTURE *fixture)
{
X509 *res = OSSL_CMP_exec_certreq(fixture->cmp_ctx,