Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c08d12ca
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看板
提交
c08d12ca
编写于
10月 19, 2016
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some ssl3_record code witch converstion to/from size_t
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
153703df
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
15 deletion
+17
-15
ssl/record/ssl3_record.c
ssl/record/ssl3_record.c
+17
-15
未找到文件。
ssl/record/ssl3_record.c
浏览文件 @
c08d12ca
...
...
@@ -614,7 +614,7 @@ int ssl3_enc(SSL *s, SSL3_RECORD *inrecs, size_t n_recs, int send)
/* COMPRESS */
if
((
bs
!=
1
)
&&
send
)
{
i
=
bs
-
(
(
int
)
l
%
bs
);
i
=
bs
-
(
l
%
bs
);
/* we need to add 'i-1' padding bytes */
l
+=
i
;
...
...
@@ -624,7 +624,7 @@ int ssl3_enc(SSL *s, SSL3_RECORD *inrecs, size_t n_recs, int send)
*/
memset
(
&
rec
->
input
[
rec
->
length
],
0
,
i
);
rec
->
length
+=
i
;
rec
->
input
[
l
-
1
]
=
(
i
-
1
);
rec
->
input
[
l
-
1
]
=
(
unsigned
char
)(
i
-
1
);
}
if
(
!
send
)
{
...
...
@@ -634,7 +634,7 @@ int ssl3_enc(SSL *s, SSL3_RECORD *inrecs, size_t n_recs, int send)
}
/* TODO(size_t): Convert this call */
if
(
EVP_Cipher
(
ds
,
rec
->
data
,
rec
->
input
,
l
)
<
1
)
if
(
EVP_Cipher
(
ds
,
rec
->
data
,
rec
->
input
,
(
unsigned
int
)
l
)
<
1
)
return
-
1
;
if
(
EVP_MD_CTX_md
(
s
->
read_hash
)
!=
NULL
)
{
...
...
@@ -767,8 +767,8 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
buf
[
ctr
][
8
]
=
recs
[
ctr
].
type
;
buf
[
ctr
][
9
]
=
(
unsigned
char
)(
s
->
version
>>
8
);
buf
[
ctr
][
10
]
=
(
unsigned
char
)(
s
->
version
);
buf
[
ctr
][
11
]
=
recs
[
ctr
].
length
>>
8
;
buf
[
ctr
][
12
]
=
recs
[
ctr
].
length
&
0xff
;
buf
[
ctr
][
11
]
=
(
unsigned
char
)(
recs
[
ctr
].
length
>>
8
)
;
buf
[
ctr
][
12
]
=
(
unsigned
char
)(
recs
[
ctr
].
length
&
0xff
)
;
pad
=
EVP_CIPHER_CTX_ctrl
(
ds
,
EVP_CTRL_AEAD_TLS1_AAD
,
EVP_AEAD_TLS1_AAD_LEN
,
buf
[
ctr
]);
if
(
pad
<=
0
)
...
...
@@ -780,14 +780,14 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
}
}
else
if
((
bs
!=
1
)
&&
send
)
{
padnum
=
bs
-
(
(
int
)
reclen
[
ctr
]
%
bs
);
padnum
=
bs
-
(
reclen
[
ctr
]
%
bs
);
/* Add weird padding of upto 256 bytes */
if
(
padnum
>
MAX_PADDING
)
return
-
1
;
/* we need to add 'padnum' padding bytes of value padval */
padval
=
padnum
-
1
;
padval
=
(
unsigned
char
)(
padnum
-
1
)
;
for
(
loop
=
reclen
[
ctr
];
loop
<
reclen
[
ctr
]
+
padnum
;
loop
++
)
recs
[
ctr
].
input
[
loop
]
=
padval
;
reclen
[
ctr
]
+=
padnum
;
...
...
@@ -807,7 +807,7 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
data
[
ctr
]
=
recs
[
ctr
].
data
;
}
if
(
EVP_CIPHER_CTX_ctrl
(
ds
,
EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS
,
n_recs
,
data
)
<=
0
)
{
(
int
)
n_recs
,
data
)
<=
0
)
{
SSLerr
(
SSL_F_TLS1_ENC
,
SSL_R_PIPELINE_FAILURE
);
}
/* Set the input buffers */
...
...
@@ -815,15 +815,17 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
data
[
ctr
]
=
recs
[
ctr
].
input
;
}
if
(
EVP_CIPHER_CTX_ctrl
(
ds
,
EVP_CTRL_SET_PIPELINE_INPUT_BUFS
,
n_recs
,
data
)
<=
0
(
int
)
n_recs
,
data
)
<=
0
||
EVP_CIPHER_CTX_ctrl
(
ds
,
EVP_CTRL_SET_PIPELINE_INPUT_LENS
,
n_recs
,
reclen
)
<=
0
)
{
(
int
)
n_recs
,
reclen
)
<=
0
)
{
SSLerr
(
SSL_F_TLS1_ENC
,
SSL_R_PIPELINE_FAILURE
);
return
-
1
;
}
}
tmpr
=
EVP_Cipher
(
ds
,
recs
[
0
].
data
,
recs
[
0
].
input
,
reclen
[
0
]);
/* TODO(size_t): Convert this call */
tmpr
=
EVP_Cipher
(
ds
,
recs
[
0
].
data
,
recs
[
0
].
input
,
(
unsigned
int
)
reclen
[
0
]);
if
((
EVP_CIPHER_flags
(
EVP_CIPHER_CTX_cipher
(
ds
))
&
EVP_CIPH_FLAG_CUSTOM_CIPHER
)
?
(
tmpr
<
0
)
...
...
@@ -882,7 +884,7 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send)
const
EVP_MD_CTX
*
hash
;
unsigned
char
*
p
,
rec_char
;
size_t
md_size
;
in
t
npad
;
size_
t
npad
;
int
t
;
if
(
send
)
{
...
...
@@ -919,7 +921,7 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send)
* total size.
*/
unsigned
char
header
[
75
];
unsigned
j
=
0
;
size_t
j
=
0
;
memcpy
(
header
+
j
,
mac_sec
,
md_size
);
j
+=
md_size
;
memcpy
(
header
+
j
,
ssl3_pad_1
,
npad
);
...
...
@@ -927,8 +929,8 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send)
memcpy
(
header
+
j
,
seq
,
8
);
j
+=
8
;
header
[
j
++
]
=
rec
->
type
;
header
[
j
++
]
=
rec
->
length
>>
8
;
header
[
j
++
]
=
rec
->
length
&
0xff
;
header
[
j
++
]
=
(
unsigned
char
)(
rec
->
length
>>
8
)
;
header
[
j
++
]
=
(
unsigned
char
)(
rec
->
length
&
0xff
)
;
/* Final param == is SSLv3 */
if
(
ssl3_cbc_digest_record
(
hash
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录