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