提交 b4bb825f 编写于 作者: F FdaSilvaYY 提交者: Rich Salz

Constify engine/eng_cnf.c internal method.

simplify and reindent some related code.
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1300)
上级 80f397e2
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
/* ENGINE config module */ /* ENGINE config module */
static char *skip_dot(char *name) static const char *skip_dot(const char *name)
{ {
char *p; const char *p = strchr(name, '.');
p = strchr(name, '.');
if (p) if (p != NULL)
return p + 1; return p + 1;
return name; return name;
} }
...@@ -38,14 +38,14 @@ static int int_engine_init(ENGINE *e) ...@@ -38,14 +38,14 @@ static int int_engine_init(ENGINE *e)
return 1; return 1;
} }
static int int_engine_configure(char *name, char *value, const CONF *cnf) static int int_engine_configure(const char *name, const char *value, const CONF *cnf)
{ {
int i; int i;
int ret = 0; int ret = 0;
long do_init = -1; long do_init = -1;
STACK_OF(CONF_VALUE) *ecmds; STACK_OF(CONF_VALUE) *ecmds;
CONF_VALUE *ecmd = NULL; CONF_VALUE *ecmd = NULL;
char *ctrlname, *ctrlvalue; const char *ctrlname, *ctrlvalue;
ENGINE *e = NULL; ENGINE *e = NULL;
int soft = 0; int soft = 0;
......
...@@ -241,15 +241,15 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, ...@@ -241,15 +241,15 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
int num, flags; int num, flags;
long l; long l;
char *ptr; char *ptr;
if ((e == NULL) || (cmd_name == NULL)) { if ((e == NULL) || (cmd_name == NULL)) {
ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING, ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING,
ERR_R_PASSED_NULL_PARAMETER); ERR_R_PASSED_NULL_PARAMETER);
return 0; return 0;
} }
if ((e->ctrl == NULL) || ((num = ENGINE_ctrl(e, if (e->ctrl == NULL
ENGINE_CTRL_GET_CMD_FROM_NAME, || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
0, (void *)cmd_name, 0, (void *)cmd_name, NULL)) <= 0) {
NULL)) <= 0)) {
/* /*
* If the command didn't *have* to be supported, we fake success. * If the command didn't *have* to be supported, we fake success.
* This allows certain settings to be specified for multiple ENGINEs * This allows certain settings to be specified for multiple ENGINEs
...@@ -270,8 +270,9 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, ...@@ -270,8 +270,9 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
ENGINE_R_CMD_NOT_EXECUTABLE); ENGINE_R_CMD_NOT_EXECUTABLE);
return 0; return 0;
} }
if ((flags =
ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num, NULL, NULL)) < 0) { flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num, NULL, NULL);
if (flags < 0) {
/* /*
* Shouldn't happen, given that ENGINE_cmd_is_executable() returned * Shouldn't happen, given that ENGINE_cmd_is_executable() returned
* success. * success.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册