From 23e648962e04af132c0841bec950b8a89b87fb2d Mon Sep 17 00:00:00 2001 From: Irak Rigia Date: Wed, 19 Apr 2023 19:36:29 +0530 Subject: Added a macro OSSL_DISPATCH_END as marker of the end of OSSL_DISPATCH arrays Also updated the corresponding documentations. Fixes #20710 Reviewed-by: Paul Dale Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20745) --- doc/man3/OSSL_DISPATCH.pod | 7 ++++--- doc/man7/provider-base.pod | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/man3/OSSL_DISPATCH.pod b/doc/man3/OSSL_DISPATCH.pod index 1aca4019dc..52b7f39945 100644 --- a/doc/man3/OSSL_DISPATCH.pod +++ b/doc/man3/OSSL_DISPATCH.pod @@ -2,7 +2,7 @@ =head1 NAME -OSSL_DISPATCH - OpenSSL Core type to define a dispatchable function table +OSSL_DISPATCH, OSSL_DISPATCH_END - OpenSSL Core type to define a dispatchable function table =head1 SYNOPSIS @@ -14,14 +14,15 @@ OSSL_DISPATCH - OpenSSL Core type to define a dispatchable function table void (*function)(void); }; + #define OSSL_DISPATCH_END + =head1 DESCRIPTION This type is a tuple of function identity and function pointer. Arrays of this type are passed between the OpenSSL libraries and the providers to describe what functionality one side provides to the other. -Arrays of this type must be terminated with a tuple having function identity -zero and function pointer NULL. +Arrays of this type must be terminated with the OSSL_DISPATCH_END macro. =head2 B fields diff --git a/doc/man7/provider-base.pod b/doc/man7/provider-base.pod index 4c38edb235..9f50771b38 100644 --- a/doc/man7/provider-base.pod +++ b/doc/man7/provider-base.pod @@ -751,7 +751,7 @@ operation C. static const OSSL_ITEM reasons[] = { { E_MALLOC, "memory allocation failure" }. - { 0, NULL } /* Termination */ + OSSL_DISPATCH_END }; /* @@ -831,7 +831,7 @@ operation C. { OSSL_FUNC_BAR_INIT, (void (*)(void))foo_init }, { OSSL_FUNC_BAR_UPDATE, (void (*)(void))foo_update }, { OSSL_FUNC_BAR_FINAL, (void (*)(void))foo_final }, - { 0, NULL } + OSSL_DISPATCH_END }; static const OSSL_ALGORITHM bars[] = { @@ -863,7 +863,7 @@ operation C. { OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))p_teardown }, { OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))p_query }, { OSSL_FUNC_PROVIDER_GET_REASON_STRINGS, (void (*)(void))p_reasons }, - { 0, NULL } + OSSL_DISPATCH_END }; int OSSL_provider_init(const OSSL_CORE_HANDLE *handle, -- cgit v1.2.1