Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
9fb617e2
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看板
提交
9fb617e2
编写于
1月 06, 2000
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use less complicated arrangement for data strutures related to Finished
messages.
上级
f2d9a32c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
46 deletion
+13
-46
ssl/s3_both.c
ssl/s3_both.c
+7
-34
ssl/s3_pkt.c
ssl/s3_pkt.c
+2
-8
ssl/ssl3.h
ssl/ssl3.h
+4
-4
未找到文件。
ssl/s3_both.c
浏览文件 @
9fb617e2
...
...
@@ -70,19 +70,6 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen)
unsigned
char
*
p
,
*
d
;
int
i
;
unsigned
long
l
;
unsigned
char
*
finish_md
;
int
*
finish_md_len
;
if
(
s
->
state
&
SSL_ST_ACCEPT
)
{
finish_md
=
s
->
s3
->
tmp
.
server_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
server_finish_md_len
;
}
else
{
finish_md
=
s
->
s3
->
tmp
.
client_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
client_finish_md_len
;
}
if
(
s
->
state
==
a
)
{
...
...
@@ -92,9 +79,9 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen)
i
=
s
->
method
->
ssl3_enc
->
final_finish_mac
(
s
,
&
(
s
->
s3
->
finish_dgst1
),
&
(
s
->
s3
->
finish_dgst2
),
sender
,
slen
,
finish_md
);
*
finish_md_len
=
i
;
memcpy
(
p
,
finish_md
,
i
);
sender
,
slen
,
s
->
s3
->
tmp
.
finish_md
);
s
->
s3
->
tmp
.
finish_md_len
=
i
;
memcpy
(
p
,
s
->
s3
->
tmp
.
finish_md
,
i
);
p
+=
i
;
l
=
i
;
...
...
@@ -122,22 +109,9 @@ int ssl3_get_finished(SSL *s, int a, int b)
int
al
,
i
,
ok
;
long
n
;
unsigned
char
*
p
;
unsigned
char
*
finish_md
;
int
*
finish_md_len
;
if
(
s
->
state
&
SSL_ST_ACCEPT
)
{
finish_md
=
s
->
s3
->
tmp
.
client_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
client_finish_md_len
;
}
else
{
finish_md
=
s
->
s3
->
tmp
.
server_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
server_finish_md_len
;
}
/* the mac has already been generated when we received the
* change cipher spec message and is in finish_md
* change cipher spec message and is in
s->s3->tmp.peer_
finish_md
*/
n
=
ssl3_get_message
(
s
,
...
...
@@ -158,9 +132,8 @@ int ssl3_get_finished(SSL *s, int a, int b)
}
s
->
s3
->
change_cipher_spec
=
0
;
p
=
(
unsigned
char
*
)
s
->
init_buf
->
data
;
i
=*
finish_md_len
;
p
=
(
unsigned
char
*
)
s
->
init_buf
->
data
;
i
=
s
->
s3
->
tmp
.
peer_finish_md_len
;
if
(
i
!=
n
)
{
...
...
@@ -169,7 +142,7 @@ int ssl3_get_finished(SSL *s, int a, int b)
goto
f_err
;
}
if
(
memcmp
(
p
,
finish_md
,
i
)
!=
0
)
if
(
memcmp
(
p
,
s
->
s3
->
tmp
.
peer_
finish_md
,
i
)
!=
0
)
{
al
=
SSL_AD_DECRYPT_ERROR
;
SSLerr
(
SSL_F_SSL3_GET_FINISHED
,
SSL_R_DIGEST_CHECK_FAILED
);
...
...
ssl/s3_pkt.c
浏览文件 @
9fb617e2
...
...
@@ -937,8 +937,6 @@ static int do_change_cipher_spec(SSL *s)
int
i
;
const
char
*
sender
;
int
slen
;
unsigned
char
*
finish_md
;
int
*
finish_md_len
;
if
(
s
->
state
&
SSL_ST_ACCEPT
)
i
=
SSL3_CHANGE_CIPHER_SERVER_READ
;
...
...
@@ -961,21 +959,17 @@ static int do_change_cipher_spec(SSL *s)
{
sender
=
s
->
method
->
ssl3_enc
->
server_finished_label
;
slen
=
s
->
method
->
ssl3_enc
->
server_finished_label_len
;
finish_md
=
s
->
s3
->
tmp
.
server_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
server_finish_md_len
;
}
else
{
sender
=
s
->
method
->
ssl3_enc
->
client_finished_label
;
slen
=
s
->
method
->
ssl3_enc
->
client_finished_label_len
;
finish_md
=
s
->
s3
->
tmp
.
client_finish_md
;
finish_md_len
=
&
s
->
s3
->
tmp
.
client_finish_md_len
;
}
*
finish_md_len
=
s
->
method
->
ssl3_enc
->
final_finish_mac
(
s
,
s
->
s3
->
tmp
.
peer_
finish_md_len
=
s
->
method
->
ssl3_enc
->
final_finish_mac
(
s
,
&
(
s
->
s3
->
finish_dgst1
),
&
(
s
->
s3
->
finish_dgst2
),
sender
,
slen
,
finish_md
);
sender
,
slen
,
s
->
s3
->
tmp
.
peer_
finish_md
);
return
(
1
);
}
...
...
ssl/ssl3.h
浏览文件 @
9fb617e2
...
...
@@ -318,10 +318,10 @@ typedef struct ssl3_ctx_st
unsigned
char
cert_verify_md
[
EVP_MAX_MD_SIZE
*
2
];
/* actually only need to be 16+20 for SSLv3 and 12 for TLS */
unsigned
char
server_
finish_md
[
EVP_MAX_MD_SIZE
*
2
];
int
server_
finish_md_len
;
unsigned
char
client
_finish_md
[
EVP_MAX_MD_SIZE
*
2
];
int
client
_finish_md_len
;
unsigned
char
finish_md
[
EVP_MAX_MD_SIZE
*
2
];
int
finish_md_len
;
unsigned
char
peer
_finish_md
[
EVP_MAX_MD_SIZE
*
2
];
int
peer
_finish_md_len
;
unsigned
long
message_size
;
int
message_type
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录