OSSL_PARAM_DUP(3SSL)
π OSSL_PARAM_DUP(3SSL) π
okay bestie, listen β this is the OSSL_PARAM array copy functions page, from the OpenSSL girlies β¨ (that's the 3SSL manual name, in case the vibe check needed a label π). It's the OSSL_PARAM_dup, OSSL_PARAM_merge, OSSL_PARAM_free, OSSL_PARAM_clear_free squad. Let's get into it π
πΈ NAME πΈ
OSSL_PARAM_dup, OSSL_PARAM_merge, OSSL_PARAM_free, OSSL_PARAM_clear_free β the OSSL_PARAM array copy functions π¦
β¨ SYNOPSIS β¨
#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);
void OSSL_PARAM_clear_free(OSSL_PARAM *params);
π DESCRIPTION π
So algorithm parameters can be exported/imported from/to providers using arrays of OSSL_PARAM(3) β that's just the whole thing, no cap. And the following utility functions let those parameters get duplicated and merged with other OSSL_PARAM(3), to assist in this process π«Ά
OSSL_PARAM_dup()β duplicates the parameter arrayparams. This function does a deep copy of the data. like truly a whole cloned situation, every byte copied down π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. This function does a shallow copy of the parameters. Eitherparamsorparams1may beNULL. The behaviour of the merge is unpredictable ifparamsandparams1contain the same key, and there are multiple entries within either array that have the same key π
bestie, read that last sentence again. if there's duplicate keys and multiple entries with that same key, the merge behaviour is unpredictable. chaotic. not the cute kind of chaotic. π
OSSL_PARAM_free()β frees the parameter arrayparamsthat was created usingOSSL_PARAM_dup(),OSSL_PARAM_merge()orOSSL_PARAM_BLD_to_param(). If the argument toOSSL_PARAM_free()isNULL, nothing is done. so it just respectfully minds its business β¨OSSL_PARAM_clear_free()β performs the same function asOSSL_PARAM_free()but additionally callsOPENSSL_cleanse()on the contents copied in. π§Ό
Note: only params built via theOSSL_PARAM_dup()orOSSL_PARAM_BLD_to_param()functions will be effectively cleared β parameters built any other way will still be freed but no cleanse operation will be performed. so like, the lil wipe-down only happens for those two build paths, everyone else just gets yeeted π
π RETURN VALUES π
- The functions
OSSL_PARAM_dup()andOSSL_PARAM_merge()return a newly allocatedOSSL_PARAM(3)array, orNULLif there was an error. - If both parameters are
NULLthenNULLis returned. π
π¦ SEE ALSO π¦
OSSL_PARAM(3), OSSL_PARAM_BLD(3)
π HISTORY π
- The
OSSL_PARAM_dup,OSSL_PARAM_mergeandOSSL_PARAM_freefunctions were added in OpenSSL 3.0. OSSL_PARAM_clear_freewas added in OpenSSL 4.0.0. the new girl on the block fr fr β¨
π 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, we ate and left no crumbs π
this lil masterpiece is from OpenSSL 4.0.3, dated 2026-09-29, and it lives in the OSSL_PARAM_DUP(3SSL) manual. go forth and deep-copy responsibly π«ΆπΈβ¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms