xref: /freebsd/crypto/openssl/doc/man3/OSSL_PARAM_dup.pod (revision a7148ab39c03abd4d1a84997c70bf96f15dd2a09)
1b077aed3SPierre Pronchery=pod
2b077aed3SPierre Pronchery
3b077aed3SPierre Pronchery=head1 NAME
4b077aed3SPierre Pronchery
5b077aed3SPierre ProncheryOSSL_PARAM_dup, OSSL_PARAM_merge, OSSL_PARAM_free
6b077aed3SPierre Pronchery- OSSL_PARAM array copy functions
7b077aed3SPierre Pronchery
8b077aed3SPierre Pronchery=head1 SYNOPSIS
9b077aed3SPierre Pronchery
10b077aed3SPierre Pronchery #include <openssl/params.h>
11b077aed3SPierre Pronchery
12b077aed3SPierre Pronchery OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *params);
13b077aed3SPierre Pronchery OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *params, const OSSL_PARAM *params1);
14b077aed3SPierre Pronchery void OSSL_PARAM_free(OSSL_PARAM *params);
15b077aed3SPierre Pronchery
16b077aed3SPierre Pronchery=head1 DESCRIPTION
17b077aed3SPierre Pronchery
18b077aed3SPierre ProncheryAlgorithm parameters can be exported/imported from/to providers using arrays of
19b077aed3SPierre ProncheryL<OSSL_PARAM(3)>. The following utility functions allow the parameters to be
20b077aed3SPierre Proncheryduplicated and merged with other L<OSSL_PARAM(3)> to assist in this process.
21b077aed3SPierre Pronchery
22b077aed3SPierre ProncheryOSSL_PARAM_dup() duplicates the parameter array I<params>. This function does a
23b077aed3SPierre Proncherydeep copy of the data.
24b077aed3SPierre Pronchery
25b077aed3SPierre ProncheryOSSL_PARAM_merge() merges the parameter arrays I<params> and I<params1> into a
26b077aed3SPierre Proncherynew parameter array. If I<params> and I<params1> contain values with the same
27b077aed3SPierre Pronchery'key' then the value from I<params1> will replace the I<param> value. This
28b077aed3SPierre Proncheryfunction does a shallow copy of the parameters. Either I<params> or I<params1>
29b077aed3SPierre Proncherymay be NULL. The behaviour of the merge is unpredictable if I<params> and
30b077aed3SPierre ProncheryI<params1> contain the same key, and there are multiple entries within either
31b077aed3SPierre Proncheryarray that have the same key.
32b077aed3SPierre Pronchery
33b077aed3SPierre ProncheryOSSL_PARAM_free() frees the parameter array I<params> that was created using
34b077aed3SPierre ProncheryOSSL_PARAM_dup(), OSSL_PARAM_merge() or OSSL_PARAM_BLD_to_param().
35*a7148ab3SEnji CooperIf the argument to OSSL_PARAM_free() is NULL, nothing is done.
36b077aed3SPierre Pronchery
37b077aed3SPierre Pronchery=head1 RETURN VALUES
38b077aed3SPierre Pronchery
39b077aed3SPierre ProncheryThe functions OSSL_PARAM_dup() and OSSL_PARAM_merge() return a newly allocated
40b077aed3SPierre ProncheryL<OSSL_PARAM(3)> array, or NULL if there was an error. If both parameters are NULL
41b077aed3SPierre Pronchery then NULL is returned.
42b077aed3SPierre Pronchery
43b077aed3SPierre Pronchery=head1 SEE ALSO
44b077aed3SPierre Pronchery
45b077aed3SPierre ProncheryL<OSSL_PARAM(3)>, L<OSSL_PARAM_BLD(3)>
46b077aed3SPierre Pronchery
47b077aed3SPierre Pronchery=head1 HISTORY
48b077aed3SPierre Pronchery
49b077aed3SPierre ProncheryThe functions were added in OpenSSL 3.0.
50b077aed3SPierre Pronchery
51b077aed3SPierre Pronchery=head1 COPYRIGHT
52b077aed3SPierre Pronchery
53*a7148ab3SEnji CooperCopyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
54b077aed3SPierre Pronchery
55b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
56b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
57b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
58b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
59b077aed3SPierre Pronchery
60b077aed3SPierre Pronchery=cut
61