aboutsummaryrefslogtreecommitdiff
path: root/test
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:29:58 +0100
commitb3d29175f7046b51b20ab4c78d2e5f7611ea6bce (patch)
treed79dca8fef3914890eefa3562b9048dbbe6dae4b /test
parentf494a5c2fe7e1b0ea11c6785f4357c240b395cf7 (diff)
downloadopenssl-b3d29175f7046b51b20ab4c78d2e5f7611ea6bce.zip
openssl-b3d29175f7046b51b20ab4c78d2e5f7611ea6bce.tar.gz
openssl-b3d29175f7046b51b20ab4c78d2e5f7611ea6bce.tar.bz2
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) (cherry picked from commit 1c04866c671db4a6db0a1784399b351ea061bc16)
Diffstat (limited to 'test')
-rw-r--r--test/cmp_client_test.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c
index f470f5e..7c3b867 100644
--- a/test/cmp_client_test.c
+++ b/test/cmp_client_test.c
@@ -95,15 +95,27 @@ 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;
sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
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,