Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
78038e09
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看板
提交
78038e09
编写于
10月 08, 2013
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ssl/s3_pkt.c: add initial multi-block encrypt.
上级
a69c0a1b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
0 deletion
+53
-0
ssl/s3_pkt.c
ssl/s3_pkt.c
+53
-0
未找到文件。
ssl/s3_pkt.c
浏览文件 @
78038e09
...
...
@@ -117,6 +117,10 @@
#include <openssl/buffer.h>
#include <openssl/rand.h>
#ifndef EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0
#endif
static
int
do_ssl3_write
(
SSL
*
s
,
int
type
,
const
unsigned
char
*
buf
,
unsigned
int
len
,
int
create_empty_fragment
);
static
int
ssl3_get_record
(
SSL
*
s
);
...
...
@@ -724,6 +728,55 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
goto
err
;
}
#if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
if
(
type
==
SSL3_RT_APPLICATION_DATA
&&
s
->
compress
==
NULL
&&
!
SSL_USE_ETM
(
s
)
&&
SSL_USE_EXPLICIT_IV
(
s
)
&&
/*!SSL_IS_DTLS(s) &&*/
EVP_CIPHER_flags
(
s
->
enc_write_ctx
->
cipher
)
&
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
)
do
{
unsigned
char
aad
[
13
];
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM
mb_param
=
{
NULL
,
aad
,
sizeof
(
aad
),
0
};
int
packlen
;
memcpy
(
aad
,
s
->
s3
->
write_sequence
,
8
);
aad
[
8
]
=
type
;
aad
[
9
]
=
(
unsigned
char
)(
s
->
version
>>
8
);
aad
[
10
]
=
(
unsigned
char
)(
s
->
version
);
aad
[
11
]
=
(
unsigned
char
)(
len
>>
8
);
aad
[
12
]
=
(
unsigned
char
)
len
;
packlen
=
EVP_CIPHER_CTX_ctrl
(
s
->
enc_write_ctx
,
EVP_CTRL_TLS1_1_MULTIBLOCK_AAD
,
sizeof
(
mb_param
),
&
mb_param
);
if
(
packlen
==
0
||
packlen
>
wb
->
len
)
break
;
mb_param
.
out
=
wb
->
buf
;
mb_param
.
inp
=
buf
;
mb_param
.
len
=
len
;
EVP_CIPHER_CTX_ctrl
(
s
->
enc_write_ctx
,
EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT
,
sizeof
(
mb_param
),
&
mb_param
);
s
->
s3
->
write_sequence
[
7
]
+=
mb_param
.
interleave
;
if
(
s
->
s3
->
write_sequence
[
7
]
<
mb_param
.
interleave
)
{
int
j
=
6
;
while
(
j
>=
0
&&
(
++
s
->
s3
->
write_sequence
[
j
--
])
==
0
)
;
}
wb
->
offset
=
0
;
wb
->
left
=
packlen
;
/* memorize arguments so that ssl3_write_pending can detect bad write retries later */
s
->
s3
->
wpend_tot
=
len
;
s
->
s3
->
wpend_buf
=
buf
;
s
->
s3
->
wpend_type
=
type
;
s
->
s3
->
wpend_ret
=
len
;
/* we now just need to write the buffer */
return
ssl3_write_pending
(
s
,
type
,
buf
,
len
);
}
while
(
0
);
#endif
/* 'create_empty_fragment' is true only when this function calls itself */
if
(
!
clear
&&
!
create_empty_fragment
&&
!
s
->
s3
->
empty_fragment_done
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录