文档说
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/