Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
2c60ed04
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看板
提交
2c60ed04
编写于
2月 02, 2015
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed dependency on rrec from heartbeat processing
Reviewed-by:
N
Richard Levitte
<
levitte@openssl.org
>
上级
bd2e3a95
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
22 addition
and
26 deletion
+22
-26
ssl/d1_both.c
ssl/d1_both.c
+2
-6
ssl/heartbeat_test.c
ssl/heartbeat_test.c
+8
-7
ssl/record/d1_pkt.c
ssl/record/d1_pkt.c
+2
-2
ssl/record/s3_pkt.c
ssl/record/s3_pkt.c
+2
-1
ssl/ssl_locl.h
ssl/ssl_locl.h
+6
-4
ssl/t1_lib.c
ssl/t1_lib.c
+2
-6
未找到文件。
ssl/d1_both.c
浏览文件 @
2c60ed04
...
@@ -1347,16 +1347,12 @@ int dtls1_shutdown(SSL *s)
...
@@ -1347,16 +1347,12 @@ int dtls1_shutdown(SSL *s)
}
}
#ifndef OPENSSL_NO_HEARTBEATS
#ifndef OPENSSL_NO_HEARTBEATS
int
dtls1_process_heartbeat
(
SSL
*
s
)
int
dtls1_process_heartbeat
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
)
{
{
unsigned
char
*
p
,
*
p
l
;
unsigned
char
*
pl
;
unsigned
short
hbtype
;
unsigned
short
hbtype
;
unsigned
int
payload
;
unsigned
int
payload
;
unsigned
int
padding
=
16
;
/* Use minimum padding */
unsigned
int
padding
=
16
;
/* Use minimum padding */
unsigned
int
length
;
p
=
SSL3_RECORD_get_data
(
RECORD_LAYER_get_rrec
(
&
s
->
rlayer
));
length
=
SSL3_RECORD_get_length
(
RECORD_LAYER_get_rrec
(
&
s
->
rlayer
));
if
(
s
->
msg_callback
)
if
(
s
->
msg_callback
)
s
->
msg_callback
(
0
,
s
->
version
,
TLS1_RT_HEARTBEAT
,
s
->
msg_callback
(
0
,
s
->
version
,
TLS1_RT_HEARTBEAT
,
...
...
ssl/heartbeat_test.c
浏览文件 @
2c60ed04
...
@@ -60,7 +60,7 @@ typedef struct heartbeat_test_fixture {
...
@@ -60,7 +60,7 @@ typedef struct heartbeat_test_fixture {
SSL_CTX
*
ctx
;
SSL_CTX
*
ctx
;
SSL
*
s
;
SSL
*
s
;
const
char
*
test_case_name
;
const
char
*
test_case_name
;
int
(
*
process_heartbeat
)
(
SSL
*
s
);
int
(
*
process_heartbeat
)
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
);
unsigned
char
*
payload
;
unsigned
char
*
payload
;
int
sent_payload_len
;
int
sent_payload_len
;
int
expected_return_value
;
int
expected_return_value
;
...
@@ -112,7 +112,7 @@ static HEARTBEAT_TEST_FIXTURE set_up(const char *const test_case_name,
...
@@ -112,7 +112,7 @@ static HEARTBEAT_TEST_FIXTURE set_up(const char *const test_case_name,
* zeroed in opt mode and will cause spurious test failures that will
* zeroed in opt mode and will cause spurious test failures that will
* change with each execution.
* change with each execution.
*/
*/
memset
(
fixture
.
s
->
s3
->
wbuf
.
buf
,
0
,
fixture
.
s
->
s3
->
wbuf
.
len
);
memset
(
fixture
.
s
->
rlayer
.
wbuf
.
buf
,
0
,
fixture
.
s
->
rlayer
.
wbuf
.
len
);
fail:
fail:
if
(
!
setup_ok
)
{
if
(
!
setup_ok
)
{
...
@@ -202,8 +202,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
...
@@ -202,8 +202,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
unsigned
const
char
*
p
;
unsigned
const
char
*
p
;
int
actual_payload_len
;
int
actual_payload_len
;
s
->
s3
->
rrec
.
data
=
payload
;
s
->
rlayer
.
rrec
.
data
=
payload
;
s
->
s3
->
rrec
.
length
=
strlen
((
const
char
*
)
payload
);
s
->
rlayer
.
rrec
.
length
=
strlen
((
const
char
*
)
payload
);
*
payload
++
=
TLS1_HB_REQUEST
;
*
payload
++
=
TLS1_HB_REQUEST
;
s2n
(
fixture
.
sent_payload_len
,
payload
);
s2n
(
fixture
.
sent_payload_len
,
payload
);
...
@@ -213,7 +213,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
...
@@ -213,7 +213,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
*/
*/
memcpy
((
char
*
)
sent_buf
,
(
const
char
*
)
payload
,
sizeof
(
sent_buf
));
memcpy
((
char
*
)
sent_buf
,
(
const
char
*
)
payload
,
sizeof
(
sent_buf
));
return_value
=
fixture
.
process_heartbeat
(
s
);
return_value
=
fixture
.
process_heartbeat
(
s
,
s
->
rlayer
.
rrec
.
data
,
s
->
rlayer
.
rrec
.
length
);
if
(
return_value
!=
fixture
.
expected_return_value
)
{
if
(
return_value
!=
fixture
.
expected_return_value
)
{
printf
(
"%s failed: expected return value %d, received %d
\n
"
,
printf
(
"%s failed: expected return value %d, received %d
\n
"
,
...
@@ -225,8 +226,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
...
@@ -225,8 +226,8 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
/*
/*
* If there is any byte alignment, it will be stored in wbuf.offset.
* If there is any byte alignment, it will be stored in wbuf.offset.
*/
*/
p
=
&
(
s
->
s3
->
p
=
&
(
s
->
rlayer
.
wbuf
.
buf
[
fixture
.
return_payload_offset
+
s
->
s3
->
wbuf
.
offset
]);
wbuf
.
buf
[
fixture
.
return_payload_offset
+
s
->
rlayer
.
wbuf
.
offset
]);
actual_payload_len
=
0
;
actual_payload_len
=
0
;
n2s
(
p
,
actual_payload_len
);
n2s
(
p
,
actual_payload_len
);
...
...
ssl/record/d1_pkt.c
浏览文件 @
2c60ed04
...
@@ -585,10 +585,10 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
...
@@ -585,10 +585,10 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
#ifndef OPENSSL_NO_HEARTBEATS
#ifndef OPENSSL_NO_HEARTBEATS
else
if
(
rr
->
type
==
TLS1_RT_HEARTBEAT
)
{
else
if
(
rr
->
type
==
TLS1_RT_HEARTBEAT
)
{
/* We allow a 0 return */
/* We allow a 0 return */
if
(
dtls1_process_heartbeat
(
s
)
<
0
)
{
if
(
dtls1_process_heartbeat
(
s
,
SSL3_RECORD_get_data
(
&
s
->
rlayer
.
rrec
),
SSL3_RECORD_get_length
(
&
s
->
rlayer
.
rrec
))
<
0
)
{
return
-
1
;
return
-
1
;
}
}
/* Exit and notify application to read again */
/* Exit and notify application to read again */
rr
->
length
=
0
;
rr
->
length
=
0
;
s
->
rwstate
=
SSL_READING
;
s
->
rwstate
=
SSL_READING
;
...
...
ssl/record/s3_pkt.c
浏览文件 @
2c60ed04
...
@@ -1054,7 +1054,8 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
...
@@ -1054,7 +1054,8 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
#ifndef OPENSSL_NO_HEARTBEATS
#ifndef OPENSSL_NO_HEARTBEATS
else
if
(
rr
->
type
==
TLS1_RT_HEARTBEAT
)
{
else
if
(
rr
->
type
==
TLS1_RT_HEARTBEAT
)
{
/* We can ignore 0 return values */
/* We can ignore 0 return values */
if
(
tls1_process_heartbeat
(
s
)
<
0
)
{
if
(
tls1_process_heartbeat
(
s
,
SSL3_RECORD_get_data
(
&
s
->
rlayer
.
rrec
),
SSL3_RECORD_get_length
(
&
s
->
rlayer
.
rrec
))
<
0
)
{
return
-
1
;
return
-
1
;
}
}
...
...
ssl/ssl_locl.h
浏览文件 @
2c60ed04
...
@@ -1979,8 +1979,10 @@ const SSL_METHOD *func_name(void) \
...
@@ -1979,8 +1979,10 @@ const SSL_METHOD *func_name(void) \
struct
openssl_ssl_test_functions
{
struct
openssl_ssl_test_functions
{
int
(
*
p_ssl_init_wbio_buffer
)
(
SSL
*
s
,
int
push
);
int
(
*
p_ssl_init_wbio_buffer
)
(
SSL
*
s
,
int
push
);
int
(
*
p_ssl3_setup_buffers
)
(
SSL
*
s
);
int
(
*
p_ssl3_setup_buffers
)
(
SSL
*
s
);
int
(
*
p_tls1_process_heartbeat
)
(
SSL
*
s
);
int
(
*
p_tls1_process_heartbeat
)
(
SSL
*
s
,
int
(
*
p_dtls1_process_heartbeat
)
(
SSL
*
s
);
unsigned
char
*
p
,
unsigned
int
length
);
int
(
*
p_dtls1_process_heartbeat
)
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
);
};
};
# ifndef OPENSSL_UNIT_TEST
# ifndef OPENSSL_UNIT_TEST
...
@@ -2267,8 +2269,8 @@ __owur int ssl_prepare_serverhello_tlsext(SSL *s);
...
@@ -2267,8 +2269,8 @@ __owur int ssl_prepare_serverhello_tlsext(SSL *s);
# ifndef OPENSSL_NO_HEARTBEATS
# ifndef OPENSSL_NO_HEARTBEATS
__owur
int
tls1_heartbeat
(
SSL
*
s
);
__owur
int
tls1_heartbeat
(
SSL
*
s
);
__owur
int
dtls1_heartbeat
(
SSL
*
s
);
__owur
int
dtls1_heartbeat
(
SSL
*
s
);
__owur
int
tls1_process_heartbeat
(
SSL
*
s
);
__owur
int
tls1_process_heartbeat
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
);
__owur
int
dtls1_process_heartbeat
(
SSL
*
s
);
__owur
int
dtls1_process_heartbeat
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
);
# endif
# endif
__owur
int
tls1_process_ticket
(
SSL
*
s
,
unsigned
char
*
session_id
,
int
len
,
__owur
int
tls1_process_ticket
(
SSL
*
s
,
unsigned
char
*
session_id
,
int
len
,
...
...
ssl/t1_lib.c
浏览文件 @
2c60ed04
...
@@ -3592,16 +3592,12 @@ int SSL_get_shared_sigalgs(SSL *s, int idx,
...
@@ -3592,16 +3592,12 @@ int SSL_get_shared_sigalgs(SSL *s, int idx,
}
}
# ifndef OPENSSL_NO_HEARTBEATS
# ifndef OPENSSL_NO_HEARTBEATS
int
tls1_process_heartbeat
(
SSL
*
s
)
int
tls1_process_heartbeat
(
SSL
*
s
,
unsigned
char
*
p
,
unsigned
int
length
)
{
{
unsigned
char
*
p
,
*
p
l
;
unsigned
char
*
pl
;
unsigned
short
hbtype
;
unsigned
short
hbtype
;
unsigned
int
payload
;
unsigned
int
payload
;
unsigned
int
padding
=
16
;
/* Use minimum padding */
unsigned
int
padding
=
16
;
/* Use minimum padding */
unsigned
int
length
;
p
=
SSL3_RECORD_get_data
(
RECORD_LAYER_get_rrec
(
&
s
->
rlayer
));
length
=
SSL3_RECORD_get_length
(
RECORD_LAYER_get_rrec
(
&
s
->
rlayer
));
if
(
s
->
msg_callback
)
if
(
s
->
msg_callback
)
s
->
msg_callback
(
0
,
s
->
version
,
TLS1_RT_HEARTBEAT
,
s
->
msg_callback
(
0
,
s
->
version
,
TLS1_RT_HEARTBEAT
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录