OSSL_PARAM_DUP(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

✨ OSSL_PARAM_DUP β€” bestie edition ✨

okay so this is the 3ossl manual page for OSSL_PARAM_dup, OSSL_PARAM_merge, and OSSL_PARAM_free, and honestly? these three little functions are the backstage crew of parameter handling and nobody claps for them. we're clapping today. πŸ‘πŸ’…

🌸 NAME 🌸

OSSL_PARAM_dup, OSSL_PARAM_merge, OSSL_PARAM_free β€” the OSSL_PARAM array copy functions, aka the copy/merge/free trio πŸŽ€

⭐ 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);

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: algorithm parameters get exported/imported from/to providers using arrays of OSSL_PARAM(3). cute. and the following utility functions let you duplicate those parameters and merge them with other OSSL_PARAM(3) β€” they're literally here to help with that whole process. 🫢

  • OSSL_PARAM_dup() β€” duplicates the parameter array params. and not like a little lazy copy, bestie, this one does a deep copy of the data. the whole thing. icon behaviour. πŸ’…
  • OSSL_PARAM_merge() β€” merges the parameter arrays params and params1 into a brand new parameter array. if params and params1 contain values with the same 'key', then the value from params1 will replace the params value (params1 ate and left no crumbs πŸ’€). this function does a shallow copy of the parameters. either params or params1 may be NULL.
⚠️ warning bestie, real talk: the behaviour of the merge is unpredictable if params and params1 contain the same 'key', and there are multiple entries within either array that have the same key. no cap, it's giving chaos, so don't do that. πŸ™ˆ
  • OSSL_PARAM_free() β€” frees the parameter array params that was created using OSSL_PARAM_dup(), OSSL_PARAM_merge() or OSSL_PARAM_BLD_to_param(). and if the argument to OSSL_PARAM_free() is NULL, nothing is done β€” it just shrugs and moves on, main character energy. ✨

πŸ”₯ RETURN VALUES πŸ”₯

OSSL_PARAM_dup() and OSSL_PARAM_merge() return a newly allocated OSSL_PARAM(3) array, or NULL if there was an error 😭. and if both parameters are NULL then NULL is returned.

πŸ‘€ SEE ALSO πŸ‘€

OSSL_PARAM(3), OSSL_PARAM_BLD(3) β€” go read those too, iykyk πŸ“š

πŸ¦‹ HISTORY πŸ¦‹

these functions were added in OpenSSL 3.0. so they've been serving looks for a while now. πŸ’œ

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>.


k bye bestie, this page was brought to you by version 3.5.0, dated 2026-09-25 β€” mwah πŸ’‹βœ¨πŸŒˆ

πŸ“¦ where this page comes from