EVP_SET_DEFAULT_PROPERTIES(3ossl)

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

πŸ’… EVP_SET_DEFAULT_PROPERTIES πŸ’…

okay so this is the 3ossl girlies' guide to managing default properties for future algorithm fetches β€” like, you're setting the vibe for every algorithm fetch that happens after this, bestie. no cap. πŸŽ€


✨ SYNOPSIS ✨

#include <openssl/evp.h>

int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq);
char *EVP_get1_default_properties(OSSL_LIB_CTX *libctx);
int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx);

four functions, one header, we love to see it 🫢


🌸 DESCRIPTION 🌸

EVP_set_default_properties() β€” the main character πŸ‘‘

EVP_set_default_properties() sets the default properties for all future EVP algorithm fetches, implicit as well as explicit. literally both. see "ALGORITHM FETCHING" in crypto(7) if you need the lore on implicit vs explicit fetching, iykyk.

it stores the properties you hand it in the string propq among the EVP data that's been stored in the library context given by libctx. and psst β€” NULL signifies the default library context, so don't panic if you see that. πŸ¦‹

heads up: any previous default property for the specified library context will be dropped. it's giving "out with the old", fr fr. πŸ’€

EVP_get1_default_properties() β€” the receipts getter 🧾

gets the default properties that are set for all future EVP algorithm fetches β€” implicit as well as explicit β€” for that specific library context. slay, now you can actually see what's going on. ✨

EVP_default_properties_enable_fips() β€” fips era πŸ’…

sets 'fips=yes' to be a default property if enable is non-zero. otherwise? it clears 'fips' from the default property query for the given libctx. iconic duality tbh.

and the important bit: it merges the fips default property query with any existing query strings that have been set via EVP_set_default_properties(). so your old settings aren't ghosted β€” they're combined. 🫢

EVP_default_properties_is_fips_enabled() β€” vibe check πŸ”₯

tells you if 'fips=yes' is a default property for the given libctx. simple as that, bestie.


⭐ NOTES ⭐

okay this part is the "be careful" part, so listen up:

  • EVP_set_default_properties() and EVP_default_properties_enable_fips() are not thread safe. 😭 they're intended to be called only during the initialisation phase of a libctx. like, setup era only. don't be calling these mid-party.
  • EVP_get1_default_properties() is also not thread safe. the application must ensure that the context reference is valid and that default fetching properties are not being modified by a different thread. no sneaky concurrent edits, periodt. πŸ’€

🌈 RETURN VALUES 🌈

  • EVP_set_default_properties() and EVP_default_properties_enable_fips() return 1 on success, or 0 on failure. and if it fails, an error is placed on the error stack β€” so check it, bestie. πŸŽ€
  • EVP_default_properties_is_fips_enabled() returns 1 if the 'fips=yes' default property is set for the given libctx, otherwise it returns 0. binary queen. πŸ‘‘
  • EVP_get1_default_properties() returns allocated memory that must be freed by OPENSSL_free(3) on success, and NULL on failure. don't forget the free or you're leaking, and that's not the vibe. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹


🧚 HISTORY 🧚

  • the functions EVP_set_default_properties(), EVP_default_properties_enable_fips(), and EVP_default_properties_is_fips_enabled() were added in OpenSSL 3.0.
  • the function EVP_get1_default_properties() was added in OpenSSL 3.5. the newbie of the group, we stan. πŸ’œ

Copyright 2019-2021 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!! πŸŽ€βœ¨ this one's from OpenSSL 3.5.0, dated 2026-09-25 β€” go forth and set those default properties responsibly πŸ’…πŸ«Ά

πŸ“¦ where this page comes from