EVP_SET_DEFAULT_PROPERTIES(3SSL)

πŸ’– EVP_SET_DEFAULT_PROPERTIES πŸ’–

okay bestie, pull up a chair, because this is the 3SSL page for the OpenSSL fam and it's genuinely iconic. it's all about managing default properties for future algorithm fetches β€” like, setting the vibe before the party even starts so every algorithm that shows up later already knows the dress code. πŸŽ€


✨ 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 mission. let's go. πŸ¦‹


🌸 DESCRIPTION 🌸

EVP_set_default_properties() sets the default properties for all future EVP algorithm fetches, both implicit and explicit. (if you're like "wait, what's the difference between implicit and explicit fetching?" β€” go read "ALGORITHM FETCHING" in crypto(7), it's all spelled out there, no cap.)

and like, what does it actually do? EVP_set_default_properties stores the properties you hand it in the string propq among the EVP data that's been stored in the library context you passed as libctx. btw NULL signifies the default library context, iykyk.

any previous default property for that specific library context? dropped. gone. not even a text back. πŸ’€

EVP_get1_default_properties() gets the default properties that are set for all future EVP algorithm fetches β€” again, implicit and explicit β€” for that specific library context. it's the "so what's the vibe rn" function.

EVP_default_properties_enable_fips() sets 'fips=yes' to be a default property if enable is non zero. if it's not non zero, it clears 'fips' from the default property query for the given libctx. and the ✨ cute part ✨ β€” it merges the fips default property query with any existing query strings that have been set via EVP_set_default_properties().

EVP_default_properties_is_fips_enabled() tells you if 'fips=yes' is a default property for the given libctx. and this is the default for every libctx on systems that are operating in FIPS-approved mode. main character systems only. πŸ‘‘


πŸ“ NOTES πŸ“

okay so real talk, listen up, this part matters.

EVP_set_default_properties() and EVP_default_properties_enable_fips() are not thread safe. they are intended to be called only during the initialisation phase of a libctx. so like, don't be chaotic about it, bestie. πŸ™ˆ

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. so if another thread is out here editing the properties while you're reading them? that's not a vibe. that's a race condition. 😭


πŸ’… RETURN VALUES πŸ’…

  • EVP_set_default_properties() and EVP_default_properties_enable_fips() β€” return 1 on success, or 0 on failure. and if a failure happens, an error is placed on the error stack. slay with the diagnostics.
  • EVP_default_properties_is_fips_enabled() β€” returns 1 if the 'fips=yes' default property is set for the given libctx, otherwise it returns 0.
  • EVP_get1_default_properties() β€” returns allocated memory that must be freed by OPENSSL_free(3) on success, and NULL on failure. free it. we do not leak in this house. 🫢

πŸ‘€ 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. she's new here but she's already iconic. ⭐

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


πŸŽ€ bye bestie πŸŽ€

this was EVP_SET_DEFAULT_PROPERTIES(3SSL) from OpenSSL 4.0.3, dated 2026-09-29. go set your defaults responsibly, stay thread-safe, and remember: properties are forever (until you EVP_set_default_properties() again and drop them). mwah. πŸ’–πŸŒˆβœ¨

πŸ“¦ where this page comes from