Commit bbe7916279 for openssl.org
commit bbe79162792feee8b2d9b5efbeef6d37526271bb
Author: Dr. David von Oheimb <dev@ddvo.net>
Date: Thu May 7 21:43:15 2026 +0200
cmp_client_test.c: fix partly too generous total_timeout limit for IR session with polling
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed Jun 10 06:46:36 2026
(Merged from https://github.com/openssl/openssl/pull/31111)
diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c
index 7e3ab256e6..cd51d3d0e7 100644
--- a/test/cmp_client_test.c
+++ b/test/cmp_client_test.c
@@ -254,7 +254,9 @@ static int test_exec_REQ_ses_poll(int req_type, int check_after,
return result;
}
-static int checkAfter = 1;
+static const int checkAfter = 1;
+static const int pollCount = 3;
+
static int test_exec_IR_ses_poll_ok(void)
{
return test_exec_REQ_ses_poll(OSSL_CMP_PKIBODY_IR, checkAfter, 2, 0,
@@ -272,7 +274,7 @@ static int test_exec_IR_ses_poll_no_timeout(void)
static int test_exec_IR_ses_poll_total_timeout(void)
{
return test_exec_REQ_ses_poll(OSSL_CMP_PKIBODY_IR, checkAfter,
- 3 /* pollCount */, checkAfter + 4,
+ pollCount, (pollCount - 1) * checkAfter,
OSSL_CMP_PKISTATUS_trans);
}
@@ -482,7 +484,7 @@ static int test_exec_GENM_ses_poll_no_timeout(void)
static int test_exec_GENM_ses_poll_total_timeout(void)
{
return test_exec_REQ_ses_poll(OSSL_CMP_PKIBODY_GENM, checkAfter,
- 3 /* pollCount */, checkAfter + 2,
+ pollCount, (pollCount - 1) * checkAfter,
OSSL_CMP_PKISTATUS_trans);
}