在我们当前的环境中,安全运行扫描来寻找漏洞。OpenSSL (当前版本)不断出现一个问题,4-5个密码低于128kb的加密级别,并标记扫描仪。
由于知道客户端必须指定选项,因此在某些情况下,最好限制服务器接受低密码的选择。如果可以做到这一点,那么客户端请求什么就不重要了。有一个关于接受什么的配置选项有意义吗?
在我的具体案例中,我们正在测试一个用于文件传输的测试版软件,它将openSSL密码拉入其客户端。目前没有限制这一点的选项。
我也向测试版软件开发人员提出了类似的问题。
发布于 2013-08-27 20:29:00
您可以使用SSL_CTX_set_cipher_list()来限制密码列表。
#include <iostream>
#include <openssl/ssl.h>
// List of allowed ciphers in a colon-seperated list. Example limits ciphers to AES-256 only
const char *allowedCiphers = "AES256-SHA256:AES256-GCM-SHA38:DHE-RSA-AES256-SHA256";
bool SetCiphers(SSL *sslContext, const char *ciphers);
int main()
{
// Create a ssl context here etc.
SSL *ssl = ...;
// Set the allowed ciphers
if (!SetCiphers(ssl, allowedCiphers))
exit(-1);
// Process...
return 0;
}
bool SetCiphers(SSL *sslContext, const char *ciphers)
{
if (SSL_CTX_set_cipher_list(sslContext, ciphers) != 1)
{
std::cerr << L"[SSL_CTX_set_cipher_list] failed; could not find a suitable cipher in the provided list of ciphers \""
<< ciphers << "\"." << endl;
return false;
}
return true;
}在shell中运行openssl ciphers -v,查看系统上支持的密码列表。
https://stackoverflow.com/questions/18449332
复制相似问题