Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
65b1d31d
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,发现更多精彩内容 >>
提交
65b1d31d
编写于
9月 02, 2002
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change API for looking at the internal curve list
Submitted by: Nils Larsch
上级
b499ed06
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
28 deletion
+49
-28
apps/ecparam.c
apps/ecparam.c
+23
-8
crypto/ec/ec.h
crypto/ec/ec.h
+10
-6
crypto/ec/ec_curve.c
crypto/ec/ec_curve.c
+13
-12
util/libeay.num
util/libeay.num
+3
-2
未找到文件。
apps/ecparam.c
浏览文件 @
65b1d31d
...
...
@@ -352,19 +352,33 @@ bad:
if
(
list_curves
)
{
int
counter
=
0
;
EC_builtin_curve
*
curves
=
NULL
;
size_t
crv_len
=
0
;
size_t
n
=
0
;
size_t
len
;
for
(;;)
crv_len
=
EC_get_builtin_curves
(
NULL
,
0
);
curves
=
OPENSSL_malloc
(
sizeof
(
EC_builtin_curve
)
*
crv_len
);
if
(
curves
==
NULL
)
goto
end
;
if
(
!
EC_get_builtin_curves
(
curves
,
crv_len
))
{
OPENSSL_free
(
curves
);
goto
end
;
}
for
(
n
=
0
;
n
<
crv_len
;
n
++
)
{
const
char
*
comment
;
const
char
*
sname
;
int
len
,
nid
=
ec_group_index2nid
(
counter
++
);
if
(
!
nid
)
break
;
comment
=
EC_GROUP_get0_comment
(
nid
);
sname
=
OBJ_nid2sn
(
nid
);
comment
=
curves
[
n
].
comment
;
sname
=
OBJ_nid2sn
(
curves
[
n
].
nid
);
if
(
comment
==
NULL
)
comment
=
""
;
comment
=
"
CURVE DESCRIPTION NOT AVAILABLE
"
;
if
(
sname
==
NULL
)
sname
=
""
;
...
...
@@ -375,6 +389,7 @@ bad:
BIO_printf
(
out
,
"%s
\n
"
,
comment
);
}
OPENSSL_free
(
curves
);
ret
=
0
;
goto
end
;
}
...
...
crypto/ec/ec.h
浏览文件 @
65b1d31d
...
...
@@ -184,12 +184,16 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM
/* EC_GROUP_new_by_nid() creates a EC_GROUP structure specified by a NID */
EC_GROUP
*
EC_GROUP_new_by_nid
(
int
nid
);
/* EC_GROUP_get0_comment() returns a pointer to the 'comment' field of
* ec_curve_data_st structure */
const
char
*
EC_GROUP_get0_comment
(
int
nid
);
/* internal function : ec_group_index2nid() returns the NID of curve
* with the given index i from the internal curve list */
int
ec_group_index2nid
(
int
i
);
/* handling of internal curves */
typedef
struct
{
int
nid
;
const
char
*
comment
;
}
EC_builtin_curve
;
/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number
* of all available curves or zero if a error occurred.
* In case r ist not zero nitems EC_builtin_curve structures
* are filled with the data of the first nitems internal groups */
size_t
EC_get_builtin_curves
(
EC_builtin_curve
*
r
,
size_t
nitems
);
/* EC_POINT functions */
...
...
crypto/ec/ec_curve.c
浏览文件 @
65b1d31d
...
...
@@ -1207,19 +1207,20 @@ EC_GROUP *EC_GROUP_new_by_nid(int nid)
return
ret
;
}
const
char
*
EC_GROUP_get0_comment
(
int
nid
)
size_t
EC_get_builtin_curves
(
EC_builtin_curve
*
r
,
size_t
nitems
)
{
size_t
i
;
size_t
i
,
min
;
for
(
i
=
0
;
i
<
curve_list_length
;
i
++
)
if
(
curve_list
[
i
].
nid
==
nid
)
return
curve_list
[
i
].
data
->
comment
;
return
NULL
;
}
if
(
r
==
NULL
||
nitems
==
0
)
return
curve_list_length
;
int
ec_group_index2nid
(
int
i
)
{
if
(
i
>=
curve_list_length
||
i
<
0
)
return
0
;
return
curve_list
[
i
].
nid
;
min
=
nitems
<
curve_list_length
?
nitems
:
curve_list_length
;
for
(
i
=
0
;
i
<
min
;
i
++
)
{
r
[
i
].
nid
=
curve_list
[
i
].
nid
;
r
[
i
].
comment
=
curve_list
[
i
].
data
->
comment
;
}
return
curve_list_length
;
}
util/libeay.num
浏览文件 @
65b1d31d
...
...
@@ -3003,9 +3003,10 @@ ENGINE_register_all_ECDH 3436 EXIST::FUNCTION:
ECDH_DATA_new_method 3437 EXIST::FUNCTION:ECDH
ENGINE_set_default_ECDH 3438 EXIST::FUNCTION:
ENGINE_register_ECDH 3439 EXIST::FUNCTION:
EC_GROUP_get0_comment 3440
EXIST::FUNCTION:EC
ec_group_index2nid 3441
EXIST::FUNCTION:EC
EC_GROUP_get0_comment 3440
NOEXIST::FUNCTION:
ec_group_index2nid 3441
NOEXIST::FUNCTION:
EC_GROUP_get_basis_type 3442 EXIST::FUNCTION:EC
X509_REQ_print_ex 3443 EXIST::FUNCTION:BIO
EC_GROUP_get_pentanomial_basis 3444 EXIST::FUNCTION:EC
EC_GROUP_get_trinomial_basis 3445 EXIST::FUNCTION:EC
EC_get_builtin_curves 3446 EXIST::FUNCTION:EC
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录