]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/cmp.c and doc/man3: add clarifying comments and doc line on CMP context used...
authorDr. David von Oheimb <dev@ddvo.net>
Fri, 10 Oct 2025 18:36:49 +0000 (20:36 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Thu, 16 Oct 2025 17:38:46 +0000 (19:38 +0200)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28891)

apps/cmp.c
doc/man3/OSSL_CMP_SRV_CTX_new.pod

index 6f2fea4f5569e96a422faa6f933dc4459cce3b80..185210b1271ddd428de1ccd43952daedff01b5b1 100644 (file)
@@ -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;
index 7484a7a04966eb57846f60ae3a2489465cee1c2f..35706dc6c3bd396d0daf33f949ac4e8a436d4791 100644 (file)
@@ -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<OSSL_CMP_MSG_http_perform(3)>.
+In particular, the first parameter I<client_ctx> is the B<OSSL_CMP_CTX> of the client.
 The B<OSSL_CMP_SRV_CTX> must be set as I<transfer_cb_arg> of I<client_ctx>.
 
 OSSL_CMP_SRV_CTX_new() creates and initializes an B<OSSL_CMP_SRV_CTX> structure