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 @@
static
char
*
engine_usage
[]
=
{
"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
"
,
" -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
"
,
" -t - for each engine, check that they are really available
\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)
BIO_printf
(
bio_out
,
"<no flags>
\n
"
);
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
(
started
)
{
BIO_printf
(
bio_out
,
"|"
);
err
=
1
;
}
BIO_printf
(
bio_out
,
"NUMERIC"
);
started
=
1
;
}
...
...
@@ -167,7 +180,8 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
/* Check for unknown flags */
flags
=
flags
&
~
ENGINE_CMD_FLAG_NUMERIC
&
~
ENGINE_CMD_FLAG_STRING
&
~
ENGINE_CMD_FLAG_NO_INPUT
;
~
ENGINE_CMD_FLAG_NO_INPUT
&
~
ENGINE_CMD_FLAG_INTERNAL
;
if
(
flags
)
{
if
(
started
)
BIO_printf
(
bio_out
,
"|"
);
...
...
@@ -205,60 +219,63 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
goto
err
;
do
{
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 */
if
((
flags
=
ENGINE_ctrl
(
e
,
ENGINE_CTRL_GET_CMD_FLAGS
,
num
,
NULL
,
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
))
&&
if
(
!
(
flags
&
ENGINE_CMD_FLAG_INTERNAL
)
||
verbose
>=
4
)
{
/* 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
;
}
/* 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
))
{
BIO_printf
(
bio_out
,
"
\n
"
);
xpos
=
BIO_printf
(
bio_out
,
indent
);
}
xpos
+=
BIO_printf
(
bio_out
,
"%s"
,
name
);
}
else
{
/* We're listing names plus descriptions */
BIO_printf
(
bio_out
,
"%s: %s
\n
"
,
name
,
(
desc
==
NULL
)
?
"<no description>"
:
desc
);
/* ... and sometimes input flags */
if
((
verbose
==
3
)
&&
!
util_flags
(
bio_out
,
flags
,
indent
))
goto
err
;
xpos
=
0
;
}
{
BIO_printf
(
bio_out
,
"
\n
"
);
xpos
=
BIO_printf
(
bio_out
,
indent
);
}
xpos
+=
BIO_printf
(
bio_out
,
"%s"
,
name
);
}
else
{
/* We're listing names plus descriptions */
BIO_printf
(
bio_out
,
"%s: %s
\n
"
,
name
,
(
desc
==
NULL
)
?
"<no description>"
:
desc
);
/* ... and sometimes input flags */
if
((
verbose
>=
3
)
&&
!
util_flags
(
bio_out
,
flags
,
indent
))
goto
err
;
xpos
=
0
;
}
}
OPENSSL_free
(
name
);
name
=
NULL
;
if
(
desc
)
{
OPENSSL_free
(
desc
);
desc
=
NULL
;
}
/* Move to the next command */
...
...
@@ -355,7 +372,7 @@ int MAIN(int argc, char **argv)
{
if
(
strspn
(
*
argv
+
1
,
"v"
)
<
strlen
(
*
argv
+
1
))
goto
skip_arg_loop
;
if
((
verbose
=
strlen
(
*
argv
+
1
))
>
3
)
if
((
verbose
=
strlen
(
*
argv
+
1
))
>
4
)
goto
skip_arg_loop
;
}
else
if
(
strcmp
(
*
argv
,
"-c"
)
==
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录