OSSL_PARAM_DUP(3ossl)
β¨ OSSL_PARAM_DUP π
(that's the 3ossl manual page bestie, from the OpenSSL fam)
okay so picture this: you've got OSSL_PARAM_dup, OSSL_PARAM_merge, and OSSL_PARAM_free β the whole OSSL_PARAM array copy squad β and they are literally the friend group that handles duplicating and merging your param arrays for you. no cap. let's get into it π«Ά
πΈ SYNOPSIS πΈ
like, here's the receipt, verbatim:
#include <openssl/params.h>
OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *params);
OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *params, const OSSL_PARAM *params1);
void OSSL_PARAM_free(OSSL_PARAM *params);
π DESCRIPTION π
so algorithm parameters can be exported/imported from/to providers using arrays of OSSL_PARAM(3). and the following utility functions let you duplicate and merge those parameters with other OSSL_PARAM(3) arrays to help you out with that whole process. it's giving "helper functions that ate" β¨
OSSL_PARAM_dup()β duplicates the parameter arrayparams. and bestie, this one does a deep copy of the data. like, truly its own independent copy, none of that shared-reference nonsense πOSSL_PARAM_merge()β merges the parameter arraysparamsandparams1into a new parameter array. ifparamsandparams1contain values with the same'key', then the value fromparams1will replace the param value (soparams1wins the argument, iconic behavior honestly π ). heads up though: this function does a shallow copy of the parameters. also, eitherparamsorparams1may beNULL. and β οΈ the behaviour of the merge is unpredictable ifparamsandparams1contain the same key, and there are multiple entries within either array that have the same key. so like... don't do that, fr fr πOSSL_PARAM_free()β frees the parameter arrayparamsthat was created usingOSSL_PARAM_dup(),OSSL_PARAM_merge()orOSSL_PARAM_BLD_to_param(). and if the argument toOSSL_PARAM_free()isNULL, nothing is done β no drama, no crash, it just vibes π¦
π RETURN VALUES π
OSSL_PARAM_dup()andOSSL_PARAM_merge()return a newly allocatedOSSL_PARAM(3)array, orNULLif there was an error. and if both parameters areNULLthenNULLis returned. that's the whole story, periodt π
π SEE ALSO π
OSSL_PARAM(3), OSSL_PARAM_BLD(3) β go read those too, iykyk π
β HISTORY β
the functions were added in OpenSSL 3.0. so they're not ancient relics, they're relatively fresh π
π COPYRIGHT π
Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie π§ signing off from version 3.5.6, dated 2026-04-07, on the OSSL_PARAM_DUP(3ossl) manual page β stay slay, stay copied-deep, mwah ππΈ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms