Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6ad47e83
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看板
提交
6ad47e83
编写于
1月 11, 2006
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improvements for alert handling
上级
241520e6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
51 deletion
+65
-51
ssl/s23_clnt.c
ssl/s23_clnt.c
+45
-51
ssl/ssl_stat.c
ssl/ssl_stat.c
+20
-0
未找到文件。
ssl/s23_clnt.c
浏览文件 @
6ad47e83
...
...
@@ -542,7 +542,7 @@ static int ssl23_get_server_hello(SSL *s)
/* use special padding (SSL 3.0 draft/RFC 2246, App. E.2) */
s
->
s2
->
ssl2_rollback
=
1
;
/* setup the
5
bytes we have read so we get them from
/* setup the
7
bytes we have read so we get them from
* the sslv2 buffer */
s
->
rstate
=
SSL_ST_READ_HEADER
;
s
->
packet_length
=
n
;
...
...
@@ -558,28 +558,12 @@ static int ssl23_get_server_hello(SSL *s)
s
->
handshake_func
=
s
->
method
->
ssl_connect
;
#endif
}
else
if
((
p
[
0
]
==
SSL3_RT_HANDSHAKE
)
&&
(
p
[
1
]
==
SSL3_VERSION_MAJOR
)
&&
((
p
[
2
]
==
SSL3_VERSION_MINOR
)
||
(
p
[
2
]
==
TLS1_VERSION_MINOR
))
&&
(
p
[
5
]
==
SSL3_MT_SERVER_HELLO
))
else
if
(
p
[
1
]
==
SSL3_VERSION_MAJOR
&&
(
p
[
2
]
==
SSL3_VERSION_MINOR
||
p
[
2
]
==
TLS1_VERSION_MINOR
)
&&
((
p
[
0
]
==
SSL3_RT_HANDSHAKE
&&
p
[
5
]
==
SSL3_MT_SERVER_HELLO
)
||
(
p
[
0
]
==
SSL3_RT_ALERT
&&
p
[
3
]
==
0
&&
p
[
4
]
==
2
)))
{
/* we have sslv3 or tls1 */
have_sslv3_or_tls1:
if
(
!
ssl_init_wbio_buffer
(
s
,
1
))
goto
err
;
/* we are in this state */
s
->
state
=
SSL3_ST_CR_SRVR_HELLO_A
;
/* put the 5 bytes we have read into the input buffer
* for SSLv3 */
s
->
rstate
=
SSL_ST_READ_HEADER
;
s
->
packet_length
=
n
;
s
->
packet
=
&
(
s
->
s3
->
rbuf
.
buf
[
0
]);
memcpy
(
s
->
packet
,
buf
,
n
);
s
->
s3
->
rbuf
.
left
=
n
;
s
->
s3
->
rbuf
.
offset
=
0
;
/* we have sslv3 or tls1 (server hello or alert) */
if
((
p
[
2
]
==
SSL3_VERSION_MINOR
)
&&
!
(
s
->
options
&
SSL_OP_NO_SSLv3
))
...
...
@@ -598,38 +582,49 @@ static int ssl23_get_server_hello(SSL *s)
SSLerr
(
SSL_F_SSL23_GET_SERVER_HELLO
,
SSL_R_UNSUPPORTED_PROTOCOL
);
goto
err
;
}
s
->
handshake_func
=
s
->
method
->
ssl_connect
;
}
else
if
((
p
[
0
]
==
SSL3_RT_ALERT
)
&&
(
p
[
1
]
==
SSL3_VERSION_MAJOR
)
&&
((
p
[
2
]
==
SSL3_VERSION_MINOR
)
||
(
p
[
2
]
==
TLS1_VERSION_MINOR
))
&&
(
p
[
3
]
==
0
)
&&
(
p
[
4
]
==
2
))
{
void
(
*
cb
)(
const
SSL
*
ssl
,
int
type
,
int
val
)
=
NULL
;
int
j
;
/* An alert */
if
(
s
->
info_callback
!=
NULL
)
cb
=
s
->
info_callback
;
else
if
(
s
->
ctx
->
info_callback
!=
NULL
)
cb
=
s
->
ctx
->
info_callback
;
i
=
p
[
5
];
if
(
cb
!=
NULL
)
if
(
p
[
0
]
==
SSL3_RT_ALERT
&&
p
[
5
]
!=
SSL3_AL_WARNING
)
{
j
=
(
i
<<
8
)
|
p
[
6
];
cb
(
s
,
SSL_CB_READ_ALERT
,
j
);
/* fatal alert */
void
(
*
cb
)(
const
SSL
*
ssl
,
int
type
,
int
val
)
=
NULL
;
int
j
;
if
(
s
->
info_callback
!=
NULL
)
cb
=
s
->
info_callback
;
else
if
(
s
->
ctx
->
info_callback
!=
NULL
)
cb
=
s
->
ctx
->
info_callback
;
i
=
p
[
5
];
if
(
cb
!=
NULL
)
{
j
=
(
i
<<
8
)
|
p
[
6
];
cb
(
s
,
SSL_CB_READ_ALERT
,
j
);
}
if
(
s
->
msg_callback
)
s
->
msg_callback
(
0
,
s
->
version
,
SSL3_RT_ALERT
,
p
+
5
,
2
,
s
,
s
->
msg_callback_arg
);
s
->
rwstate
=
SSL_NOTHING
;
SSLerr
(
SSL_F_SSL23_GET_SERVER_HELLO
,
SSL_AD_REASON_OFFSET
+
p
[
6
]);
goto
err
;
}
if
(
p
[
5
]
==
SSL3_AL_WARNING
)
goto
have_sslv3_or_tls1
;
if
(
!
ssl_init_wbio_buffer
(
s
,
1
))
goto
err
;
s
->
rwstate
=
SSL_NOTHING
;
SSLerr
(
SSL_F_SSL23_GET_SERVER_HELLO
,
SSL_AD_REASON_OFFSET
+
p
[
6
]);
goto
err
;
/* we are in this state */
s
->
state
=
SSL3_ST_CR_SRVR_HELLO_A
;
/* put the 7 bytes we have read into the input buffer
* for SSLv3 */
s
->
rstate
=
SSL_ST_READ_HEADER
;
s
->
packet_length
=
n
;
s
->
packet
=
&
(
s
->
s3
->
rbuf
.
buf
[
0
]);
memcpy
(
s
->
packet
,
buf
,
n
);
s
->
s3
->
rbuf
.
left
=
n
;
s
->
s3
->
rbuf
.
offset
=
0
;
s
->
handshake_func
=
s
->
method
->
ssl_connect
;
}
else
{
...
...
@@ -648,4 +643,3 @@ static int ssl23_get_server_hello(SSL *s)
err:
return
(
-
1
);
}
ssl/ssl_stat.c
浏览文件 @
6ad47e83
...
...
@@ -399,6 +399,11 @@ const char *SSL_alert_desc_string(int value)
case
TLS1_AD_INTERNAL_ERROR
:
str
=
"IE"
;
break
;
case
TLS1_AD_USER_CANCELLED
:
str
=
"US"
;
break
;
case
TLS1_AD_NO_RENEGOTIATION
:
str
=
"NR"
;
break
;
case
TLS1_AD_UNSUPPORTED_EXTENSION
:
str
=
"UE"
;
break
;
case
TLS1_AD_CERTIFICATE_UNOBTAINABLE
:
str
=
"CO"
;
break
;
case
TLS1_AD_UNRECOGNIZED_NAME
:
str
=
"UN"
;
break
;
case
TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
:
str
=
"BR"
;
break
;
case
TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
:
str
=
"BH"
;
break
;
default:
str
=
"UK"
;
break
;
}
return
(
str
);
...
...
@@ -482,6 +487,21 @@ const char *SSL_alert_desc_string_long(int value)
case
TLS1_AD_NO_RENEGOTIATION
:
str
=
"no renegotiation"
;
break
;
case
TLS1_AD_UNSUPPORTED_EXTENSION
:
str
=
"unsupported extension"
;
break
;
case
TLS1_AD_CERTIFICATE_UNOBTAINABLE
:
str
=
"certificate unobtainable"
;
break
;
case
TLS1_AD_UNRECOGNIZED_NAME
:
str
=
"unrecognized name"
;
break
;
case
TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
:
str
=
"bad certificate status response"
;
break
;
case
TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
:
str
=
"bad certificate hash value"
;
break
;
default:
str
=
"unknown"
;
break
;
}
return
(
str
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录