Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
24a1e2f2
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
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,发现更多精彩内容 >>
提交
24a1e2f2
编写于
2月 04, 2015
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move buffered_app_data from s->d1 to s->rlayer.d
Reviewed-by:
N
Richard Levitte
<
levitte@openssl.org
>
上级
c661ac16
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
30 deletion
+29
-30
ssl/d1_lib.c
ssl/d1_lib.c
+1
-19
ssl/record/d1_pkt.c
ssl/record/d1_pkt.c
+21
-4
ssl/record/rec_layer.h
ssl/record/rec_layer.h
+6
-1
ssl/ssl_locl.h
ssl/ssl_locl.h
+1
-6
未找到文件。
ssl/d1_lib.c
浏览文件 @
24a1e2f2
...
@@ -138,7 +138,6 @@ int dtls1_new(SSL *s)
...
@@ -138,7 +138,6 @@ int dtls1_new(SSL *s)
d1
->
buffered_messages
=
pqueue_new
();
d1
->
buffered_messages
=
pqueue_new
();
d1
->
sent_messages
=
pqueue_new
();
d1
->
sent_messages
=
pqueue_new
();
d1
->
buffered_app_data
.
q
=
pqueue_new
();
if
(
s
->
server
)
{
if
(
s
->
server
)
{
d1
->
cookie_len
=
sizeof
(
s
->
d1
->
cookie
);
d1
->
cookie_len
=
sizeof
(
s
->
d1
->
cookie
);
...
@@ -147,14 +146,11 @@ int dtls1_new(SSL *s)
...
@@ -147,14 +146,11 @@ int dtls1_new(SSL *s)
d1
->
link_mtu
=
0
;
d1
->
link_mtu
=
0
;
d1
->
mtu
=
0
;
d1
->
mtu
=
0
;
if
(
!
d1
->
buffered_messages
||
!
d1
->
sent_messages
if
(
!
d1
->
buffered_messages
||
!
d1
->
sent_messages
)
{
||
!
d1
->
buffered_app_data
.
q
)
{
if
(
d1
->
buffered_messages
)
if
(
d1
->
buffered_messages
)
pqueue_free
(
d1
->
buffered_messages
);
pqueue_free
(
d1
->
buffered_messages
);
if
(
d1
->
sent_messages
)
if
(
d1
->
sent_messages
)
pqueue_free
(
d1
->
sent_messages
);
pqueue_free
(
d1
->
sent_messages
);
if
(
d1
->
buffered_app_data
.
q
)
pqueue_free
(
d1
->
buffered_app_data
.
q
);
OPENSSL_free
(
d1
);
OPENSSL_free
(
d1
);
ssl3_free
(
s
);
ssl3_free
(
s
);
return
(
0
);
return
(
0
);
...
@@ -169,7 +165,6 @@ static void dtls1_clear_queues(SSL *s)
...
@@ -169,7 +165,6 @@ static void dtls1_clear_queues(SSL *s)
{
{
pitem
*
item
=
NULL
;
pitem
*
item
=
NULL
;
hm_fragment
*
frag
=
NULL
;
hm_fragment
*
frag
=
NULL
;
DTLS1_RECORD_DATA
*
rdata
;
while
((
item
=
pqueue_pop
(
s
->
d1
->
buffered_messages
))
!=
NULL
)
{
while
((
item
=
pqueue_pop
(
s
->
d1
->
buffered_messages
))
!=
NULL
)
{
frag
=
(
hm_fragment
*
)
item
->
data
;
frag
=
(
hm_fragment
*
)
item
->
data
;
...
@@ -182,15 +177,6 @@ static void dtls1_clear_queues(SSL *s)
...
@@ -182,15 +177,6 @@ static void dtls1_clear_queues(SSL *s)
dtls1_hm_fragment_free
(
frag
);
dtls1_hm_fragment_free
(
frag
);
pitem_free
(
item
);
pitem_free
(
item
);
}
}
while
((
item
=
pqueue_pop
(
s
->
d1
->
buffered_app_data
.
q
))
!=
NULL
)
{
rdata
=
(
DTLS1_RECORD_DATA
*
)
item
->
data
;
if
(
rdata
->
rbuf
.
buf
)
{
OPENSSL_free
(
rdata
->
rbuf
.
buf
);
}
OPENSSL_free
(
item
->
data
);
pitem_free
(
item
);
}
}
}
void
dtls1_free
(
SSL
*
s
)
void
dtls1_free
(
SSL
*
s
)
...
@@ -203,7 +189,6 @@ void dtls1_free(SSL *s)
...
@@ -203,7 +189,6 @@ void dtls1_free(SSL *s)
pqueue_free
(
s
->
d1
->
buffered_messages
);
pqueue_free
(
s
->
d1
->
buffered_messages
);
pqueue_free
(
s
->
d1
->
sent_messages
);
pqueue_free
(
s
->
d1
->
sent_messages
);
pqueue_free
(
s
->
d1
->
buffered_app_data
.
q
);
OPENSSL_free
(
s
->
d1
);
OPENSSL_free
(
s
->
d1
);
s
->
d1
=
NULL
;
s
->
d1
=
NULL
;
...
@@ -213,7 +198,6 @@ void dtls1_clear(SSL *s)
...
@@ -213,7 +198,6 @@ void dtls1_clear(SSL *s)
{
{
pqueue
buffered_messages
;
pqueue
buffered_messages
;
pqueue
sent_messages
;
pqueue
sent_messages
;
pqueue
buffered_app_data
;
unsigned
int
mtu
;
unsigned
int
mtu
;
unsigned
int
link_mtu
;
unsigned
int
link_mtu
;
...
@@ -222,7 +206,6 @@ void dtls1_clear(SSL *s)
...
@@ -222,7 +206,6 @@ void dtls1_clear(SSL *s)
if
(
s
->
d1
)
{
if
(
s
->
d1
)
{
buffered_messages
=
s
->
d1
->
buffered_messages
;
buffered_messages
=
s
->
d1
->
buffered_messages
;
sent_messages
=
s
->
d1
->
sent_messages
;
sent_messages
=
s
->
d1
->
sent_messages
;
buffered_app_data
=
s
->
d1
->
buffered_app_data
.
q
;
mtu
=
s
->
d1
->
mtu
;
mtu
=
s
->
d1
->
mtu
;
link_mtu
=
s
->
d1
->
link_mtu
;
link_mtu
=
s
->
d1
->
link_mtu
;
...
@@ -241,7 +224,6 @@ void dtls1_clear(SSL *s)
...
@@ -241,7 +224,6 @@ void dtls1_clear(SSL *s)
s
->
d1
->
buffered_messages
=
buffered_messages
;
s
->
d1
->
buffered_messages
=
buffered_messages
;
s
->
d1
->
sent_messages
=
sent_messages
;
s
->
d1
->
sent_messages
=
sent_messages
;
s
->
d1
->
buffered_app_data
.
q
=
buffered_app_data
;
}
}
ssl3_clear
(
s
);
ssl3_clear
(
s
);
...
...
ssl/record/d1_pkt.c
浏览文件 @
24a1e2f2
...
@@ -136,12 +136,16 @@ int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
...
@@ -136,12 +136,16 @@ int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
d
->
unprocessed_rcds
.
q
=
pqueue_new
();
d
->
unprocessed_rcds
.
q
=
pqueue_new
();
d
->
processed_rcds
.
q
=
pqueue_new
();
d
->
processed_rcds
.
q
=
pqueue_new
();
d
->
buffered_app_data
.
q
=
pqueue_new
();
if
(
!
d
->
unprocessed_rcds
.
q
||
!
d
->
processed_rcds
.
q
)
{
if
(
!
d
->
unprocessed_rcds
.
q
||
!
d
->
processed_rcds
.
q
||
!
d
->
buffered_app_data
.
q
)
{
if
(
d
->
unprocessed_rcds
.
q
)
if
(
d
->
unprocessed_rcds
.
q
)
pqueue_free
(
d
->
unprocessed_rcds
.
q
);
pqueue_free
(
d
->
unprocessed_rcds
.
q
);
if
(
d
->
processed_rcds
.
q
)
if
(
d
->
processed_rcds
.
q
)
pqueue_free
(
d
->
processed_rcds
.
q
);
pqueue_free
(
d
->
processed_rcds
.
q
);
if
(
d
->
buffered_app_data
.
q
)
pqueue_free
(
d
->
buffered_app_data
.
q
);
OPENSSL_free
(
d
);
OPENSSL_free
(
d
);
rl
->
d
=
NULL
;
rl
->
d
=
NULL
;
return
(
0
);
return
(
0
);
...
@@ -155,6 +159,7 @@ void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl)
...
@@ -155,6 +159,7 @@ void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl)
DTLS_RECORD_LAYER_clear
(
rl
);
DTLS_RECORD_LAYER_clear
(
rl
);
pqueue_free
(
rl
->
d
->
unprocessed_rcds
.
q
);
pqueue_free
(
rl
->
d
->
unprocessed_rcds
.
q
);
pqueue_free
(
rl
->
d
->
processed_rcds
.
q
);
pqueue_free
(
rl
->
d
->
processed_rcds
.
q
);
pqueue_free
(
rl
->
d
->
buffered_app_data
.
q
);
OPENSSL_free
(
rl
->
d
);
OPENSSL_free
(
rl
->
d
);
rl
->
d
=
NULL
;
rl
->
d
=
NULL
;
}
}
...
@@ -166,6 +171,7 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl)
...
@@ -166,6 +171,7 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl)
DTLS1_RECORD_DATA
*
rdata
;
DTLS1_RECORD_DATA
*
rdata
;
pqueue
unprocessed_rcds
;
pqueue
unprocessed_rcds
;
pqueue
processed_rcds
;
pqueue
processed_rcds
;
pqueue
buffered_app_data
;
d
=
rl
->
d
;
d
=
rl
->
d
;
...
@@ -187,11 +193,22 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl)
...
@@ -187,11 +193,22 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl)
pitem_free
(
item
);
pitem_free
(
item
);
}
}
while
((
item
=
pqueue_pop
(
d
->
buffered_app_data
.
q
))
!=
NULL
)
{
rdata
=
(
DTLS1_RECORD_DATA
*
)
item
->
data
;
if
(
rdata
->
rbuf
.
buf
)
{
OPENSSL_free
(
rdata
->
rbuf
.
buf
);
}
OPENSSL_free
(
item
->
data
);
pitem_free
(
item
);
}
unprocessed_rcds
=
d
->
unprocessed_rcds
.
q
;
unprocessed_rcds
=
d
->
unprocessed_rcds
.
q
;
processed_rcds
=
d
->
processed_rcds
.
q
;
processed_rcds
=
d
->
processed_rcds
.
q
;
buffered_app_data
=
d
->
buffered_app_data
.
q
;
memset
(
d
,
0
,
sizeof
*
d
);
memset
(
d
,
0
,
sizeof
*
d
);
d
->
unprocessed_rcds
.
q
=
unprocessed_rcds
;
d
->
unprocessed_rcds
.
q
=
unprocessed_rcds
;
d
->
processed_rcds
.
q
=
processed_rcds
;
d
->
processed_rcds
.
q
=
processed_rcds
;
d
->
buffered_app_data
.
q
=
buffered_app_data
;
}
}
static
int
have_handshake_fragment
(
SSL
*
s
,
int
type
,
unsigned
char
*
buf
,
static
int
have_handshake_fragment
(
SSL
*
s
,
int
type
,
unsigned
char
*
buf
,
...
@@ -441,7 +458,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
...
@@ -441,7 +458,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
*/
*/
if
(
s
->
state
==
SSL_ST_OK
&&
rr
->
length
==
0
)
{
if
(
s
->
state
==
SSL_ST_OK
&&
rr
->
length
==
0
)
{
pitem
*
item
;
pitem
*
item
;
item
=
pqueue_pop
(
s
->
d1
->
buffered_app_data
.
q
);
item
=
pqueue_pop
(
s
->
rlayer
.
d
->
buffered_app_data
.
q
);
if
(
item
)
{
if
(
item
)
{
#ifndef OPENSSL_NO_SCTP
#ifndef OPENSSL_NO_SCTP
/* Restore bio_dgram_sctp_rcvinfo struct */
/* Restore bio_dgram_sctp_rcvinfo struct */
...
@@ -491,8 +508,8 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
...
@@ -491,8 +508,8 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
* the packets were reordered on their way, so buffer the application
* the packets were reordered on their way, so buffer the application
* data for later processing rather than dropping the connection.
* data for later processing rather than dropping the connection.
*/
*/
if
(
dtls1_buffer_record
(
s
,
&
(
s
->
d1
->
buffered_app_data
),
rr
->
seq_num
)
<
if
(
dtls1_buffer_record
(
s
,
&
(
s
->
rlayer
.
d
->
buffered_app_data
),
0
)
{
rr
->
seq_num
)
<
0
)
{
SSLerr
(
SSL_F_DTLS1_READ_BYTES
,
ERR_R_INTERNAL_ERROR
);
SSLerr
(
SSL_F_DTLS1_READ_BYTES
,
ERR_R_INTERNAL_ERROR
);
return
-
1
;
return
-
1
;
}
}
...
...
ssl/record/rec_layer.h
浏览文件 @
24a1e2f2
...
@@ -151,7 +151,12 @@ typedef struct dtls_record_layer_st {
...
@@ -151,7 +151,12 @@ typedef struct dtls_record_layer_st {
/* Received handshake records (processed and unprocessed) */
/* Received handshake records (processed and unprocessed) */
record_pqueue
unprocessed_rcds
;
record_pqueue
unprocessed_rcds
;
record_pqueue
processed_rcds
;
record_pqueue
processed_rcds
;
/*
* Buffered application records. Only for records between CCS and
* Finished to prevent either protocol violation or unnecessary message
* loss.
*/
record_pqueue
buffered_app_data
;
/*
/*
* storage for Alert/Handshake protocol data received but not yet
* storage for Alert/Handshake protocol data received but not yet
* processed by ssl3_read_bytes:
* processed by ssl3_read_bytes:
...
...
ssl/ssl_locl.h
浏览文件 @
24a1e2f2
...
@@ -1415,12 +1415,7 @@ typedef struct dtls1_state_st {
...
@@ -1415,12 +1415,7 @@ typedef struct dtls1_state_st {
pqueue
buffered_messages
;
pqueue
buffered_messages
;
/* Buffered (sent) handshake records */
/* Buffered (sent) handshake records */
pqueue
sent_messages
;
pqueue
sent_messages
;
/*
* Buffered application records. Only for records between CCS and
* Finished to prevent either protocol violation or unnecessary message
* loss.
*/
record_pqueue
buffered_app_data
;
/* Is set when listening for new connections with dtls1_listen() */
/* Is set when listening for new connections with dtls1_listen() */
unsigned
int
listen
;
unsigned
int
listen
;
unsigned
int
link_mtu
;
/* max on-the-wire DTLS packet size */
unsigned
int
link_mtu
;
/* max on-the-wire DTLS packet size */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录