EVP_SET_DEFAULT_PROPERTIES(3ossl)
π 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()andEVP_default_properties_enable_fips()are not thread safe. π they're intended to be called only during the initialisation phase of alibctx. 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()andEVP_default_properties_enable_fips()return1on success, or0on failure. and if it fails, an error is placed on the error stack β so check it, bestie. πEVP_default_properties_is_fips_enabled()returns1if the'fips=yes'default property is set for the givenlibctx, otherwise it returns0. binary queen. πEVP_get1_default_properties()returns allocated memory that must be freed byOPENSSL_free(3)on success, andNULLon 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(), andEVP_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 π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms