summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-07-27 21:51:44 +0200
committerPauli <paul.dale@oracle.com>2020-08-01 11:51:20 +1000
commit3c033c5bfed214b02c0f041239d1cb8a4e27fd82 (patch)
tree44b1c0c4c3dee36c6077dcdd7f894881a193cb91
parent319d0b2be96539f10628c98f37306655fd158f61 (diff)
DESERIALIZER: Refactor the constructor setting API
It's not the best idea to set a whole bunch of parameters in one call, that leads to functions that are hard to update. Better to re-model this into several function made to set one parameter each. This also renames "finalizer" to "constructor", which was suggested earlier but got lost at the time. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12544)
-rw-r--r--crypto/serializer/deserializer_lib.c60
-rw-r--r--crypto/serializer/deserializer_meth.c4
-rw-r--r--crypto/serializer/deserializer_pkey.c32
-rw-r--r--crypto/serializer/serializer_local.h8
-rw-r--r--doc/man3/OSSL_DESERIALIZER_from_bio.pod135
-rw-r--r--include/openssl/deserializer.h33
-rw-r--r--util/libcrypto.num7
-rw-r--r--util/other.syms4
8 files changed, 182 insertions, 101 deletions
diff --git a/crypto/serializer/deserializer_lib.c b/crypto/serializer/deserializer_lib.c
index d5401dcda3..912e9f8504 100644
--- a/crypto/serializer/deserializer_lib.c
+++ b/crypto/serializer/deserializer_lib.c
@@ -275,21 +275,62 @@ int OSSL_DESERIALIZER_CTX_num_deserializers(OSSL_DESERIALIZER_CTX *ctx)
return sk_OSSL_DESERIALIZER_INSTANCE_num(ctx->deser_insts);
}
-int OSSL_DESERIALIZER_CTX_set_finalizer(OSSL_DESERIALIZER_CTX *ctx,
- OSSL_DESERIALIZER_FINALIZER *finalizer,
- OSSL_DESERIALIZER_CLEANER *cleaner,
- void *finalize_arg)
+int OSSL_DESERIALIZER_CTX_set_construct(OSSL_DESERIALIZER_CTX *ctx,
+ OSSL_DESERIALIZER_CONSTRUCT *construct)
{
if (!ossl_assert(ctx != NULL)) {
ERR_raise(ERR_LIB_OSSL_DESERIALIZER, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- ctx->finalizer = finalizer;
- ctx->cleaner = cleaner;
- ctx->finalize_arg = finalize_arg;
+ ctx->construct = construct;
return 1;
}
+int OSSL_DESERIALIZER_CTX_set_construct_data(OSSL_DESERIALIZER_CTX *ctx,
+ void *construct_data)
+{
+ if (!ossl_assert(ctx != NULL)) {
+ ERR_raise(ERR_LIB_OSSL_DESERIALIZER, ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+ ctx->construct_data = construct_data;
+ return 1;
+}
+
+int OSSL_DESERIALIZER_CTX_set_cleanup(OSSL_DESERIALIZER_CTX *ctx,
+ OSSL_DESERIALIZER_CLEANUP *cleanup)
+{
+ if (!ossl_assert(ctx != NULL)) {
+ ERR_raise(ERR_LIB_OSSL_DESERIALIZER, ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+ ctx->cleanup = cleanup;
+ return 1;
+}
+
+OSSL_DESERIALIZER_CONSTRUCT *
+OSSL_DESERIALIZER_CTX_get_construct(OSSL_DESERIALIZER_CTX *ctx)
+{
+ if (ctx == NULL)
+ return NULL;
+ return ctx->construct;
+}
+
+void *OSSL_DESERIALIZER_CTX_get_construct_data(OSSL_DESERIALIZER_CTX *ctx)
+{
+ if (ctx == NULL)
+ return NULL;
+ return ctx->construct_data;
+}
+
+OSSL_DESERIALIZER_CLEANUP *
+OSSL_DESERIALIZER_CTX_get_cleanup(OSSL_DESERIALIZER_CTX *ctx)
+{
+ if (ctx == NULL)
+ return NULL;
+ return ctx->cleanup;
+}
+
int OSSL_DESERIALIZER_export(OSSL_DESERIALIZER_INSTANCE *deser_inst,
void *reference, size_t reference_sz,
OSSL_CALLBACK *export_cb, void *export_cbarg)
@@ -354,12 +395,13 @@ static int deser_process(const OSSL_PARAM params[], void *arg)
data->current_deser_inst_index);
deser = OSSL_DESERIALIZER_INSTANCE_deserializer(deser_inst);
- if (ctx->finalizer(deser_inst, params, ctx->finalize_arg)) {
+ if (ctx->construct != NULL
+ && ctx->construct(deser_inst, params, ctx->construct_data)) {
ok = 1;
goto end;
}
- /* The finalizer didn't return success */
+ /* The constructor didn't return success */
/*
* so we try to use the object we got and feed it to any next
diff --git a/crypto/serializer/deserializer_meth.c b/crypto/serializer/deserializer_meth.c
index 72da57707e..4739c2956d 100644
--- a/crypto/serializer/deserializer_meth.c
+++ b/crypto/serializer/deserializer_meth.c
@@ -539,8 +539,8 @@ OSSL_DESERIALIZER_INSTANCE_free(OSSL_DESERIALIZER_INSTANCE *deser_inst)
void OSSL_DESERIALIZER_CTX_free(OSSL_DESERIALIZER_CTX *ctx)
{
if (ctx != NULL) {
- if (ctx->cleaner != NULL)
- ctx->cleaner(ctx->finalize_arg);
+ if (ctx->cleanup != NULL)
+ ctx->cleanup(ctx->construct_data);
sk_OSSL_DESERIALIZER_INSTANCE_pop_free(ctx->deser_insts,
OSSL_DESERIALIZER_INSTANCE_free);
OSSL_DESERIALIZER_CTX_set_passphrase_ui(ctx, NULL, NULL);
diff --git a/crypto/serializer/deserializer_pkey.c b/crypto/serializer/deserializer_pkey.c
index fc77c6f005..e5e8bfda6f 100644
--- a/crypto/serializer/deserializer_pkey.c
+++ b/crypto/serializer/deserializer_pkey.c
@@ -107,11 +107,11 @@ struct deser_EVP_PKEY_data_st {
STACK_OF(EVP_KEYMGMT) *keymgmts; /* The EVP_KEYMGMTs we handle */
};
-static int deser_finalize_EVP_PKEY(OSSL_DESERIALIZER_INSTANCE *deser_inst,
- const OSSL_PARAM *params,
- void *finalize_arg)
+static int deser_construct_EVP_PKEY(OSSL_DESERIALIZER_INSTANCE *deser_inst,
+ const OSSL_PARAM *params,
+ void *construct_data)
{
- struct deser_EVP_PKEY_data_st *data = finalize_arg;
+ struct deser_EVP_PKEY_data_st *data = construct_data;
OSSL_DESERIALIZER *deser =
OSSL_DESERIALIZER_INSTANCE_deserializer(deser_inst);
void *deserctx = OSSL_DESERIALIZER_INSTANCE_deserializer_ctx(deser_inst);
@@ -225,13 +225,15 @@ static int deser_finalize_EVP_PKEY(OSSL_DESERIALIZER_INSTANCE *deser_inst,
return (*data->object != NULL);
}
-static void deser_clean_EVP_PKEY(void *finalize_arg)
+static void deser_clean_EVP_PKEY_construct_arg(void *construct_data)
{
- struct deser_EVP_PKEY_data_st *data = finalize_arg;
+ struct deser_EVP_PKEY_data_st *data = construct_data;
- sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
- OPENSSL_free(data->object_type);
- OPENSSL_free(data);
+ if (data != NULL) {
+ sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
+ OPENSSL_free(data->object_type);
+ OPENSSL_free(data);
+ }
}
DEFINE_STACK_OF_CSTRING()
@@ -353,17 +355,15 @@ OSSL_DESERIALIZER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey,
/* Finally, collect extra deserializers based on what we already have */
(void)OSSL_DESERIALIZER_CTX_add_extra(ctx, libctx, propquery);
- if (!OSSL_DESERIALIZER_CTX_set_finalizer(ctx, deser_finalize_EVP_PKEY,
- deser_clean_EVP_PKEY,
- data->process_data))
+ if (!OSSL_DESERIALIZER_CTX_set_construct(ctx, deser_construct_EVP_PKEY)
+ || !OSSL_DESERIALIZER_CTX_set_construct_data(ctx, data->process_data)
+ || !OSSL_DESERIALIZER_CTX_set_cleanup
+ (ctx, deser_clean_EVP_PKEY_construct_arg))
goto err;
data->process_data = NULL;
err:
- if (data->process_data != NULL)
- sk_EVP_KEYMGMT_pop_free(data->process_data->keymgmts,
- EVP_KEYMGMT_free);
- OPENSSL_free(data->process_data);
+ deser_clean_EVP_PKEY_construct_arg(data->process_data);
sk_OPENSSL_CSTRING_free(data->names);
OPENSSL_free(data);
return ctx;
diff --git a/crypto/serializer/serializer_local.h b/crypto/serializer/serializer_local.h
index 0417801248..d139e402d7 100644
--- a/crypto/serializer/serializer_local.h
+++ b/crypto/serializer/serializer_local.h
@@ -96,11 +96,11 @@ struct ossl_deserializer_ctx_st {
STACK_OF(OSSL_DESERIALIZER_INSTANCE) *deser_insts;
/*
- * The finalizer of a deserialization, and its caller argument.
+ * The constructors of a deserialization, and its caller argument.
*/
- OSSL_DESERIALIZER_FINALIZER *finalizer;
- OSSL_DESERIALIZER_CLEANER *cleaner;
- void *finalize_arg;
+ OSSL_DESERIALIZER_CONSTRUCT *construct;
+ OSSL_DESERIALIZER_CLEANUP *cleanup;
+ void *construct_data;
/* For any function that needs a passphrase reader */
OSSL_PASSPHRASE_CALLBACK *passphrase_cb;
diff --git a/doc/man3/OSSL_DESERIALIZER_from_bio.pod b/doc/man3/OSSL_DESERIALIZER_from_bio.pod
index 8c372a6cf6..1aa54899a5 100644
--- a/doc/man3/OSSL_DESERIALIZER_from_bio.pod
+++ b/doc/man3/OSSL_DESERIALIZER_from_bio.pod
@@ -9,9 +9,14 @@ OSSL_DESERIALIZER_CTX_add_deserializer,
OSSL_DESERIALIZER_CTX_add_extra,
OSSL_DESERIALIZER_CTX_num_deserializers,
OSSL_DESERIALIZER_INSTANCE,
-OSSL_DESERIALIZER_FINALIZER,
-OSSL_DESERIALIZER_CLEANER,
-OSSL_DESERIALIZER_CTX_set_finalizer,
+OSSL_DESERIALIZER_CONSTRUCT,
+OSSL_DESERIALIZER_CLEANUP,
+OSSL_DESERIALIZER_CTX_set_construct,
+OSSL_DESERIALIZER_CTX_set_construct_data,
+OSSL_DESERIALIZER_CTX_set_cleanup,
+OSSL_DESERIALIZER_CTX_get_construct,
+OSSL_DESERIALIZER_CTX_get_construct_data,
+OSSL_DESERIALIZER_CTX_get_cleanup,
OSSL_DESERIALIZER_export,
OSSL_DESERIALIZER_INSTANCE_deserializer,
OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
@@ -32,25 +37,32 @@ OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
int OSSL_DESERIALIZER_CTX_num_deserializers(OSSL_DESERIALIZER_CTX *ctx);
typedef struct ossl_deserializer_instance_st OSSL_DESERIALIZER_INSTANCE;
- typedef int (OSSL_DESERIALIZER_FINALIZER)
- (OSSL_DESERIALIZER_INSTANCE *deser_inst,
- const OSSL_PARAM *params, void *finalize_arg);
- typedef void (OSSL_DESERIALIZER_CLEANER)(void *finalize_arg);
+ OSSL_DESERIALIZER *OSSL_DESERIALIZER_INSTANCE_deserializer
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst);
+ void *OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst);
- int OSSL_DESERIALIZER_CTX_set_finalizer(OSSL_DESERIALIZER_CTX *ctx,
- OSSL_DESRIALIZER_FINALIZER *finalizer,
- OSSL_DESERIALIZER_CLEANER *cleaner,
- void *finalize_arg);
+ typedef int (OSSL_DESERIALIZER_CONSTRUCT)
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst,
+ const OSSL_PARAM *params, void *construct_data);
+ typedef void (OSSL_DESERIALIZER_CLEANUP)(void *construct_data);
+
+ int OSSL_DESERIALIZER_CTX_set_construct
+ (OSSL_DESERIALIZER_CTX *ctx, OSSL_DESERIALIZER_CONSTRUCT *construct);
+ int OSSL_DESERIALIZER_CTX_set_construct_data
+ (OSSL_DESERIALIZER_CTX *ctx, void *construct_data);
+ int OSSL_DESERIALIZER_CTX_set_cleanup(OSSL_DESERIALIZER_CTX *ctx,
+ OSSL_DESERIALIZER_CLEANUP *cleanup);
+ OSSL_DESERIALIZER_CONSTRUCT *
+ OSSL_DESERIALIZER_CTX_get_construct(OSSL_DESERIALIZER_CTX *ctx);
+ void *OSSL_DESERIALIZER_CTX_get_construct_data(OSSL_DESERIALIZER_CTX *ctx);
+ OSSL_DESERIALIZER_CLEANUP *
+ OSSL_DESERIALIZER_CTX_get_cleanup(OSSL_DESERIALIZER_CTX *ctx);
int OSSL_DESERIALIZER_export(OSSL_DESERIALIZER_INSTANCE *deser_inst,
void *reference, size_t reference_sz,
OSSL_CALLBACK *export_cb, void *export_cbarg);
- OSSL_DESERIALIZER *OSSL_DESERIALIZER_INSTANCE_deserializer
- (OSSL_DESERIALIZER_INSTANCE *deser_inst);
- void *OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
- (OSSL_DESERIALIZER_INSTANCE *deser_inst);
-
Feature availability macros:
=over 4
@@ -83,26 +95,23 @@ what type of input they have. In this case, OSSL_DESERIALIZER_from_bio()
will simply try with one deserializer implementation after the other, and
thereby discover what kind of input the caller gave it.
-For every deserialization done, even intermediary, a I<finalizer>
-provided by the caller is used to attempt to "finalize" the current
-deserialization output, which is always a provider side object of some
-sort, by "wrapping" it into some appropriate type or structure that
-the caller knows how to handle. Exactly what this "wrapping" consists
-of is entirely at the discretion of the I<finalizer>.
+For every deserialization done, even an intermediary one, a constructor
+provided by the caller is called to attempt to construct an appropriate type
+/ structure that the caller knows how to handle from the current
+deserialization result.
+The constructor is set with OSSL_DESERIALIZER_CTX_set_construct().
B<OSSL_DESERIALIZER_INSTANCE> is an opaque structure that contains
data about the deserializer that was just used, and that may be
-useful for the I<finalizer>. There are some functions to extract data
+useful for the constructor. There are some functions to extract data
from this type, described further down.
=head2 Functions
OSSL_DESERIALIZER_from_bio() runs the deserialization process for the
-context I<ctx>, with the input coming from the B<BIO> I<in>. The
-application is required to set up the B<BIO> properly, for example to
-have it in text or binary mode if that's appropriate.
-
-=for comment Know your deserializer!
+context I<ctx>, with the input coming from the B<BIO> I<in>. Should
+it make a difference, it's recommended to have the BIO set in binary
+mode rather than text mode.
OSSL_DESERIALIZER_from_fp() does the same thing as OSSL_DESERIALIZER_from_bio(),
except that the input is coming from the B<FILE> I<fp>.
@@ -122,17 +131,28 @@ description above.
OSSL_DESERIALIZER_CTX_num_deserializers() gets the number of
deserializers currently added to the context I<ctx>.
-OSSL_DESERIALIZER_CTX_set_finalizer() sets the I<finalizer> function
-together with the caller argument for the finalizer, I<finalize_arg>,
-as well as I<cleaner>, the function to clean up I<finalize_arg> when
-the deserialization has concluded.
+OSSL_DESERIALIZER_CTX_set_construct() sets the constructor I<construct>.
-OSSL_DESERIALIZER_export() is a fallback function for I<finalizers>
-that can't use the data they get directly for diverse reasons. It
-takes the same deserialize instance I<deser_inst> that the
-I<finalizer> got and an object I<reference>, unpacks the object that
-refers to, and exports it by creating an L<OSSL_PARAM(3)> array that
-it then passes to I<export_cb>, along with I<export_arg>.
+OSSL_DESERIALIZER_CTX_set_construct_data() sets the constructor data that is
+passed to the constructor every time it's called.
+
+OSSL_DESERIALIZER_CTX_set_cleanup() sets the constructor data I<cleanup>
+function. This is called by L<OSSL_DESERIALIZER_CTX_free(3)>.
+
+OSSL_DESERIALIZER_CTX_get_construct(),
+OSSL_DESERIALIZER_CTX_get_construct_data() and
+OSSL_DESERIALIZER_CTX_get_cleanup()
+return the values that have been set by
+OSSL_DESERIALIZER_CTX_set_construct(),
+OSSL_DESERIALIZER_CTX_set_construct_data() and
+OSSL_DESERIALIZER_CTX_set_cleanup() respectively.
+
+OSSL_DESERIALIZER_export() is a fallback function for constructors that
+cannot use the data they get directly for diverse reasons. It takes the same
+deserialize instance I<deser_inst> that the constructor got and an object
+I<reference>, unpacks the object which it refers to, and exports it by creating
+an L<OSSL_PARAM(3)> array that it then passes to I<export_cb>, along with
+I<export_arg>.
OSSL_DESERIALIZER_INSTANCE_deserializer() can be used to get the
deserializer method from a deserializer instance I<deser_inst>.
@@ -141,32 +161,31 @@ OSSL_DESERIALIZER_INSTANCE_deserializer-ctx() can be used to get the
deserializer method's provider context from a deserializer instance
I<deser_inst>.
-=head2 Finalizer
+=head2 Constructor
-The I<finalizer> gets the following arguments:
+A B<OSSL_DESERIALIZER_CONSTRUCT> gets the following arguments:
=over 4
=item I<deser_inst>
The B<OSSL_DESERIALIZER_INSTANCE> for the deserializer from which
-I<finalizer> gets its data.
+the constructor gets its data.
=item I<params>
The data produced by the deserializer, further described below.
-=item I<finalize_arg>
+=item I<construct_data>
-The pointer that was set with OSSL_DESERIALIZE_CTX_set_finalizer() as
-I<finalize_arg>.
+The pointer that was set with OSSL_DESERIALIZE_CTX_set_construct_data().
=back
-The I<finalizer> is expected to return 1 when the data it receives can
-be "finalized", otherwise 0.
+The constructor is expected to return 1 when the data it receives can
+be constructed, otherwise 0.
-The globally known parameters that I<finalize> can get in I<params>
+The globally known parameters that the constructor can get in I<params>
are:
=over 4
@@ -177,7 +196,7 @@ This is a detected content type that some deserializers may provide.
For example, PEM input sometimes has a type specified in its header,
and some deserializers may add that information as this parameter.
This is an optional parameter, but may be useful for extra checks in
-the I<finalizer>.
+the constructor.
=item "data" (B<OSSL_DESERIALIZER_PARAM_DATA>) <octet string>
@@ -185,7 +204,7 @@ The deserialized data itself, as an octet string. This is produced by
deserializers when it's possible to pass an object in this form. Most
often, this is simply meant to be passed to the next deserializer in a
chain, but could be considered final data as well, at the discretion
-of the I<finalizer>.
+of the constructor.
=item "reference" (B<OSSL_DESERIALIZER_PARAM_DATA>) <octet string>
@@ -197,11 +216,12 @@ provides I<deser>.
=back
At least one of "data" or "reference" must be present, and it's
-possible that both can be. A I<finalizer> should choose to use the
-"reference" parameter if possible, otherwise the "data" parameter.
+possible that both can be. A constructor should choose to use the
+"reference" parameter if possible, otherwise it should use the "data"
+parameter.
If it's not possible to use the "reference" parameter, but that's
-still what a I<finalizer> wants to do, it is possible to use
+still what a constructor wants to do, it is possible to use
OSSL_DESERIALIZER_export() as a fallback.
=head1 RETURN VALUES
@@ -210,10 +230,17 @@ OSSL_DESERIALIZER_from_bio() and OSSL_DESERIALIZER_from_fp() return 1 on
success, or 0 on failure.
OSSL_DESERIALIZER_CTX_add_deserializer(),
-OSSL_DESERIALIZER_CTX_add_extra(), and
-OSSL_DESERIALIZER_CTX_set_finalizer() return 1 on success, or 0 on
+OSSL_DESERIALIZER_CTX_add_extra(),
+OSSL_DESERIALIZER_CTX_set_construct(),
+OSSL_DESERIALIZER_CTX_set_construct_data() and
+OSSL_DESERIALIZER_CTX_set_cleanup() return 1 on success, or 0 on
failure.
+OSSL_DESERIALIZER_CTX_get_construct(),
+OSSL_DESERIALIZER_CTX_get_construct_data() and
+OSSL_DESERIALIZER_CTX_get_cleanup() return the current pointers to the
+cosntructor, the constructor data and the cleanup functions, respectively.
+
OSSL_DESERIALIZER_CTX_num_deserializers() returns the current
number of deserializers. It returns 0 if I<ctx> is NULL.
diff --git a/include/openssl/deserializer.h b/include/openssl/deserializer.h
index 7ac7496066..0133785b50 100644
--- a/include/openssl/deserializer.h
+++ b/include/openssl/deserializer.h
@@ -79,25 +79,32 @@ int OSSL_DESERIALIZER_CTX_add_extra(OSSL_DESERIALIZER_CTX *ctx,
int OSSL_DESERIALIZER_CTX_num_deserializers(OSSL_DESERIALIZER_CTX *ctx);
typedef struct ossl_deserializer_instance_st OSSL_DESERIALIZER_INSTANCE;
-typedef int (OSSL_DESERIALIZER_FINALIZER)
- (OSSL_DESERIALIZER_INSTANCE *deser_inst,
- const OSSL_PARAM *params, void *finalize_arg);
-typedef void (OSSL_DESERIALIZER_CLEANER)(void *finalize_arg);
+OSSL_DESERIALIZER *OSSL_DESERIALIZER_INSTANCE_deserializer
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst);
+void *OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst);
-int OSSL_DESERIALIZER_CTX_set_finalizer(OSSL_DESERIALIZER_CTX *ctx,
- OSSL_DESERIALIZER_FINALIZER *finalizer,
- OSSL_DESERIALIZER_CLEANER *cleaner,
- void *finalize_arg);
+typedef int (OSSL_DESERIALIZER_CONSTRUCT)
+ (OSSL_DESERIALIZER_INSTANCE *deser_inst,
+ const OSSL_PARAM *params, void *construct_data);
+typedef void (OSSL_DESERIALIZER_CLEANUP)(void *construct_data);
+
+int OSSL_DESERIALIZER_CTX_set_construct(OSSL_DESERIALIZER_CTX *ctx,
+ OSSL_DESERIALIZER_CONSTRUCT *construct);
+int OSSL_DESERIALIZER_CTX_set_construct_data(OSSL_DESERIALIZER_CTX *ctx,
+ void *construct_data);
+int OSSL_DESERIALIZER_CTX_set_cleanup(OSSL_DESERIALIZER_CTX *ctx,
+ OSSL_DESERIALIZER_CLEANUP *cleanup);
+OSSL_DESERIALIZER_CONSTRUCT *
+OSSL_DESERIALIZER_CTX_get_construct(OSSL_DESERIALIZER_CTX *ctx);
+void *OSSL_DESERIALIZER_CTX_get_construct_data(OSSL_DESERIALIZER_CTX *ctx);
+OSSL_DESERIALIZER_CLEANUP *
+OSSL_DESERIALIZER_CTX_get_cleanup(OSSL_DESERIALIZER_CTX *ctx);
int OSSL_DESERIALIZER_export(OSSL_DESERIALIZER_INSTANCE *deser_inst,
void *reference, size_t reference_sz,
OSSL_CALLBACK *export_cb, void *export_cbarg);
-OSSL_DESERIALIZER *OSSL_DESERIALIZER_INSTANCE_deserializer
- (OSSL_DESERIALIZER_INSTANCE *deser_inst);
-void *OSSL_DESERIALIZER_INSTANCE_deserializer_ctx
- (OSSL_DESERIALIZER_INSTANCE *deser_inst);
-
int OSSL_DESERIALIZER_from_bio(OSSL_DESERIALIZER_CTX *ctx, BIO *in);
#ifndef OPENSSL_NO_STDIO
int OSSL_DESERIALIZER_from_fp(OSSL_DESERIALIZER_CTX *ctx, FILE *in);
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 0c94a3e7dc..b1c7947b86 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -5171,7 +5171,6 @@ OSSL_DESERIALIZER_from_fp ? 3_0_0 EXIST::FUNCTION:STDIO
OSSL_DESERIALIZER_CTX_add_deserializer ? 3_0_0 EXIST::FUNCTION:
OSSL_DESERIALIZER_CTX_add_extra ? 3_0_0 EXIST::FUNCTION:
OSSL_DESERIALIZER_CTX_num_deserializers ? 3_0_0 EXIST::FUNCTION:
-OSSL_DESERIALIZER_CTX_set_finalizer ? 3_0_0 EXIST::FUNCTION:
OSSL_DESERIALIZER_CTX_set_input_type ? 3_0_0 EXIST::FUNCTION:
OSSL_DESERIALIZER_export ? 3_0_0 EXIST::FUNCTION:
OSSL_DESERIALIZER_INSTANCE_deserializer ? 3_0_0 EXIST::FUNCTION:
@@ -5192,3 +5191,9 @@ EVP_PKEY_get1_ED25519 ? 3_0_0 EXIST::FUNCTION:EC
EVP_PKEY_set1_ED448 ? 3_0_0 EXIST::FUNCTION:EC
EVP_PKEY_get0_ED448 ? 3_0_0 EXIST::FUNCTION:EC
EVP_PKEY_get1_ED448 ? 3_0_0 EXIST::FUNCTION:EC
+OSSL_DESERIALIZER_CTX_set_construct ? 3_0_0 EXIST::FUNCTION:
+OSSL_DESERIALIZER_CTX_set_construct_data ? 3_0_0 EXIST::FUNCTION:
+OSSL_DESERIALIZER_CTX_set_cleanup ? 3_0_0 EXIST::FUNCTION:
+OSSL_DESERIALIZER_CTX_get_construct ? 3_0_0 EXIST::FUNCTION:
+OSSL_DESERIALIZER_CTX_get_construct_data ? 3_0_0 EXIST::FUNCTION:
+OSSL_DESERIALIZER_CTX_get_cleanup ? 3_0_0 EXIST::FUNCTION:
diff --git a/util/other.syms b/util/other.syms
index a8eda47bde..bfe320396b 100644
--- a/util/other.syms
+++ b/util/other.syms
@@ -43,8 +43,8 @@ OPENSSL_CTX datatype
NAMING_AUTHORITY datatype
OSSL_DESERIALIZER datatype
OSSL_DESERIALIZER_CTX datatype
-OSSL_DESERIALIZER_FINALIZER datatype
-OSSL_DESERIALIZER_CLEANER datatype
+OSSL_DESERIALIZER_CONSTRUCT datatype
+OSSL_DESERIALIZER_CLEANUP datatype
OSSL_DESERIALIZER_INSTANCE datatype
OSSL_DESERIALIZER_CTX datatype
OSSL_HTTP_bio_cb_t datatype