OpenSSL

密码学和 SSL/TLS 工具包

EVP_default_properties_enable_fips

NAME

EVP_set_default_properties、EVP_default_properties_enable_fips、EVP_default_properties_is_fips_enabled - 设置未来算法获取的默认属性

SYNOPSIS

 #include <openssl/evp.h>

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

DESCRIPTION

EVP_set_default_properties() 为所有未来 EVP 算法获取(隐式和显式)设置默认属性。有关隐式和显式获取的信息, 请参阅crypto(7) 中的“算法获取” 。

EVP_set_default_properties 将字符串propq 给定的属性存储在 EVP 数据中,这些数据存储在libctx给定的库上下文中(NULL 表示默认库上下文)。

指定库上下文的任何先前默认属性都将被删除。

如果enable非零, EVP_default_properties_enable_fips() 将 'fips=yes' 设置为默认属性,否则它会从给定libctx的默认属性查询中清除 'fips' 。它将 fips 默认属性查询与通过 EVP_set_default_properties() 设置的任何现有查询字符串合并。

EVP_default_properties_is_fips_enabled() 指示 'fips=yes' 是否是给定libctx的默认属性。

NOTES

EVP_set_default_properties() 和 EVP_default_properties_enable_fips() 不是线程安全的。它们仅在libctx的初始化阶段被调用。

RETURN VALUES

EVP_set_default_properties() 和 EVP_default_properties_enable_fips() 成功时返回 1,失败时返回 0。如果发生故障,错误将被放置在错误堆栈中。

如果为给定libctx设置了“fips=yes”默认属性,则 EVP_default_properties_is_fips_enabled() 返回 1 ,否则返回 0。

SEE ALSO

EVP_MD_fetch(3)

HISTORY

这里描述的功能是在 OpenSSL 3.0 中添加的。

版权所有 2019-2022 OpenSSL 项目作者。版权所有。

根据 Apache License 2.0(“许可证”)获得许可。除非遵守许可证,否则您不得使用此文件。您可以在源代码分发版或/source/license.html的 LICENSE 文件中获取副本。