Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c800c27a
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看板
提交
c800c27a
编写于
10月 09, 2014
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Process signature algorithms in ClientHello late.
Reviewed-by:
N
Tim Hudson
<
tjh@openssl.org
>
上级
3ff08e1d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
62 addition
and
35 deletion
+62
-35
ssl/s3_clnt.c
ssl/s3_clnt.c
+7
-1
ssl/ssl.h
ssl/ssl.h
+1
-0
ssl/ssl_err.c
ssl/ssl_err.c
+1
-0
ssl/ssl_locl.h
ssl/ssl_locl.h
+2
-1
ssl/t1_lib.c
ssl/t1_lib.c
+51
-33
未找到文件。
ssl/s3_clnt.c
浏览文件 @
c800c27a
...
...
@@ -2191,12 +2191,18 @@ int ssl3_get_certificate_request(SSL *s)
s
->
cert
->
pkeys
[
i
].
digest
=
NULL
;
s
->
cert
->
pkeys
[
i
].
valid_flags
=
0
;
}
if
((
llen
&
1
)
||
!
tls1_
process
_sigalgs
(
s
,
p
,
llen
))
if
((
llen
&
1
)
||
!
tls1_
save
_sigalgs
(
s
,
p
,
llen
))
{
ssl3_send_alert
(
s
,
SSL3_AL_FATAL
,
SSL_AD_DECODE_ERROR
);
SSLerr
(
SSL_F_SSL3_GET_CERTIFICATE_REQUEST
,
SSL_R_SIGNATURE_ALGORITHMS_ERROR
);
goto
err
;
}
if
(
!
tls1_process_sigalgs
(
s
))
{
ssl3_send_alert
(
s
,
SSL3_AL_FATAL
,
SSL_AD_INTERNAL_ERROR
);
SSLerr
(
SSL_F_SSL3_GET_CERTIFICATE_REQUEST
,
ERR_R_MALLOC_FAILURE
);
goto
err
;
}
p
+=
llen
;
}
...
...
ssl/ssl.h
浏览文件 @
c800c27a
...
...
@@ -2682,6 +2682,7 @@ void ERR_load_SSL_strings(void);
#define SSL_F_SSL_CERT_INSTANTIATE 214
#define SSL_F_SSL_CERT_NEW 162
#define SSL_F_SSL_CERT_SET0_CHAIN 340
#define SSL_F_SSL_CHECK_CLIENTHELLO_TLSEXT_LATE 335
#define SSL_F_SSL_CHECK_PRIVATE_KEY 163
#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280
#define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279
...
...
ssl/ssl_err.c
浏览文件 @
c800c27a
...
...
@@ -201,6 +201,7 @@ static ERR_STRING_DATA SSL_str_functs[]=
{
ERR_FUNC
(
SSL_F_SSL_CERT_INSTANTIATE
),
"SSL_CERT_INSTANTIATE"
},
{
ERR_FUNC
(
SSL_F_SSL_CERT_NEW
),
"ssl_cert_new"
},
{
ERR_FUNC
(
SSL_F_SSL_CERT_SET0_CHAIN
),
"ssl_cert_set0_chain"
},
{
ERR_FUNC
(
SSL_F_SSL_CHECK_CLIENTHELLO_TLSEXT_LATE
),
"ssl_check_clienthello_tlsext_late"
},
{
ERR_FUNC
(
SSL_F_SSL_CHECK_PRIVATE_KEY
),
"SSL_check_private_key"
},
{
ERR_FUNC
(
SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT
),
"SSL_CHECK_SERVERHELLO_TLSEXT"
},
{
ERR_FUNC
(
SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG
),
"ssl_check_srvr_ecc_cert_and_alg"
},
...
...
ssl/ssl_locl.h
浏览文件 @
c800c27a
...
...
@@ -1382,7 +1382,8 @@ int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len,
long
ssl_get_algorithm2
(
SSL
*
s
);
size_t
tls12_copy_sigalgs
(
SSL
*
s
,
unsigned
char
*
out
,
const
unsigned
char
*
psig
,
size_t
psiglen
);
int
tls1_process_sigalgs
(
SSL
*
s
,
const
unsigned
char
*
data
,
int
dsize
);
int
tls1_save_sigalgs
(
SSL
*
s
,
const
unsigned
char
*
data
,
int
dsize
);
int
tls1_process_sigalgs
(
SSL
*
s
);
size_t
tls12_get_psigalgs
(
SSL
*
s
,
const
unsigned
char
**
psigs
);
int
tls12_check_peer_sigalg
(
const
EVP_MD
**
pmd
,
SSL
*
s
,
const
unsigned
char
*
sig
,
EVP_PKEY
*
pkey
);
...
...
ssl/t1_lib.c
浏览文件 @
c800c27a
...
...
@@ -1920,7 +1920,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char
unsigned
short
len
;
unsigned
char
*
data
=
*
p
;
int
renegotiate_seen
=
0
;
size_t
i
;
s
->
servername_done
=
0
;
s
->
tlsext_status_type
=
-
1
;
...
...
@@ -1950,18 +1949,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char
OPENSSL_free
(
s
->
cert
->
peer_sigalgs
);
s
->
cert
->
peer_sigalgs
=
NULL
;
}
/* Clear any shared sigtnature algorithms */
if
(
s
->
cert
->
shared_sigalgs
)
{
OPENSSL_free
(
s
->
cert
->
shared_sigalgs
);
s
->
cert
->
shared_sigalgs
=
NULL
;
}
/* Clear certificate digests and validity flags */
for
(
i
=
0
;
i
<
SSL_PKEY_NUM
;
i
++
)
{
s
->
cert
->
pkeys
[
i
].
digest
=
NULL
;
s
->
cert
->
pkeys
[
i
].
valid_flags
=
0
;
}
#ifdef TLSEXT_TYPE_encrypt_then_mac
s
->
s3
->
flags
&=
~
TLS1_FLAGS_ENCRYPT_THEN_MAC
;
...
...
@@ -2252,21 +2239,11 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char
*
al
=
SSL_AD_DECODE_ERROR
;
return
0
;
}
if
(
!
tls1_
process
_sigalgs
(
s
,
data
,
dsize
))
if
(
!
tls1_
save
_sigalgs
(
s
,
data
,
dsize
))
{
*
al
=
SSL_AD_DECODE_ERROR
;
return
0
;
}
/* If sigalgs received and no shared algorithms fatal
* error.
*/
if
(
s
->
cert
->
peer_sigalgs
&&
!
s
->
cert
->
shared_sigalgs
)
{
SSLerr
(
SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT
,
SSL_R_NO_SHARED_SIGATURE_ALGORITHMS
);
*
al
=
SSL_AD_ILLEGAL_PARAMETER
;
return
0
;
}
}
else
if
(
type
==
TLSEXT_TYPE_status_request
)
{
...
...
@@ -2476,9 +2453,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char
SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
);
return
0
;
}
/* If no signature algorithms extension set default values */
if
(
!
s
->
cert
->
peer_sigalgs
)
ssl_cert_set_default_md
(
s
->
cert
);
return
1
;
}
...
...
@@ -2998,6 +2972,7 @@ int ssl_check_clienthello_tlsext_late(SSL *s)
{
int
ret
=
SSL_TLSEXT_ERR_OK
;
int
al
;
size_t
i
;
/* If status request then ask callback what to do.
* Note: this must be called after servername callbacks in case
...
...
@@ -3043,6 +3018,43 @@ int ssl_check_clienthello_tlsext_late(SSL *s)
else
s
->
tlsext_status_expected
=
0
;
/* Clear any shared sigtnature algorithms */
if
(
s
->
cert
->
shared_sigalgs
)
{
OPENSSL_free
(
s
->
cert
->
shared_sigalgs
);
s
->
cert
->
shared_sigalgs
=
NULL
;
}
/* Clear certificate digests and validity flags */
for
(
i
=
0
;
i
<
SSL_PKEY_NUM
;
i
++
)
{
s
->
cert
->
pkeys
[
i
].
digest
=
NULL
;
s
->
cert
->
pkeys
[
i
].
valid_flags
=
0
;
}
/* If sigalgs received process it. */
if
(
s
->
cert
->
peer_sigalgs
)
{
if
(
!
tls1_process_sigalgs
(
s
))
{
SSLerr
(
SSL_F_SSL_CHECK_CLIENTHELLO_TLSEXT_LATE
,
ERR_R_MALLOC_FAILURE
);
ret
=
SSL_TLSEXT_ERR_ALERT_FATAL
;
al
=
SSL_AD_INTERNAL_ERROR
;
goto
err
;
}
/* Fatal error is no shared signature algorithms */
if
(
!
s
->
cert
->
shared_sigalgs
)
{
SSLerr
(
SSL_F_SSL_CHECK_CLIENTHELLO_TLSEXT_LATE
,
SSL_R_NO_SHARED_SIGATURE_ALGORITHMS
);
ret
=
SSL_TLSEXT_ERR_ALERT_FATAL
;
al
=
SSL_AD_ILLEGAL_PARAMETER
;
goto
err
;
}
}
else
ssl_cert_set_default_md
(
s
->
cert
);
err:
switch
(
ret
)
{
...
...
@@ -3771,13 +3783,9 @@ static int tls1_set_shared_sigalgs(SSL *s)
/* Set preferred digest for each key type */
int
tls1_
process
_sigalgs
(
SSL
*
s
,
const
unsigned
char
*
data
,
int
dsize
)
int
tls1_
save
_sigalgs
(
SSL
*
s
,
const
unsigned
char
*
data
,
int
dsize
)
{
int
idx
;
size_t
i
;
const
EVP_MD
*
md
;
CERT
*
c
=
s
->
cert
;
TLS_SIGALGS
*
sigptr
;
/* Extension ignored for inappropriate versions */
if
(
!
SSL_USE_SIGALGS
(
s
))
return
1
;
...
...
@@ -3792,8 +3800,18 @@ int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize)
return
0
;
c
->
peer_sigalgslen
=
dsize
;
memcpy
(
c
->
peer_sigalgs
,
data
,
dsize
);
return
1
;
}
tls1_set_shared_sigalgs
(
s
);
int
tls1_process_sigalgs
(
SSL
*
s
)
{
int
idx
;
size_t
i
;
const
EVP_MD
*
md
;
CERT
*
c
=
s
->
cert
;
TLS_SIGALGS
*
sigptr
;
if
(
!
tls1_set_shared_sigalgs
(
s
))
return
0
;
#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
if
(
s
->
cert
->
cert_flags
&
SSL_CERT_FLAG_BROKEN_PROTOCOL
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录