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