修正未初始化的字符串数组,修正ssl_version检查的逻辑。
This commit is contained in:
@@ -524,19 +524,28 @@ struct ssl_mgr * ssl_manager_init(const char * ini_profile, const char * section
|
|||||||
|
|
||||||
struct ssl_mgr * mgr = ALLOC(struct ssl_mgr, 1);
|
struct ssl_mgr * mgr = ALLOC(struct ssl_mgr, 1);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char version_str[TFE_SYMBOL_MAX];
|
|
||||||
|
char version_str[TFE_SYMBOL_MAX] = {};
|
||||||
mgr->logger = logger;
|
mgr->logger = logger;
|
||||||
mgr->ev_base_gc=ev_base_gc;
|
mgr->ev_base_gc=ev_base_gc;
|
||||||
MESA_load_profile_string_def(ini_profile, section, "ssl_min_version", version_str, sizeof(version_str), "ssl3");
|
MESA_load_profile_string_def(ini_profile, section, "ssl_min_version", version_str, sizeof(version_str), "ssl3");
|
||||||
mgr->ssl_min_version = sslver_str2num(version_str);
|
mgr->ssl_min_version = sslver_str2num(version_str);
|
||||||
MESA_load_profile_string_def(ini_profile, section, "ssl_max_version", version_str, sizeof(version_str), "tls12");
|
|
||||||
mgr->ssl_max_version = sslver_str2num(version_str);
|
|
||||||
|
|
||||||
if (mgr->ssl_min_version < 0)
|
if (mgr->ssl_min_version < 0)
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(logger, "Unsupported SSL/TLS protocol %s", version_str);
|
TFE_LOG_ERROR(logger, "Unsupported SSL/TLS protocol %s", version_str);
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MESA_load_profile_string_def(ini_profile, section, "ssl_max_version", version_str, sizeof(version_str), "tls12");
|
||||||
|
mgr->ssl_max_version = sslver_str2num(version_str);
|
||||||
|
|
||||||
|
if (mgr->ssl_max_version < 0)
|
||||||
|
{
|
||||||
|
TFE_LOG_ERROR(logger, "Unsupported SSL/TLS protocol %s", version_str);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
ret=ssl_init();
|
ret=ssl_init();
|
||||||
if(ret<0)
|
if(ret<0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user