Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
376e2ca3
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看板
提交
376e2ca3
编写于
12月 04, 2014
作者:
E
Emilia Kasper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clarify the return values for SSL_get_shared_curve.
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
740580c2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
14 deletion
+22
-14
doc/ssl/SSL_CTX_set1_curves.pod
doc/ssl/SSL_CTX_set1_curves.pod
+12
-7
ssl/t1_lib.c
ssl/t1_lib.c
+10
-7
未找到文件。
doc/ssl/SSL_CTX_set1_curves.pod
浏览文件 @
376e2ca3
...
...
@@ -45,11 +45,12 @@ B<curves> array is in the form of a set of curve NIDs in preference
order. It can return zero if the client did not send a supported curves
extension.
SSL_get1_shared_curve() returns shared curve B<n> for B<ssl>. If B<n> is
-1 then the total number of shared curves is returned, which may be
zero. Other than for diagnostic purposes, most applications will only
be interested in the first shared curve so B<n> is normally set to zero.
If the value B<n> is out of range zero is returned.
SSL_get_shared_curve() returns shared curve B<n> for a server-side
SSL B<ssl>. If B<n> is -1 then the total number of shared curves is
returned, which may be zero. Other than for diagnostic purposes,
most applications will only be interested in the first shared curve
so B<n> is normally set to zero. If the value B<n> is out of range,
NID_undef is returned.
SSL_CTX_set_ecdh_auto() and SSL_set_ecdh_auto() set automatic curve
selection for server B<ctx> or B<ssl> to B<onoff>. If B<onoff> is 1 then
...
...
@@ -84,8 +85,12 @@ return 1 for success and 0 for failure.
SSL_get1_curves() returns the number of curves, which may be zero.
SSL_get1_shared_curve() returns the NID of shared curve B<n> of zero if there
is no shared curve B<n> or the number of shared curves if B<n> is -1.
SSL_get_shared_curve() returns the NID of shared curve B<n> or NID_undef if there
is no shared curve B<n>; or the total number of shared curves if B<n>
is -1.
When called on a client B<ssl>, SSL_get_shared_curve() has no meaning and
returns -1.
=head1 SEE ALSO
...
...
ssl/t1_lib.c
浏览文件 @
376e2ca3
...
...
@@ -504,11 +504,12 @@ int tls1_check_curve(SSL *s, const unsigned char *p, size_t len)
return
0
;
}
/* Return nth shared curve. If nmatch == -1 return number of
* matches. For nmatch == -2 return the NID of the curve to use for
* an EC tmp key.
/*
* Return |nmatch|th shared curve or NID_undef if there is no match.
* For nmatch == -1, return number of matches
* For nmatch == -2, return the NID of the curve to use for
* an EC tmp key, or NID_undef if there is no match.
*/
int
tls1_shared_curve
(
SSL
*
s
,
int
nmatch
)
{
const
unsigned
char
*
pref
,
*
supp
;
...
...
@@ -542,10 +543,11 @@ int tls1_shared_curve(SSL *s, int nmatch)
*/
if
(
!
tls1_get_curvelist
(
s
,
(
s
->
options
&
SSL_OP_CIPHER_SERVER_PREFERENCE
)
!=
0
,
&
supp
,
&
num_supp
))
return
0
;
/* In practice, NID_undef == 0 but let's be precise. */
return
nmatch
==
-
1
?
0
:
NID_undef
;
if
(
!
tls1_get_curvelist
(
s
,
!
(
s
->
options
&
SSL_OP_CIPHER_SERVER_PREFERENCE
),
&
pref
,
&
num_pref
))
return
0
;
return
nmatch
==
-
1
?
0
:
NID_undef
;
k
=
0
;
for
(
i
=
0
;
i
<
num_pref
;
i
++
,
pref
+=
2
)
{
...
...
@@ -567,7 +569,8 @@ int tls1_shared_curve(SSL *s, int nmatch)
}
if
(
nmatch
==
-
1
)
return
k
;
return
0
;
/* Out of range (nmatch > k). */
return
NID_undef
;
}
int
tls1_set_curves
(
unsigned
char
**
pext
,
size_t
*
pextlen
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录