Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
2cd3ad9b
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2cd3ad9b
编写于
6月 20, 2001
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify "openssl engine" to handle and display internal control
commands appropriately.
上级
323f289c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
52 deletion
+69
-52
apps/engine.c
apps/engine.c
+69
-52
未找到文件。
apps/engine.c
浏览文件 @
2cd3ad9b
...
@@ -72,9 +72,10 @@
...
@@ -72,9 +72,10 @@
static
char
*
engine_usage
[]
=
{
static
char
*
engine_usage
[]
=
{
"usage: engine opts [engine ...]
\n
"
,
"usage: engine opts [engine ...]
\n
"
,
" -v[v[v
]]
- verbose mode, for each engine, list its 'control commands'
\n
"
,
" -v[v[v
[v]]]
- verbose mode, for each engine, list its 'control commands'
\n
"
,
" -vv will additionally display each command's description
\n
"
,
" -vv will additionally display each command's description
\n
"
,
" -vvv will also add the input flags for each command
\n
"
,
" -vvv will also add the input flags for each command
\n
"
,
" -vvvv will also show internal input flags
\n
"
,
" -c - for each engine, also list the capabilities
\n
"
,
" -c - for each engine, also list the capabilities
\n
"
,
" -t - for each engine, check that they are really available
\n
"
,
" -t - for each engine, check that they are really available
\n
"
,
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts
\n
"
,
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts
\n
"
,
...
@@ -135,8 +136,20 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
...
@@ -135,8 +136,20 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
BIO_printf
(
bio_out
,
"<no flags>
\n
"
);
BIO_printf
(
bio_out
,
"<no flags>
\n
"
);
return
1
;
return
1
;
}
}
/* If the object is internal, mark it in a way that shows instead of
* having it part of all the other flags, even if it really is. */
if
(
flags
&
ENGINE_CMD_FLAG_INTERNAL
)
{
BIO_printf
(
bio_out
,
"[Internal] "
);
}
if
(
flags
&
ENGINE_CMD_FLAG_NUMERIC
)
if
(
flags
&
ENGINE_CMD_FLAG_NUMERIC
)
{
{
if
(
started
)
{
BIO_printf
(
bio_out
,
"|"
);
err
=
1
;
}
BIO_printf
(
bio_out
,
"NUMERIC"
);
BIO_printf
(
bio_out
,
"NUMERIC"
);
started
=
1
;
started
=
1
;
}
}
...
@@ -167,7 +180,8 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
...
@@ -167,7 +180,8 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
/* Check for unknown flags */
/* Check for unknown flags */
flags
=
flags
&
~
ENGINE_CMD_FLAG_NUMERIC
&
flags
=
flags
&
~
ENGINE_CMD_FLAG_NUMERIC
&
~
ENGINE_CMD_FLAG_STRING
&
~
ENGINE_CMD_FLAG_STRING
&
~
ENGINE_CMD_FLAG_NO_INPUT
;
~
ENGINE_CMD_FLAG_NO_INPUT
&
~
ENGINE_CMD_FLAG_INTERNAL
;
if
(
flags
)
if
(
flags
)
{
{
if
(
started
)
BIO_printf
(
bio_out
,
"|"
);
if
(
started
)
BIO_printf
(
bio_out
,
"|"
);
...
@@ -205,60 +219,63 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
...
@@ -205,60 +219,63 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
goto
err
;
goto
err
;
do
{
do
{
int
len
;
int
len
;
/* Get the command name */
if
((
len
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_NAME_LEN_FROM_CMD
,
num
,
NULL
,
NULL
))
<=
0
)
goto
err
;
if
((
name
=
OPENSSL_malloc
(
len
+
1
))
==
NULL
)
goto
err
;
if
(
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_NAME_FROM_CMD
,
num
,
name
,
NULL
)
<=
0
)
goto
err
;
/* Get the command description */
if
((
len
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_DESC_LEN_FROM_CMD
,
num
,
NULL
,
NULL
))
<
0
)
goto
err
;
if
(
len
>
0
)
{
if
((
desc
=
OPENSSL_malloc
(
len
+
1
))
==
NULL
)
goto
err
;
if
(
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_DESC_FROM_CMD
,
num
,
desc
,
NULL
)
<=
0
)
goto
err
;
}
/* Get the command input flags */
/* Get the command input flags */
if
((
flags
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_CMD_FLAGS
,
num
,
if
((
flags
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_CMD_FLAGS
,
num
,
NULL
,
NULL
))
<
0
)
NULL
,
NULL
))
<
0
)
goto
err
;
goto
err
;
/* Now decide on the output */
if
(
!
(
flags
&
ENGINE_CMD_FLAG_INTERNAL
)
||
verbose
>=
4
)
if
(
xpos
==
0
)
{
/* Do an indent */
/* Get the command name */
xpos
=
BIO_printf
(
bio_out
,
indent
);
if
((
len
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_NAME_LEN_FROM_CMD
,
num
,
else
NULL
,
NULL
))
<=
0
)
/* Otherwise prepend a ", " */
goto
err
;
xpos
+=
BIO_printf
(
bio_out
,
", "
);
if
((
name
=
OPENSSL_malloc
(
len
+
1
))
==
NULL
)
if
(
verbose
==
1
)
goto
err
;
{
if
(
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_NAME_FROM_CMD
,
num
,
name
,
/* We're just listing names, comma-delimited */
NULL
)
<=
0
)
if
((
xpos
>
(
int
)
strlen
(
indent
))
&&
goto
err
;
/* Get the command description */
if
((
len
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_DESC_LEN_FROM_CMD
,
num
,
NULL
,
NULL
))
<
0
)
goto
err
;
if
(
len
>
0
)
{
if
((
desc
=
OPENSSL_malloc
(
len
+
1
))
==
NULL
)
goto
err
;
if
(
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_DESC_FROM_CMD
,
num
,
desc
,
NULL
)
<=
0
)
goto
err
;
}
/* Now decide on the output */
if
(
xpos
==
0
)
/* Do an indent */
xpos
=
BIO_printf
(
bio_out
,
indent
);
else
/* Otherwise prepend a ", " */
xpos
+=
BIO_printf
(
bio_out
,
", "
);
if
(
verbose
==
1
)
{
/* We're just listing names, comma-delimited */
if
((
xpos
>
(
int
)
strlen
(
indent
))
&&
(
xpos
+
(
int
)
strlen
(
name
)
>
line_wrap
))
(
xpos
+
(
int
)
strlen
(
name
)
>
line_wrap
))
{
{
BIO_printf
(
bio_out
,
"
\n
"
);
BIO_printf
(
bio_out
,
"
\n
"
);
xpos
=
BIO_printf
(
bio_out
,
indent
);
xpos
=
BIO_printf
(
bio_out
,
indent
);
}
}
xpos
+=
BIO_printf
(
bio_out
,
"%s"
,
name
);
xpos
+=
BIO_printf
(
bio_out
,
"%s"
,
name
);
}
}
else
else
{
{
/* We're listing names plus descriptions */
/* We're listing names plus descriptions */
BIO_printf
(
bio_out
,
"%s: %s
\n
"
,
name
,
BIO_printf
(
bio_out
,
"%s: %s
\n
"
,
name
,
(
desc
==
NULL
)
?
"<no description>"
:
desc
);
(
desc
==
NULL
)
?
"<no description>"
:
desc
);
/* ... and sometimes input flags */
/* ... and sometimes input flags */
if
((
verbose
==
3
)
&&
!
util_flags
(
bio_out
,
flags
,
if
((
verbose
>=
3
)
&&
!
util_flags
(
bio_out
,
flags
,
indent
))
indent
))
goto
err
;
goto
err
;
xpos
=
0
;
xpos
=
0
;
}
}
}
OPENSSL_free
(
name
);
name
=
NULL
;
OPENSSL_free
(
name
);
name
=
NULL
;
if
(
desc
)
{
OPENSSL_free
(
desc
);
desc
=
NULL
;
}
if
(
desc
)
{
OPENSSL_free
(
desc
);
desc
=
NULL
;
}
/* Move to the next command */
/* Move to the next command */
...
@@ -355,7 +372,7 @@ int MAIN(int argc, char **argv)
...
@@ -355,7 +372,7 @@ int MAIN(int argc, char **argv)
{
{
if
(
strspn
(
*
argv
+
1
,
"v"
)
<
strlen
(
*
argv
+
1
))
if
(
strspn
(
*
argv
+
1
,
"v"
)
<
strlen
(
*
argv
+
1
))
goto
skip_arg_loop
;
goto
skip_arg_loop
;
if
((
verbose
=
strlen
(
*
argv
+
1
))
>
3
)
if
((
verbose
=
strlen
(
*
argv
+
1
))
>
4
)
goto
skip_arg_loop
;
goto
skip_arg_loop
;
}
}
else
if
(
strcmp
(
*
argv
,
"-c"
)
==
0
)
else
if
(
strcmp
(
*
argv
,
"-c"
)
==
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录