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()andEVP_default_properties_enable_fips()β return1on success, or0on failure. and if a failure happens, an error is placed on the error stack. slay with the diagnostics.EVP_default_properties_is_fips_enabled()β returns1if the'fips=yes'default property is set for the givenlibctx, otherwise it returns0.EVP_get1_default_properties()β returns allocated memory that must be freed byOPENSSL_free(3)on success, andNULLon failure. free it. we do not leak in this house. π«Ά
π SEE ALSO π
π°οΈ HISTORY π°οΈ
- the functions
EVP_set_default_properties(),EVP_default_properties_enable_fips(), andEVP_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 π
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
- 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