ssl - 不明白 OpenSSL_add_all_algorithms 方法

标签 ssl openssl

文档说

OpenSSL keeps an internal table of digest algorithms and ciphers. It uses this table to lookup ciphers via functions such as EVP_get_cipher_byname().

OpenSSL_add_all_digests() adds all digest algorithms to the table.

我的问题是,这张表存储在哪里?我的代码如何知道此方法已执行?...它在内部如何工作,如果我想要更多 SSL 连接和一个添加所有摘要而一个不添加怎么办? 有人知道这方面的任何好的文档吗?

谢谢

最佳答案

手册页的 NOTES 部分几乎总结了它:

A typical application will call OpenSSL_add_all_algorithms() initially and EVP_cleanup() before exiting.

The cipher and digest lookup functions are used in many parts of the library. If the table is not initialized several functions will misbehave and complain they cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries. This is a common query in the OpenSSL mailing lists.

假设您正在编写一个典型的应用程序,您将把它添加到您的 OpenSSL 初始化代码中:

OpenSSL_add_all_algorithms();

这是 OpenSSL 清理代码:

EVP_cleanup();

你就完成了。您始终有责任在使用 OpenSSL 的应用程序中自行调用这些。如果您想知道 OpenSSL 如何在内部存储表,use the source, Luke .

要控制哪些密码可用于特定的 SSL 上下文,您可以使用 SSL_CTX_set_cipher_list .

至于比手册页更好的文档,我可以推荐 "Network Security with OpenSSL" by John Viega, Matt Messier & Pravir Chandra .这本书很旧,没有涵盖较新版本的 OpenSSL,但其中大部分内容仍然非常适用。

关于ssl - 不明白 OpenSSL_add_all_algorithms 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14489731/

相关文章:

c - 如何将 pem 公钥转换为 openssl RSA* 结构

node.js - 从 Node.js 访问 OpenSSL 的不同方法

java - 创建 keystore 并将证书附加到其中后, keystore 格式无效

google-chrome - 浏览器中的 Ec2 公共(public) DNS 和地址 net::ERR_INSECURE_RESPONSE

ssl - 由于强制 ssl 导致网络重定向循环

c - 根CA的SSL_CTX_set_verify()回调和深度

linux - 使用 ELDK-5.3 交叉编译,在 eldk 5.3 中使用 openssl,未找到 openssl/crypto.h

tomcat - 生成功能性 keystore Tomcat 7.0、Windows 7

ssl - 为什么我们得到 "tls handshake error using curl"?

authentication - 仅使用 ssl 进行用户识别