Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
15e6be6c
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看板
提交
15e6be6c
编写于
9月 14, 2016
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert NextProto message construction to WPACKET
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
c49e1912
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
33 addition
and
11 deletion
+33
-11
include/openssl/ssl.h
include/openssl/ssl.h
+1
-0
ssl/ssl_err.c
ssl/ssl_err.c
+1
-0
ssl/statem/statem_clnt.c
ssl/statem/statem_clnt.c
+31
-11
未找到文件。
include/openssl/ssl.h
浏览文件 @
15e6be6c
...
@@ -2232,6 +2232,7 @@ int ERR_load_SSL_strings(void);
...
@@ -2232,6 +2232,7 @@ int ERR_load_SSL_strings(void);
# define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 358
# define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 358
# define SSL_F_TLS_CONSTRUCT_FINISHED 359
# define SSL_F_TLS_CONSTRUCT_FINISHED 359
# define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 373
# define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 373
# define SSL_F_TLS_CONSTRUCT_NEXT_PROTO 426
# define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 374
# define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 374
# define SSL_F_TLS_CONSTRUCT_SERVER_DONE 375
# define SSL_F_TLS_CONSTRUCT_SERVER_DONE 375
# define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 376
# define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 376
...
...
ssl/ssl_err.c
浏览文件 @
15e6be6c
...
@@ -257,6 +257,7 @@ static ERR_STRING_DATA SSL_str_functs[] = {
...
@@ -257,6 +257,7 @@ static ERR_STRING_DATA SSL_str_functs[] = {
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_FINISHED
),
"tls_construct_finished"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_FINISHED
),
"tls_construct_finished"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_HELLO_REQUEST
),
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_HELLO_REQUEST
),
"tls_construct_hello_request"
},
"tls_construct_hello_request"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_NEXT_PROTO
),
"tls_construct_next_proto"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE
),
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE
),
"tls_construct_server_certificate"
},
"tls_construct_server_certificate"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_SERVER_DONE
),
"tls_construct_server_done"
},
{
ERR_FUNC
(
SSL_F_TLS_CONSTRUCT_SERVER_DONE
),
"tls_construct_server_done"
},
...
...
ssl/statem/statem_clnt.c
浏览文件 @
15e6be6c
...
@@ -2895,22 +2895,42 @@ int ssl3_check_cert_and_algorithm(SSL *s)
...
@@ -2895,22 +2895,42 @@ int ssl3_check_cert_and_algorithm(SSL *s)
#ifndef OPENSSL_NO_NEXTPROTONEG
#ifndef OPENSSL_NO_NEXTPROTONEG
int
tls_construct_next_proto
(
SSL
*
s
)
int
tls_construct_next_proto
(
SSL
*
s
)
{
{
unsigned
int
len
,
padding_len
;
size_t
len
,
padding_len
;
unsigned
char
*
d
;
unsigned
char
*
padding
=
NULL
;
WPACKET
pkt
;
if
(
!
WPACKET_init
(
&
pkt
,
s
->
init_buf
))
{
/* Should not happen */
SSLerr
(
SSL_F_TLS_CONSTRUCT_NEXT_PROTO
,
ERR_R_INTERNAL_ERROR
);
goto
err
;
}
if
(
!
ssl_set_handshake_header2
(
s
,
&
pkt
,
SSL3_MT_NEXT_PROTO
))
{
SSLerr
(
SSL_F_TLS_CONSTRUCT_NEXT_PROTO
,
ERR_R_INTERNAL_ERROR
);
goto
err
;
}
len
=
s
->
next_proto_negotiated_len
;
len
=
s
->
next_proto_negotiated_len
;
padding_len
=
32
-
((
len
+
2
)
%
32
);
padding_len
=
32
-
((
len
+
2
)
%
32
);
d
=
(
unsigned
char
*
)
s
->
init_buf
->
data
;
d
[
4
]
=
len
;
if
(
!
WPACKET_sub_memcpy_u8
(
&
pkt
,
s
->
next_proto_negotiated
,
len
)
memcpy
(
d
+
5
,
s
->
next_proto_negotiated
,
len
);
||
!
WPACKET_sub_allocate_bytes_u8
(
&
pkt
,
padding_len
,
&
padding
))
{
d
[
5
+
len
]
=
padding_len
;
SSLerr
(
SSL_F_TLS_CONSTRUCT_NEXT_PROTO
,
ERR_R_INTERNAL_ERROR
);
memset
(
d
+
6
+
len
,
0
,
padding_len
);
goto
err
;
*
(
d
++
)
=
SSL3_MT_NEXT_PROTO
;
}
l2n3
(
2
+
len
+
padding_len
,
d
);
s
->
init_num
=
4
+
2
+
len
+
padding_len
;
memset
(
padding
,
0
,
padding_len
);
s
->
init_off
=
0
;
if
(
!
ssl_close_construct_packet
(
s
,
&
pkt
))
{
SSLerr
(
SSL_F_TLS_CONSTRUCT_NEXT_PROTO
,
ERR_R_INTERNAL_ERROR
);
goto
err
;
}
return
1
;
return
1
;
err:
WPACKET_cleanup
(
&
pkt
);
ssl3_send_alert
(
s
,
SSL3_AL_FATAL
,
SSL_AD_INTERNAL_ERROR
);
return
0
;
}
}
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录