Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
4f272c17
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看板
提交
4f272c17
编写于
6月 23, 2001
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make use of new features in UI's. Among others, the application
password callbak doesn't need to check for sizes any more.
上级
fd3e027f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
27 deletion
+14
-27
apps/apps.c
apps/apps.c
+14
-27
未找到文件。
apps/apps.c
浏览文件 @
4f272c17
...
...
@@ -390,7 +390,7 @@ static int ui_read(UI *ui, UI_STRING *uis)
((
PW_CB_DATA
*
)
UI_get0_user_data
(
ui
))
->
password
;
if
(
password
[
0
]
!=
'\0'
)
{
UI_set_result
(
uis
,
password
);
UI_set_result
(
ui
,
ui
s
,
password
);
return
1
;
}
}
...
...
@@ -462,8 +462,6 @@ int password_callback(char *buf, int bufsiz, int verify,
ui
=
UI_new_method
(
ui_method
);
if
(
ui
)
{
char
errstring
[
80
];
int
errstring_added
=
0
;
int
ok
=
0
;
char
*
buff
=
NULL
;
int
ui_flags
=
0
;
...
...
@@ -473,44 +471,32 @@ int password_callback(char *buf, int bufsiz, int verify,
cb_data
->
prompt_info
);
ui_flags
|=
UI_INPUT_FLAG_DEFAULT_PWD
;
UI_ctrl
(
ui
,
UI_CTRL_PRINT_ERRORS
,
1
,
0
,
0
);
if
(
ok
>=
0
)
ok
=
UI_add_input_string
(
ui
,
prompt
,
ui_flags
,
buf
,
0
,
BUFSIZ
-
1
);
ok
=
UI_add_input_string
(
ui
,
prompt
,
ui_flags
,
buf
,
PW_MIN_LENGTH
,
BUFSIZ
-
1
);
if
(
ok
>=
0
&&
verify
)
{
buff
=
(
char
*
)
OPENSSL_malloc
(
bufsiz
);
ok
=
UI_add_verify_string
(
ui
,
prompt
,
ui_flags
,
buff
,
0
,
BUFSIZ
-
1
,
buf
);
ok
=
UI_add_verify_string
(
ui
,
prompt
,
ui_flags
,
buff
,
PW_MIN_LENGTH
,
BUFSIZ
-
1
,
buf
);
}
if
(
ok
>=
0
)
for
(;;)
do
{
res
=
0
;
ok
=
UI_process
(
ui
);
if
(
ok
<
0
)
break
;
res
=
strlen
(
buf
);
if
(
res
<
PW_MIN_LENGTH
)
{
if
(
errstring_added
==
0
)
{
BIO_snprintf
(
errstring
,
sizeof
(
errstring
),
"phrase is too short, needs to be at least %d chars
\n
"
,
PW_MIN_LENGTH
);
UI_add_error_string
(
ui
,
errstring
);
}
errstring_added
=
1
;
}
else
break
;
ok
=
UI_process
(
ui
);
}
while
(
ok
<
0
&&
UI_ctrl
(
ui
,
UI_CTRL_IS_REDOABLE
,
0
,
0
,
0
));
if
(
buff
)
{
memset
(
buf
,
0
,(
unsigned
int
)
bufsiz
);
memset
(
buf
f
,
0
,(
unsigned
int
)
bufsiz
);
OPENSSL_free
(
buff
);
}
if
(
ok
>=
0
)
res
=
strlen
(
buf
);
if
(
ok
==
-
1
)
{
BIO_printf
(
bio_err
,
"User interface error
\n
"
);
...
...
@@ -525,6 +511,7 @@ int password_callback(char *buf, int bufsiz, int verify,
res
=
0
;
}
UI_free
(
ui
);
OPENSSL_free
(
prompt
);
}
return
res
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录