From 3e77acbff1991ebaae0dcaa41e24a26e408cc159 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 10 Oct 2025 20:36:49 +0200 Subject: [PATCH] apps/cmp.c and doc/man3: add clarifying comments and doc line on CMP context used in two function calls; move one of these calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Tomas Mraz Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/28891) --- apps/cmp.c | 5 +++-- doc/man3/OSSL_CMP_SRV_CTX_new.pod | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/cmp.c b/apps/cmp.c index 6f2fea4f556..185210b1271 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -3263,7 +3263,7 @@ static int cmp_server(OSSL_CMP_CTX *srv_cmp_ctx) goto next; } OPENSSL_free(path); - resp = OSSL_CMP_CTX_server_perform(cmp_ctx, req); + resp = OSSL_CMP_CTX_server_perform(cmp_ctx /* of client */, req); OSSL_CMP_MSG_free(req); if (resp == NULL) { (void)http_server_send_status(prog, cbio, @@ -3736,8 +3736,9 @@ int cmp_main(int argc, char **argv) if ((srv_ctx = setup_srv_ctx(engine)) == NULL) goto err; + OSSL_CMP_CTX_set_transfer_cb_arg(cmp_ctx /* of client */, srv_ctx); + srv_cmp_ctx = OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx); - OSSL_CMP_CTX_set_transfer_cb_arg(cmp_ctx, srv_ctx); if (!OSSL_CMP_CTX_set_log_cb(srv_cmp_ctx, print_to_bio_err)) { CMP_err1("cannot set up error reporting and logging for %s", prog); goto err; diff --git a/doc/man3/OSSL_CMP_SRV_CTX_new.pod b/doc/man3/OSSL_CMP_SRV_CTX_new.pod index 7484a7a0496..35706dc6c3b 100644 --- a/doc/man3/OSSL_CMP_SRV_CTX_new.pod +++ b/doc/man3/OSSL_CMP_SRV_CTX_new.pod @@ -107,6 +107,7 @@ which may be due to normal successful end of the transaction or due to an error. OSSL_CMP_CTX_server_perform() is an interface to OSSL_CMP_SRV_process_request() that can be used by a CMP client in the same way as L. +In particular, the first parameter I is the B of the client. The B must be set as I of I. OSSL_CMP_SRV_CTX_new() creates and initializes an B structure -- 2.47.3