Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
85f48f7e
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
8 个月 前同步成功
通知
8
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
85f48f7e
编写于
4月 22, 1999
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't return 0 from ssl2_read when a packet with empty payload is received.
Submitted by: Reviewed by: PR:
上级
6cda1005
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
0 deletion
+25
-0
CHANGES
CHANGES
+4
-0
ssl/s2_pkt.c
ssl/s2_pkt.c
+21
-0
未找到文件。
CHANGES
浏览文件 @
85f48f7e
...
...
@@ -5,6 +5,10 @@
Changes between 0.9.2b and 0.9.3
*) Change behaviour of ssl2_read when facing length-0 packets: Don't return
0 (which usually indicates a closed connection), but continue reading.
[Bodo Moeller]
*) Fix some race conditions.
[Bodo Moeller]
...
...
ssl/s2_pkt.c
浏览文件 @
85f48f7e
...
...
@@ -104,6 +104,7 @@ int ssl2_read(SSL *s, char *buf, int len)
int
i
;
unsigned
int
mac_size
=
0
;
ssl2_read_again:
if
(
SSL_in_init
(
s
)
&&
!
s
->
in_handshake
)
{
n
=
s
->
handshake_func
(
s
);
...
...
@@ -231,6 +232,25 @@ int ssl2_read(SSL *s, char *buf, int len)
INC32
(
s
->
s2
->
read_sequence
);
/* expect next number */
/* s->s2->ract_data is now available for processing */
#if 1
/* How should we react when a packet containing 0
* bytes is received? (Note that SSLeay/OpenSSL itself
* never sends such packets; see ssl2_write.)
* Returning 0 would be interpreted by the caller as
* indicating EOF, so it's not a good idea.
* Instead, we just continue reading. Note that using
* select() for blocking sockets *never* guarantees
* that the next SSL_read will not block -- the available
* data may contain incomplete packets, and except for SSL 2
* renegotiation can confuse things even more. */
goto
ssl2_read_again
;
/* This should really be
* "return ssl2_read(s,buf,len)",
* but that would allow for
* denial-of-service attacks if a
* C compiler is used that does not
* recognize end-recursion. */
#else
/* If a 0 byte packet was sent, return 0, otherwise
* we play havoc with people using select with
* blocking sockets. Let them handle a packet at a time,
...
...
@@ -238,6 +258,7 @@ int ssl2_read(SSL *s, char *buf, int len)
if
(
s
->
s2
->
ract_data_length
==
0
)
return
(
0
);
return
(
ssl2_read
(
s
,
buf
,
len
));
#endif
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录