Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
d87e6152
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看板
提交
d87e6152
编写于
4月 13, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add key derivation support.
上级
92511cff
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
51 addition
and
0 deletion
+51
-0
crypto/dh/dh_pmeth.c
crypto/dh/dh_pmeth.c
+2
-0
crypto/dsa/dsa_pmeth.c
crypto/dsa/dsa_pmeth.c
+2
-0
crypto/evp/evp.h
crypto/evp/evp.h
+2
-0
crypto/evp/evp_err.c
crypto/evp/evp_err.c
+2
-0
crypto/evp/evp_locl.h
crypto/evp/evp_locl.h
+5
-0
crypto/evp/pmeth_fn.c
crypto/evp/pmeth_fn.c
+35
-0
crypto/evp/pmeth_lib.c
crypto/evp/pmeth_lib.c
+1
-0
crypto/rsa/rsa_pmeth.c
crypto/rsa/rsa_pmeth.c
+2
-0
未找到文件。
crypto/dh/dh_pmeth.c
浏览文件 @
d87e6152
...
...
@@ -209,6 +209,8 @@ const EVP_PKEY_METHOD dh_pkey_meth =
0
,
0
,
0
,
0
,
pkey_dh_ctrl
,
pkey_dh_ctrl_str
...
...
crypto/dsa/dsa_pmeth.c
浏览文件 @
d87e6152
...
...
@@ -245,6 +245,8 @@ const EVP_PKEY_METHOD dsa_pkey_meth =
0
,
0
,
0
,
0
,
pkey_dsa_ctrl
,
pkey_dsa_ctrl_str
...
...
crypto/evp/evp.h
浏览文件 @
d87e6152
...
...
@@ -1016,6 +1016,8 @@ void ERR_load_EVP_strings(void);
#define EVP_F_EVP_PKEY_DECRYPT 104
#define EVP_F_EVP_PKEY_DECRYPT_INIT 138
#define EVP_F_EVP_PKEY_DECRYPT_OLD 151
#define EVP_F_EVP_PKEY_DERIVE 153
#define EVP_F_EVP_PKEY_DERIVE_INIT 154
#define EVP_F_EVP_PKEY_ENCRYPT 105
#define EVP_F_EVP_PKEY_ENCRYPT_INIT 139
#define EVP_F_EVP_PKEY_ENCRYPT_OLD 152
...
...
crypto/evp/evp_err.c
浏览文件 @
d87e6152
...
...
@@ -95,6 +95,8 @@ static ERR_STRING_DATA EVP_str_functs[]=
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DECRYPT
),
"EVP_PKEY_decrypt"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DECRYPT_INIT
),
"EVP_PKEY_decrypt_init"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DECRYPT_OLD
),
"EVP_PKEY_decrypt_old"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DERIVE
),
"EVP_PKEY_DERIVE"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DERIVE_INIT
),
"EVP_PKEY_DERIVE_INIT"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_ENCRYPT
),
"EVP_PKEY_encrypt"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_ENCRYPT_INIT
),
"EVP_PKEY_encrypt_init"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_ENCRYPT_OLD
),
"EVP_PKEY_encrypt_old"
},
...
...
crypto/evp/evp_locl.h
浏览文件 @
d87e6152
...
...
@@ -241,6 +241,8 @@ struct evp_pkey_ctx_st
const
EVP_PKEY_METHOD
*
pmeth
;
/* Key: may be NULL */
EVP_PKEY
*
pkey
;
/* Peer key for key agreement, may be NULL */
EVP_PKEY
*
peerkey
;
/* Actual operation */
int
operation
;
/* Algorithm specific data */
...
...
@@ -297,6 +299,9 @@ struct evp_pkey_method_st
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
int
*
outlen
,
const
unsigned
char
*
in
,
int
inlen
);
int
(
*
derive_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
int
*
keylen
);
int
(
*
ctrl
)(
EVP_PKEY_CTX
*
ctx
,
int
type
,
int
p1
,
void
*
p2
);
int
(
*
ctrl_str
)(
EVP_PKEY_CTX
*
ctx
,
const
char
*
type
,
const
char
*
value
);
...
...
crypto/evp/pmeth_fn.c
浏览文件 @
d87e6152
...
...
@@ -243,3 +243,38 @@ int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
return
ctx
->
pmeth
->
decrypt
(
ctx
,
out
,
outlen
,
in
,
inlen
);
}
int
EVP_PKEY_derive_init
(
EVP_PKEY_CTX
*
ctx
)
{
int
ret
;
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
derive
)
{
EVPerr
(
EVP_F_EVP_PKEY_DERIVE_INIT
,
EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
);
return
-
2
;
}
ctx
->
operation
=
EVP_PKEY_OP_DERIVE
;
if
(
!
ctx
->
pmeth
->
derive_init
)
return
1
;
ret
=
ctx
->
pmeth
->
derive_init
(
ctx
);
if
(
ret
<=
0
)
ctx
->
operation
=
EVP_PKEY_OP_UNDEFINED
;
return
ret
;
}
int
EVP_PKEY_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
int
*
pkeylen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
derive
)
{
EVPerr
(
EVP_F_EVP_PKEY_DERIVE
,
EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
);
return
-
2
;
}
if
(
ctx
->
operation
!=
EVP_PKEY_OP_DERIVE
)
{
EVPerr
(
EVP_F_EVP_PKEY_DERIVE
,
EVP_R_OPERATON_NOT_INITIALIZED
);
return
-
1
;
}
return
ctx
->
pmeth
->
derive
(
ctx
,
key
,
pkeylen
);
}
crypto/evp/pmeth_lib.c
浏览文件 @
d87e6152
...
...
@@ -120,6 +120,7 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
ret
->
pmeth
=
pmeth
;
ret
->
operation
=
EVP_PKEY_OP_UNDEFINED
;
ret
->
pkey
=
pkey
;
ret
->
peerkey
=
NULL
;
if
(
pkey
)
CRYPTO_add
(
&
pkey
->
references
,
1
,
CRYPTO_LOCK_EVP_PKEY
);
ret
->
data
=
NULL
;
...
...
crypto/rsa/rsa_pmeth.c
浏览文件 @
d87e6152
...
...
@@ -524,6 +524,8 @@ const EVP_PKEY_METHOD rsa_pkey_meth =
0
,
pkey_rsa_decrypt
,
0
,
0
,
pkey_rsa_ctrl
,
pkey_rsa_ctrl_str
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录