Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
6a56b14e
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
6a56b14e
编写于
5月 22, 2020
作者:
W
WangFengTu
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not encode char '\0' when encode aes
Signed-off-by:
N
WangFengTu
<
wangfengtu@huawei.com
>
上级
fba1237b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
4 deletion
+7
-4
src/image/oci/registry/auths.c
src/image/oci/registry/auths.c
+7
-4
未找到文件。
src/image/oci/registry/auths.c
浏览文件 @
6a56b14e
...
@@ -116,6 +116,7 @@ static char *encode_auth(char *username, char *password)
...
@@ -116,6 +116,7 @@ static char *encode_auth(char *username, char *password)
int
nret
=
0
;
int
nret
=
0
;
int
sret
=
0
;
int
sret
=
0
;
size_t
plain_text_base64_len
=
0
;
size_t
plain_text_base64_len
=
0
;
size_t
plain_text_base64_encode_len
=
0
;
char
*
plain_text_base64
=
NULL
;
char
*
plain_text_base64
=
NULL
;
char
plain_text
[
PATH_MAX
]
=
{
0
};
char
plain_text
[
PATH_MAX
]
=
{
0
};
unsigned
char
*
aes
=
NULL
;
unsigned
char
*
aes
=
NULL
;
...
@@ -132,7 +133,7 @@ static char *encode_auth(char *username, char *password)
...
@@ -132,7 +133,7 @@ static char *encode_auth(char *username, char *password)
}
}
plain_text_base64_len
=
util_base64_encode_len
(
strlen
(
plain_text
));
plain_text_base64_len
=
util_base64_encode_len
(
strlen
(
plain_text
));
plain_text_base64
=
util_common_calloc_s
(
plain_text_base64_len
+
1
);
plain_text_base64
=
util_common_calloc_s
(
plain_text_base64_len
);
if
(
plain_text_base64
==
NULL
)
{
if
(
plain_text_base64
==
NULL
)
{
ERROR
(
"out of memory"
);
ERROR
(
"out of memory"
);
ret
=
-
1
;
ret
=
-
1
;
...
@@ -147,15 +148,17 @@ static char *encode_auth(char *username, char *password)
...
@@ -147,15 +148,17 @@ static char *encode_auth(char *username, char *password)
goto
out
;
goto
out
;
}
}
aes_buf_len
=
util_aes_encode_buf_len
(
plain_text_base64_len
);
// Do not encode char '\0'
aes_len
=
AES_256_CFB_IV_LEN
+
plain_text_base64_len
;
plain_text_base64_encode_len
=
plain_text_base64_len
-
1
;
aes_buf_len
=
util_aes_encode_buf_len
(
plain_text_base64_encode_len
);
aes_len
=
AES_256_CFB_IV_LEN
+
plain_text_base64_encode_len
;
aes
=
util_common_calloc_s
(
aes_buf_len
);
aes
=
util_common_calloc_s
(
aes_buf_len
);
if
(
aes
==
NULL
)
{
if
(
aes
==
NULL
)
{
ERROR
(
"out of memory"
);
ERROR
(
"out of memory"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out
;
goto
out
;
}
}
ret
=
aes_encode
((
unsigned
char
*
)
plain_text_base64
,
plain_text_base64_len
,
aes
,
aes_buf_len
);
ret
=
aes_encode
((
unsigned
char
*
)
plain_text_base64
,
plain_text_base64_
encode_
len
,
aes
,
aes_buf_len
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"encode aes failed"
);
ERROR
(
"encode aes failed"
);
ret
=
-
1
;
ret
=
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录