提交 878b5d07 编写于 作者: D Dr. Stephen Henson

use correct return values when callin cmd

上级 191b3f0b
...@@ -319,7 +319,7 @@ static int cmd_cipher_list(SSL_CONF_CTX *cctx, const char *value) ...@@ -319,7 +319,7 @@ static int cmd_cipher_list(SSL_CONF_CTX *cctx, const char *value)
rv = SSL_CTX_set_cipher_list(cctx->ctx, value); rv = SSL_CTX_set_cipher_list(cctx->ctx, value);
if (cctx->ssl) if (cctx->ssl)
rv = SSL_set_cipher_list(cctx->ssl, value); rv = SSL_set_cipher_list(cctx->ssl, value);
return rv; return rv > 0;
} }
static int cmd_protocol(SSL_CONF_CTX *cctx, const char *value) static int cmd_protocol(SSL_CONF_CTX *cctx, const char *value)
...@@ -434,16 +434,20 @@ int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value) ...@@ -434,16 +434,20 @@ int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value)
if (runcmd) if (runcmd)
{ {
int rv;
if (value == NULL) if (value == NULL)
return -3; return -3;
if (t->cmd(cctx, value)) rv = t->cmd(cctx, value);
if (rv > 0)
return 2; return 2;
if (rv == -2)
return -2;
if (cctx->flags & SSL_CONF_FLAG_SHOW_ERRORS) if (cctx->flags & SSL_CONF_FLAG_SHOW_ERRORS)
{ {
SSLerr(SSL_F_SSL_CONF_CTX_CMD, SSL_R_BAD_VALUE); SSLerr(SSL_F_SSL_CONF_CTX_CMD, SSL_R_BAD_VALUE);
ERR_add_error_data(4, "cmd=", cmd, ", value=", value); ERR_add_error_data(4, "cmd=", cmd, ", value=", value);
} }
return -1; return 0;
} }
if (cctx->flags & SSL_CONF_FLAG_CMDLINE) if (cctx->flags & SSL_CONF_FLAG_CMDLINE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册