Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
e5599db4
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5599db4
编写于
2月 25, 2000
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix warnings by using unsigned int where appropriate.
上级
26fb2b4b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
25 deletion
+25
-25
ssl/s3_pkt.c
ssl/s3_pkt.c
+23
-23
ssl/ssl3.h
ssl/ssl3.h
+2
-2
未找到文件。
ssl/s3_pkt.c
浏览文件 @
e5599db4
...
...
@@ -706,7 +706,8 @@ static int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
*/
int
ssl3_read_bytes
(
SSL
*
s
,
int
type
,
unsigned
char
*
buf
,
int
len
)
{
int
al
,
i
,
j
,
n
,
ret
;
int
al
,
i
,
j
,
ret
;
unsigned
int
n
;
SSL3_RECORD
*
rr
;
void
(
*
cb
)()
=
NULL
;
...
...
@@ -803,11 +804,11 @@ start:
if
(
len
<=
0
)
return
(
len
);
if
((
unsigned
int
)
len
>
rr
->
length
)
n
=
rr
->
length
;
n
=
rr
->
length
;
else
n
=
len
;
n
=
(
unsigned
int
)
len
;
memcpy
(
buf
,
&
(
rr
->
data
[
rr
->
off
]),
(
unsigned
int
)
n
);
memcpy
(
buf
,
&
(
rr
->
data
[
rr
->
off
]),
n
);
rr
->
length
-=
n
;
rr
->
off
+=
n
;
if
(
rr
->
length
==
0
)
...
...
@@ -826,9 +827,9 @@ start:
* fill that so that we can process the data at a fixed place.
*/
{
int
dest_maxlen
=
0
;
unsigned
int
dest_maxlen
=
0
;
unsigned
char
*
dest
=
NULL
;
int
*
dest_len
=
NULL
;
unsigned
int
*
dest_len
=
NULL
;
if
(
rr
->
type
==
SSL3_RT_HANDSHAKE
)
{
...
...
@@ -846,7 +847,7 @@ start:
if
(
dest_maxlen
>
0
)
{
n
=
dest_maxlen
-
*
dest_len
;
/* available space in 'dest' */
if
(
rr
->
length
<
(
unsigned
int
)
n
)
if
(
rr
->
length
<
n
)
n
=
rr
->
length
;
/* available bytes */
/* now move 'n' bytes: */
...
...
@@ -920,8 +921,8 @@ start:
if
(
s
->
s3
->
alert_fragment_len
>=
2
)
{
i
=
s
->
s3
->
alert_fragment
[
0
];
n
=
s
->
s3
->
alert_fragment
[
1
];
i
nt
alert_level
=
s
->
s3
->
alert_fragment
[
0
];
int
alert_descr
=
s
->
s3
->
alert_fragment
[
1
];
s
->
s3
->
alert_fragment_len
=
0
;
...
...
@@ -932,28 +933,27 @@ start:
if
(
cb
!=
NULL
)
{
j
=
(
i
<<
8
)
|
n
;
cb
(
s
,
SSL_CB_READ_ALERT
,
j
);
j
=
(
alert_level
<<
8
)
|
alert_descr
;
cb
(
s
,
SSL_CB_READ_ALERT
,
j
);
}
if
(
i
==
1
)
/* warning */
if
(
alert_level
==
1
)
/* warning */
{
s
->
s3
->
warn_alert
=
n
;
if
(
n
==
SSL_AD_CLOSE_NOTIFY
)
s
->
s3
->
warn_alert
=
alert_descr
;
if
(
alert_descr
==
SSL_AD_CLOSE_NOTIFY
)
{
s
->
shutdown
|=
SSL_RECEIVED_SHUTDOWN
;
s
->
shutdown
|=
SSL_RECEIVED_SHUTDOWN
;
return
(
0
);
}
}
else
if
(
i
==
2
)
/* fatal */
else
if
(
alert_level
==
2
)
/* fatal */
{
char
tmp
[
16
];
s
->
rwstate
=
SSL_NOTHING
;
s
->
s3
->
fatal_alert
=
n
;
SSLerr
(
SSL_F_SSL3_READ_BYTES
,
SSL_AD_REASON_OFFSET
+
n
);
sprintf
(
tmp
,
"%d"
,
n
);
s
->
s3
->
fatal_alert
=
alert_descr
;
SSLerr
(
SSL_F_SSL3_READ_BYTES
,
SSL_AD_REASON_OFFSET
+
alert_descr
);
sprintf
(
tmp
,
"%d"
,
alert_descr
);
ERR_add_error_data
(
2
,
"SSL alert number "
,
tmp
);
s
->
shutdown
|=
SSL_RECEIVED_SHUTDOWN
;
SSL_CTX_remove_session
(
s
->
ctx
,
s
->
session
);
...
...
@@ -1013,9 +1013,9 @@ start:
#endif
s
->
new_session
=
1
;
}
n
=
s
->
handshake_func
(
s
);
if
(
n
<
0
)
return
(
n
);
if
(
n
==
0
)
i
=
s
->
handshake_func
(
s
);
if
(
i
<
0
)
return
(
i
);
if
(
i
==
0
)
{
SSLerr
(
SSL_F_SSL3_READ_BYTES
,
SSL_R_SSL_HANDSHAKE_FAILURE
);
return
(
-
1
);
...
...
ssl/ssl3.h
浏览文件 @
e5599db4
...
...
@@ -240,9 +240,9 @@ typedef struct ssl3_state_st
/* storage for Alert/Handshake protocol data received but not
* yet processed by ssl3_read_bytes: */
unsigned
char
alert_fragment
[
2
];
int
alert_fragment_len
;
unsigned
int
alert_fragment_len
;
unsigned
char
handshake_fragment
[
4
];
int
handshake_fragment_len
;
unsigned
int
handshake_fragment_len
;
/* partial write - check the numbers match */
unsigned
int
wnum
;
/* number of bytes sent so far */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录