Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
df63a389
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
df63a389
编写于
6月 09, 1999
作者:
U
Ulf Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"extern" is a C++ reserved word.
Pointed out by: Janez Jere <jj@void.si>
上级
4e6ec1da
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
34 addition
and
31 deletion
+34
-31
apps/s_server.c
apps/s_server.c
+2
-2
ssl/s2_srvr.c
ssl/s2_srvr.c
+9
-9
ssl/ssl.h
ssl/ssl.h
+7
-5
ssl/ssl_lib.c
ssl/ssl_lib.c
+12
-11
ssl/ssl_locl.h
ssl/ssl_locl.h
+2
-2
ssl/ssltest.c
ssl/ssltest.c
+2
-2
未找到文件。
apps/s_server.c
浏览文件 @
df63a389
...
@@ -93,7 +93,7 @@ typedef unsigned int u_int;
...
@@ -93,7 +93,7 @@ typedef unsigned int u_int;
#endif
#endif
#ifndef NO_RSA
#ifndef NO_RSA
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
export
,
int
keylength
);
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
is_export
,
int
keylength
);
#endif
#endif
static
int
sv_body
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
);
static
int
sv_body
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
);
static
int
www_body
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
);
static
int
www_body
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
);
...
@@ -1394,7 +1394,7 @@ err:
...
@@ -1394,7 +1394,7 @@ err:
}
}
#ifndef NO_RSA
#ifndef NO_RSA
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
export
,
int
keylength
)
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
is_
export
,
int
keylength
)
{
{
static
RSA
*
rsa_tmp
=
NULL
;
static
RSA
*
rsa_tmp
=
NULL
;
...
...
ssl/s2_srvr.c
浏览文件 @
df63a389
...
@@ -321,7 +321,7 @@ end:
...
@@ -321,7 +321,7 @@ end:
static
int
get_client_master_key
(
SSL
*
s
)
static
int
get_client_master_key
(
SSL
*
s
)
{
{
int
export
,
i
,
n
,
keya
,
ek
;
int
is_
export
,
i
,
n
,
keya
,
ek
;
unsigned
char
*
p
;
unsigned
char
*
p
;
SSL_CIPHER
*
cp
;
SSL_CIPHER
*
cp
;
const
EVP_CIPHER
*
c
;
const
EVP_CIPHER
*
c
;
...
@@ -385,7 +385,7 @@ static int get_client_master_key(SSL *s)
...
@@ -385,7 +385,7 @@ static int get_client_master_key(SSL *s)
&
(
p
[
s
->
s2
->
tmp
.
clear
]),
&
(
p
[
s
->
s2
->
tmp
.
clear
]),
&
(
p
[
s
->
s2
->
tmp
.
clear
]),
&
(
p
[
s
->
s2
->
tmp
.
clear
]),
(
s
->
s2
->
ssl2_rollback
)
?
RSA_SSLV23_PADDING
:
RSA_PKCS1_PADDING
);
(
s
->
s2
->
ssl2_rollback
)
?
RSA_SSLV23_PADDING
:
RSA_PKCS1_PADDING
);
export
=
SSL_C_IS_EXPORT
(
s
->
session
->
cipher
);
is_
export
=
SSL_C_IS_EXPORT
(
s
->
session
->
cipher
);
if
(
!
ssl_cipher_get_evp
(
s
->
session
,
&
c
,
&
md
,
NULL
))
if
(
!
ssl_cipher_get_evp
(
s
->
session
,
&
c
,
&
md
,
NULL
))
{
{
...
@@ -396,7 +396,7 @@ static int get_client_master_key(SSL *s)
...
@@ -396,7 +396,7 @@ static int get_client_master_key(SSL *s)
if
(
s
->
session
->
cipher
->
algorithm2
&
SSL2_CF_8_BYTE_ENC
)
if
(
s
->
session
->
cipher
->
algorithm2
&
SSL2_CF_8_BYTE_ENC
)
{
{
export
=
1
;
is_
export
=
1
;
ek
=
8
;
ek
=
8
;
}
}
else
else
...
@@ -407,11 +407,11 @@ static int get_client_master_key(SSL *s)
...
@@ -407,11 +407,11 @@ static int get_client_master_key(SSL *s)
/* If a bad decrypt, continue with protocol but with a
/* If a bad decrypt, continue with protocol but with a
* dud master secret */
* dud master secret */
if
((
i
<
0
)
||
if
((
i
<
0
)
||
((
!
export
&&
(
i
!=
EVP_CIPHER_key_length
(
c
)))
((
!
is_
export
&&
(
i
!=
EVP_CIPHER_key_length
(
c
)))
||
(
export
&&
((
i
!=
ek
)
||
(
s
->
s2
->
tmp
.
clear
+
i
!=
||
(
is_
export
&&
((
i
!=
ek
)
||
(
s
->
s2
->
tmp
.
clear
+
i
!=
EVP_CIPHER_key_length
(
c
))))))
EVP_CIPHER_key_length
(
c
))))))
{
{
if
(
export
)
if
(
is_
export
)
i
=
ek
;
i
=
ek
;
else
else
i
=
EVP_CIPHER_key_length
(
c
);
i
=
EVP_CIPHER_key_length
(
c
);
...
@@ -424,8 +424,8 @@ static int get_client_master_key(SSL *s)
...
@@ -424,8 +424,8 @@ static int get_client_master_key(SSL *s)
SSLerr
(
SSL_F_GET_CLIENT_MASTER_KEY
,
SSL_R_BAD_RSA_DECRYPT
);
SSLerr
(
SSL_F_GET_CLIENT_MASTER_KEY
,
SSL_R_BAD_RSA_DECRYPT
);
}
}
/* incorrect number of key bytes for non export cipher */
/* incorrect number of key bytes for non export cipher */
else
if
((
!
export
&&
(
i
!=
EVP_CIPHER_key_length
(
c
)))
else
if
((
!
is_
export
&&
(
i
!=
EVP_CIPHER_key_length
(
c
)))
||
(
export
&&
((
i
!=
ek
)
||
(
s
->
s2
->
tmp
.
clear
+
i
!=
||
(
is_
export
&&
((
i
!=
ek
)
||
(
s
->
s2
->
tmp
.
clear
+
i
!=
EVP_CIPHER_key_length
(
c
)))))
EVP_CIPHER_key_length
(
c
)))))
{
{
error
=
1
;
error
=
1
;
...
@@ -438,7 +438,7 @@ static int get_client_master_key(SSL *s)
...
@@ -438,7 +438,7 @@ static int get_client_master_key(SSL *s)
}
}
#endif
#endif
if
(
export
)
i
+=
s
->
s2
->
tmp
.
clear
;
if
(
is_
export
)
i
+=
s
->
s2
->
tmp
.
clear
;
s
->
session
->
master_key_length
=
i
;
s
->
session
->
master_key_length
=
i
;
memcpy
(
s
->
session
->
master_key
,
p
,(
unsigned
int
)
i
);
memcpy
(
s
->
session
->
master_key
,
p
,(
unsigned
int
)
i
);
return
(
1
);
return
(
1
);
...
...
ssl/ssl.h
浏览文件 @
df63a389
...
@@ -1084,21 +1084,23 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void );
...
@@ -1084,21 +1084,23 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void );
#define SSL_CTX_set_read_ahead(ctx,m) \
#define SSL_CTX_set_read_ahead(ctx,m) \
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,0,NULL)
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,0,NULL)
/* NB: the keylength is only applicable when export is true */
/* NB: the keylength is only applicable when
is_
export is true */
#ifndef NO_RSA
#ifndef NO_RSA
void
SSL_CTX_set_tmp_rsa_callback
(
SSL_CTX
*
ctx
,
void
SSL_CTX_set_tmp_rsa_callback
(
SSL_CTX
*
ctx
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
export
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
is_
export
,
int
keylength
));
int
keylength
));
void
SSL_set_tmp_rsa_callback
(
SSL
*
ssl
,
void
SSL_set_tmp_rsa_callback
(
SSL
*
ssl
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
export
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
is_
export
,
int
keylength
));
int
keylength
));
#endif
#endif
#ifndef NO_DH
#ifndef NO_DH
void
SSL_CTX_set_tmp_dh_callback
(
SSL_CTX
*
ctx
,
void
SSL_CTX_set_tmp_dh_callback
(
SSL_CTX
*
ctx
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
export
,
int
keylength
));
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
is_export
,
int
keylength
));
void
SSL_set_tmp_dh_callback
(
SSL
*
ssl
,
void
SSL_set_tmp_dh_callback
(
SSL
*
ssl
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
export
,
int
keylength
));
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
is_export
,
int
keylength
));
#endif
#endif
#ifdef HEADER_COMP_H
#ifdef HEADER_COMP_H
...
...
ssl/ssl_lib.c
浏览文件 @
df63a389
...
@@ -1250,13 +1250,13 @@ X509 *ssl_get_server_send_cert(SSL *s)
...
@@ -1250,13 +1250,13 @@ X509 *ssl_get_server_send_cert(SSL *s)
{
{
unsigned
long
alg
,
mask
,
kalg
;
unsigned
long
alg
,
mask
,
kalg
;
CERT
*
c
;
CERT
*
c
;
int
i
,
export
;
int
i
,
is_
export
;
c
=
s
->
cert
;
c
=
s
->
cert
;
ssl_set_cert_masks
(
c
,
s
->
s3
->
tmp
.
new_cipher
);
ssl_set_cert_masks
(
c
,
s
->
s3
->
tmp
.
new_cipher
);
alg
=
s
->
s3
->
tmp
.
new_cipher
->
algorithms
;
alg
=
s
->
s3
->
tmp
.
new_cipher
->
algorithms
;
export
=
SSL_IS_EXPORT
(
alg
);
is_
export
=
SSL_IS_EXPORT
(
alg
);
mask
=
export
?
c
->
export_mask
:
c
->
mask
;
mask
=
is_
export
?
c
->
export_mask
:
c
->
mask
;
kalg
=
alg
&
(
SSL_MKEY_MASK
|
SSL_AUTH_MASK
);
kalg
=
alg
&
(
SSL_MKEY_MASK
|
SSL_AUTH_MASK
);
if
(
kalg
&
SSL_kDHr
)
if
(
kalg
&
SSL_kDHr
)
...
@@ -1877,13 +1877,14 @@ int SSL_want(SSL *s)
...
@@ -1877,13 +1877,14 @@ int SSL_want(SSL *s)
*/
*/
#ifndef NO_RSA
#ifndef NO_RSA
void
SSL_CTX_set_tmp_rsa_callback
(
SSL_CTX
*
ctx
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
export
,
void
SSL_CTX_set_tmp_rsa_callback
(
SSL_CTX
*
ctx
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
is_export
,
int
keylength
))
int
keylength
))
{
SSL_CTX_ctrl
(
ctx
,
SSL_CTRL_SET_TMP_RSA_CB
,
0
,(
char
*
)
cb
);
}
{
SSL_CTX_ctrl
(
ctx
,
SSL_CTRL_SET_TMP_RSA_CB
,
0
,(
char
*
)
cb
);
}
#endif
#endif
#ifndef NO_RSA
#ifndef NO_RSA
void
SSL_set_tmp_rsa_callback
(
SSL
*
ssl
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
export
,
void
SSL_set_tmp_rsa_callback
(
SSL
*
ssl
,
RSA
*
(
*
cb
)(
SSL
*
ssl
,
int
is_
export
,
int
keylength
))
int
keylength
))
{
SSL_ctrl
(
ssl
,
SSL_CTRL_SET_TMP_RSA_CB
,
0
,(
char
*
)
cb
);
}
{
SSL_ctrl
(
ssl
,
SSL_CTRL_SET_TMP_RSA_CB
,
0
,(
char
*
)
cb
);
}
#endif
#endif
...
@@ -1892,14 +1893,14 @@ void SSL_set_tmp_rsa_callback(SSL *ssl,RSA *(*cb)(SSL *ssl,int export,
...
@@ -1892,14 +1893,14 @@ void SSL_set_tmp_rsa_callback(SSL *ssl,RSA *(*cb)(SSL *ssl,int export,
/*!
/*!
* \brief The RSA temporary key callback function.
* \brief The RSA temporary key callback function.
* \param ssl the SSL session.
* \param ssl the SSL session.
* \param export \c TRUE if the temp RSA key is for an export ciphersuite.
* \param
is_
export \c TRUE if the temp RSA key is for an export ciphersuite.
* \param keylength if \c
export is \c TRUE, then \c keylength is the size of
* \param keylength if \c
is_export is \c TRUE, then \c keylength is the size
* the required key in bits.
*
of
the required key in bits.
* \return the temporary RSA key.
* \return the temporary RSA key.
* \sa SSL_CTX_set_tmp_rsa_callback, SSL_set_tmp_rsa_callback
* \sa SSL_CTX_set_tmp_rsa_callback, SSL_set_tmp_rsa_callback
*/
*/
RSA
*
cb
(
SSL
*
ssl
,
int
export
,
int
keylength
)
RSA
*
cb
(
SSL
*
ssl
,
int
is_
export
,
int
keylength
)
{}
{}
#endif
#endif
...
@@ -1910,11 +1911,11 @@ RSA *cb(SSL *ssl,int export,int keylength)
...
@@ -1910,11 +1911,11 @@ RSA *cb(SSL *ssl,int export,int keylength)
*/
*/
#ifndef NO_DH
#ifndef NO_DH
void
SSL_CTX_set_tmp_dh_callback
(
SSL_CTX
*
ctx
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
export
,
void
SSL_CTX_set_tmp_dh_callback
(
SSL_CTX
*
ctx
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
is_
export
,
int
keylength
))
int
keylength
))
{
SSL_CTX_ctrl
(
ctx
,
SSL_CTRL_SET_TMP_DH_CB
,
0
,(
char
*
)
dh
);
}
{
SSL_CTX_ctrl
(
ctx
,
SSL_CTRL_SET_TMP_DH_CB
,
0
,(
char
*
)
dh
);
}
void
SSL_set_tmp_dh_callback
(
SSL
*
ssl
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
export
,
void
SSL_set_tmp_dh_callback
(
SSL
*
ssl
,
DH
*
(
*
dh
)(
SSL
*
ssl
,
int
is_
export
,
int
keylength
))
int
keylength
))
{
SSL_ctrl
(
ssl
,
SSL_CTRL_SET_TMP_DH_CB
,
0
,(
char
*
)
dh
);
}
{
SSL_ctrl
(
ssl
,
SSL_CTRL_SET_TMP_DH_CB
,
0
,(
char
*
)
dh
);
}
#endif
#endif
...
...
ssl/ssl_locl.h
浏览文件 @
df63a389
...
@@ -264,11 +264,11 @@ typedef struct cert_st
...
@@ -264,11 +264,11 @@ typedef struct cert_st
unsigned
long
export_mask
;
unsigned
long
export_mask
;
#ifndef NO_RSA
#ifndef NO_RSA
RSA
*
rsa_tmp
;
RSA
*
rsa_tmp
;
RSA
*
(
*
rsa_tmp_cb
)(
SSL
*
ssl
,
int
export
,
int
keysize
);
RSA
*
(
*
rsa_tmp_cb
)(
SSL
*
ssl
,
int
is_
export
,
int
keysize
);
#endif
#endif
#ifndef NO_DH
#ifndef NO_DH
DH
*
dh_tmp
;
DH
*
dh_tmp
;
DH
*
(
*
dh_tmp_cb
)(
SSL
*
ssl
,
int
export
,
int
keysize
);
DH
*
(
*
dh_tmp_cb
)(
SSL
*
ssl
,
int
is_
export
,
int
keysize
);
#endif
#endif
CERT_PKEY
pkeys
[
SSL_PKEY_NUM
];
CERT_PKEY
pkeys
[
SSL_PKEY_NUM
];
...
...
ssl/ssltest.c
浏览文件 @
df63a389
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
int
MS_CALLBACK
verify_callback
(
int
ok
,
X509_STORE_CTX
*
ctx
);
int
MS_CALLBACK
verify_callback
(
int
ok
,
X509_STORE_CTX
*
ctx
);
#ifndef NO_RSA
#ifndef NO_RSA
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
export
,
int
keylength
);
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
is_
export
,
int
keylength
);
#endif
#endif
#ifndef NO_DH
#ifndef NO_DH
static
DH
*
get_dh512
(
void
);
static
DH
*
get_dh512
(
void
);
...
@@ -724,7 +724,7 @@ static DH *get_dh512(void)
...
@@ -724,7 +724,7 @@ static DH *get_dh512(void)
#endif
#endif
#ifndef NO_RSA
#ifndef NO_RSA
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
export
,
int
keylength
)
static
RSA
MS_CALLBACK
*
tmp_rsa_cb
(
SSL
*
s
,
int
is_
export
,
int
keylength
)
{
{
static
RSA
*
rsa_tmp
=
NULL
;
static
RSA
*
rsa_tmp
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录