Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7ba666fa
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
12 个月 前同步成功
通知
8
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7ba666fa
编写于
12月 08, 2002
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Since it's defined in draft-ietf-tls-compression-04.txt, let's make
ZLIB a known compression method, with the identity 1.
上级
86a62cf1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
22 deletion
+63
-22
ssl/ssl.h
ssl/ssl.h
+1
-0
ssl/ssl_ciph.c
ssl/ssl_ciph.c
+61
-22
ssl/ssl_err.c
ssl/ssl_err.c
+1
-0
未找到文件。
ssl/ssl.h
浏览文件 @
7ba666fa
...
...
@@ -1690,6 +1690,7 @@ void ERR_load_SSL_strings(void);
#define SSL_R_CIPHER_TABLE_SRC_ERROR 139
#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
#define SSL_R_COMPRESSION_FAILURE 141
#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 1120
#define SSL_R_COMPRESSION_LIBRARY_ERROR 142
#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
#define SSL_R_CONNECTION_TYPE_NOT_SET 144
...
...
ssl/ssl_ciph.c
浏览文件 @
7ba666fa
...
...
@@ -80,6 +80,10 @@ static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
};
#define SSL_COMP_NULL_IDX 0
#define SSL_COMP_ZLIB_IDX 1
#define SSL_COMP_NUM_IDX 2
static
STACK_OF
(
SSL_COMP
)
*
ssl_comp_methods
=
NULL
;
#define SSL_MD_MD5_IDX 0
...
...
@@ -185,6 +189,41 @@ static void load_ciphers(void)
EVP_get_digestbyname
(
SN_sha1
);
}
static
int
sk_comp_cmp
(
const
SSL_COMP
*
const
*
a
,
const
SSL_COMP
*
const
*
b
)
{
return
((
*
a
)
->
id
-
(
*
b
)
->
id
);
}
static
void
load_builtin_compressions
(
void
)
{
if
(
ssl_comp_methods
==
NULL
)
{
SSL_COMP
*
comp
=
NULL
;
MemCheck_off
();
ssl_comp_methods
=
sk_SSL_COMP_new
(
sk_comp_cmp
);
if
(
ssl_comp_methods
!=
NULL
)
{
comp
=
(
SSL_COMP
*
)
OPENSSL_malloc
(
sizeof
(
SSL_COMP
));
if
(
comp
!=
NULL
)
{
comp
->
method
=
COMP_zlib
();
if
(
comp
->
method
&&
comp
->
method
->
type
==
NID_undef
)
OPENSSL_free
(
comp
);
else
{
comp
->
id
=
SSL_COMP_ZLIB_IDX
;
comp
->
name
=
comp
->
method
->
name
;
sk_SSL_COMP_push
(
ssl_comp_methods
,
comp
);
}
}
}
MemCheck_on
();
}
}
int
ssl_cipher_get_evp
(
SSL_SESSION
*
s
,
const
EVP_CIPHER
**
enc
,
const
EVP_MD
**
md
,
SSL_COMP
**
comp
)
{
...
...
@@ -197,17 +236,12 @@ int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
{
SSL_COMP
ctmp
;
if
(
s
->
compress_meth
==
0
)
*
comp
=
NULL
;
else
if
(
ssl_comp_methods
==
NULL
)
{
/* bad */
*
comp
=
NULL
;
}
else
{
load_builtin_compressions
();
ctmp
.
id
=
s
->
compress_meth
;
*
comp
=
NULL
;
ctmp
.
id
=
s
->
compress_meth
;
if
(
ssl_comp_methods
!=
NULL
)
{
i
=
sk_SSL_COMP_find
(
ssl_comp_methods
,
&
ctmp
);
if
(
i
>=
0
)
*
comp
=
sk_SSL_COMP_value
(
ssl_comp_methods
,
i
);
...
...
@@ -1107,35 +1141,40 @@ SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
return
(
NULL
);
}
static
int
sk_comp_cmp
(
const
SSL_COMP
*
const
*
a
,
const
SSL_COMP
*
const
*
b
)
{
return
((
*
a
)
->
id
-
(
*
b
)
->
id
);
}
STACK_OF
(
SSL_COMP
)
*
SSL_COMP_get_compression_methods
(
void
)
{
load_builtin_compressions
();
return
(
ssl_comp_methods
);
}
int
SSL_COMP_add_compression_method
(
int
id
,
COMP_METHOD
*
cm
)
{
SSL_COMP
*
comp
;
STACK_OF
(
SSL_COMP
)
*
sk
;
if
(
cm
==
NULL
||
cm
->
type
==
NID_undef
)
return
1
;
/* According to draft-ietf-tls-compression-04.txt, the
compression number ranges should be the following:
0 to 63: methods defined by the IETF
64 to 192: external party methods assigned by IANA
193 to 255: reserved for private use */
if
(
id
<
193
||
id
>
255
)
{
SSLerr
(
SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD
,
SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
);
return
0
;
}
MemCheck_off
();
comp
=
(
SSL_COMP
*
)
OPENSSL_malloc
(
sizeof
(
SSL_COMP
));
comp
->
id
=
id
;
comp
->
method
=
cm
;
if
(
ssl_comp_methods
==
NULL
)
sk
=
ssl_comp_methods
=
sk_SSL_COMP_new
(
sk_comp_cmp
);
else
sk
=
ssl_comp_methods
;
if
((
sk
==
NULL
)
||
!
sk_SSL_COMP_push
(
sk
,
comp
))
load_builtin_compressions
();
if
((
ssl_comp_methods
==
NULL
)
||
!
sk_SSL_COMP_push
(
ssl_comp_methods
,
comp
))
{
OPENSSL_free
(
comp
);
MemCheck_on
();
SSLerr
(
SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD
,
ERR_R_MALLOC_FAILURE
);
return
(
0
);
...
...
ssl/ssl_err.c
浏览文件 @
7ba666fa
...
...
@@ -261,6 +261,7 @@ static ERR_STRING_DATA SSL_str_reasons[]=
{
SSL_R_CIPHER_TABLE_SRC_ERROR
,
"cipher table src error"
},
{
SSL_R_COMPRESSED_LENGTH_TOO_LONG
,
"compressed length too long"
},
{
SSL_R_COMPRESSION_FAILURE
,
"compression failure"
},
{
SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
,
"compression id not within private range"
},
{
SSL_R_COMPRESSION_LIBRARY_ERROR
,
"compression library error"
},
{
SSL_R_CONNECTION_ID_IS_DIFFERENT
,
"connection id is different"
},
{
SSL_R_CONNECTION_TYPE_NOT_SET
,
"connection type not set"
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录