Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
5da98aa6
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5da98aa6
编写于
4月 06, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated to EVP_PKEY_METHOD code... still doesn't do much.
上级
0b6f3c66
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
6 deletion
+50
-6
crypto/evp/evp.h
crypto/evp/evp.h
+14
-0
crypto/evp/evp_err.c
crypto/evp/evp_err.c
+4
-0
crypto/evp/evp_locl.h
crypto/evp/evp_locl.h
+2
-0
crypto/evp/pmeth_lib.c
crypto/evp/pmeth_lib.c
+30
-6
未找到文件。
crypto/evp/evp.h
浏览文件 @
5da98aa6
...
...
@@ -902,6 +902,16 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
void
(
*
pkey_ctrl
)(
EVP_PKEY
*
pkey
,
int
op
,
long
arg1
,
void
*
arg2
));
const
EVP_PKEY_METHOD
*
EVP_PKEY_meth_find
(
int
type
,
ENGINE
*
e
);
EVP_PKEY_CTX
*
EVP_PKEY_CTX_new
(
int
ktype
,
ENGINE
*
e
);
void
EVP_PKEY_CTX_free
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_CTX_ctrl
(
EVP_PKEY_CTX
*
ctx
,
int
keytype
,
int
optype
,
int
cmd
,
int
p1
,
void
*
p2
);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
...
...
@@ -931,6 +941,7 @@ void ERR_load_EVP_strings(void);
#define EVP_F_EVP_PKCS82PKEY_BROKEN 136
#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
#define EVP_F_EVP_PKEY_CTX_CTRL 137
#define EVP_F_EVP_PKEY_DECRYPT 104
#define EVP_F_EVP_PKEY_ENCRYPT 105
#define EVP_F_EVP_PKEY_GET1_DH 119
...
...
@@ -957,6 +968,7 @@ void ERR_load_EVP_strings(void);
#define EVP_R_BN_DECODE_ERROR 112
#define EVP_R_BN_PUBKEY_ERROR 113
#define EVP_R_CIPHER_PARAMETER_ERROR 122
#define EVP_R_COMMAND_NOT_SUPPORTED 147
#define EVP_R_CTRL_NOT_IMPLEMENTED 132
#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
...
...
@@ -972,6 +984,7 @@ void ERR_load_EVP_strings(void);
#define EVP_R_INITIALIZATION_ERROR 134
#define EVP_R_INPUT_NOT_INITIALIZED 111
#define EVP_R_INVALID_KEY_LENGTH 130
#define EVP_R_INVALID_OPERATION 148
#define EVP_R_IV_TOO_LARGE 102
#define EVP_R_KEYGEN_FAILURE 120
#define EVP_R_METHOD_NOT_SUPPORTED 144
...
...
@@ -979,6 +992,7 @@ void ERR_load_EVP_strings(void);
#define EVP_R_NO_CIPHER_SET 131
#define EVP_R_NO_DIGEST_SET 139
#define EVP_R_NO_DSA_PARAMETERS 116
#define EVP_R_NO_OPERATION_SET 149
#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
...
...
crypto/evp/evp_err.c
浏览文件 @
5da98aa6
...
...
@@ -90,6 +90,7 @@ static ERR_STRING_DATA EVP_str_functs[]=
{
ERR_FUNC
(
EVP_F_EVP_PKCS82PKEY_BROKEN
),
"EVP_PKCS82PKEY_BROKEN"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY2PKCS8_BROKEN
),
"EVP_PKEY2PKCS8_broken"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_COPY_PARAMETERS
),
"EVP_PKEY_copy_parameters"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_CTX_CTRL
),
"EVP_PKEY_CTX_CTRL"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_DECRYPT
),
"EVP_PKEY_decrypt"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_ENCRYPT
),
"EVP_PKEY_encrypt"
},
{
ERR_FUNC
(
EVP_F_EVP_PKEY_GET1_DH
),
"EVP_PKEY_get1_DH"
},
...
...
@@ -119,6 +120,7 @@ static ERR_STRING_DATA EVP_str_reasons[]=
{
ERR_REASON
(
EVP_R_BN_DECODE_ERROR
)
,
"bn decode error"
},
{
ERR_REASON
(
EVP_R_BN_PUBKEY_ERROR
)
,
"bn pubkey error"
},
{
ERR_REASON
(
EVP_R_CIPHER_PARAMETER_ERROR
),
"cipher parameter error"
},
{
ERR_REASON
(
EVP_R_COMMAND_NOT_SUPPORTED
)
,
"command not supported"
},
{
ERR_REASON
(
EVP_R_CTRL_NOT_IMPLEMENTED
)
,
"ctrl not implemented"
},
{
ERR_REASON
(
EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
),
"ctrl operation not implemented"
},
{
ERR_REASON
(
EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
),
"data not multiple of block length"
},
...
...
@@ -134,6 +136,7 @@ static ERR_STRING_DATA EVP_str_reasons[]=
{
ERR_REASON
(
EVP_R_INITIALIZATION_ERROR
)
,
"initialization error"
},
{
ERR_REASON
(
EVP_R_INPUT_NOT_INITIALIZED
)
,
"input not initialized"
},
{
ERR_REASON
(
EVP_R_INVALID_KEY_LENGTH
)
,
"invalid key length"
},
{
ERR_REASON
(
EVP_R_INVALID_OPERATION
)
,
"invalid operation"
},
{
ERR_REASON
(
EVP_R_IV_TOO_LARGE
)
,
"iv too large"
},
{
ERR_REASON
(
EVP_R_KEYGEN_FAILURE
)
,
"keygen failure"
},
{
ERR_REASON
(
EVP_R_METHOD_NOT_SUPPORTED
)
,
"method not supported"
},
...
...
@@ -141,6 +144,7 @@ static ERR_STRING_DATA EVP_str_reasons[]=
{
ERR_REASON
(
EVP_R_NO_CIPHER_SET
)
,
"no cipher set"
},
{
ERR_REASON
(
EVP_R_NO_DIGEST_SET
)
,
"no digest set"
},
{
ERR_REASON
(
EVP_R_NO_DSA_PARAMETERS
)
,
"no dsa parameters"
},
{
ERR_REASON
(
EVP_R_NO_OPERATION_SET
)
,
"no operation set"
},
{
ERR_REASON
(
EVP_R_NO_SIGN_FUNCTION_CONFIGURED
),
"no sign function configured"
},
{
ERR_REASON
(
EVP_R_NO_VERIFY_FUNCTION_CONFIGURED
),
"no verify function configured"
},
{
ERR_REASON
(
EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE
),
"pkcs8 unknown broken type"
},
...
...
crypto/evp/evp_locl.h
浏览文件 @
5da98aa6
...
...
@@ -262,6 +262,8 @@ struct evp_pkey_ctx_st
struct
evp_pkey_method_st
{
int
pkey_id
;
int
flags
;
int
(
*
init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
paramgen_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
paramgen
)(
EVP_PKEY
*
key
,
EVP_PKEY_CTX
*
ctx
);
...
...
crypto/evp/pmeth_lib.c
浏览文件 @
5da98aa6
...
...
@@ -60,6 +60,7 @@
#include <stdlib.h>
#include <openssl/objects.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include "evp_locl.h"
STACK
*
app_pkey_methods
=
NULL
;
...
...
@@ -112,35 +113,58 @@ EVP_PKEY_CTX *EVP_PKEY_CTX_new(int ktype, ENGINE *e)
ret
->
pkey
=
NULL
;
ret
->
data
=
NULL
;
if
(
pmeth
->
init
)
{
if
(
pmeth
->
init
(
ret
)
<=
0
)
{
EVP_PKEY_CTX_free
(
ret
);
return
NULL
;
}
}
return
ret
;
}
void
EVP_PKEY_CTX_free
(
EVP_PKEY_CTX
*
ctx
)
{
if
(
ctx
->
pmeth
&&
ctx
->
pmeth
->
cleanup
)
ctx
->
pmeth
->
cleanup
(
ctx
);
if
(
ctx
->
pkey
)
EVP_PKEY_free
(
ctx
->
pkey
);
OPENSSL_free
(
ctx
);
}
int
EVP_PKEY_CTX_ctrl
(
EVP_PKEY_CTX
*
ctx
,
int
keytype
,
int
optype
,
int
cmd
,
int
p1
,
void
*
p2
)
{
int
ret
;
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
ctrl
)
{
EVPerr
(
EVP_F_EVP_PKEY_CTX_CTRL
,
EVP_R_COMMAND_NOT_SUPPORTED
);
return
-
2
;
}
if
((
keytype
!=
-
1
)
&&
(
ctx
->
pmeth
->
pkey_id
!=
keytype
))
return
-
1
;
if
(
ctx
->
operation
==
EVP_PKEY_OP_UNDEFINED
)
{
/* Not initialized */
EVPerr
(
EVP_F_EVP_PKEY_CTX_CTRL
,
EVP_R_NO_OPERATION_SET
);
return
-
1
;
}
if
((
optype
!=
-
1
)
&&
(
ctx
->
operation
!=
optype
))
{
/* Invalid operation type */
EVPerr
(
EVP_F_EVP_PKEY_CTX_CTRL
,
EVP_R_INVALID_OPERATION
);
return
-
1
;
}
return
ctx
->
pmeth
->
ctrl
(
ctx
,
cmd
,
p1
,
p2
);
}
ret
=
ctx
->
pmeth
->
ctrl
(
ctx
,
cmd
,
p1
,
p2
);
if
(
ret
==
-
2
)
EVPerr
(
EVP_F_EVP_PKEY_CTX_CTRL
,
EVP_R_COMMAND_NOT_SUPPORTED
);
return
ret
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录