Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
eaff5a14
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
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看板
提交
eaff5a14
编写于
5月 24, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use size_t for new crypto size parameters.
上级
216e0d5b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
89 addition
and
86 deletion
+89
-86
crypto/dh/dh_pmeth.c
crypto/dh/dh_pmeth.c
+1
-1
crypto/dsa/dsa_pmeth.c
crypto/dsa/dsa_pmeth.c
+4
-4
crypto/ec/ec_pmeth.c
crypto/ec/ec_pmeth.c
+7
-7
crypto/evp/evp.h
crypto/evp/evp.h
+23
-23
crypto/evp/evp_locl.h
crypto/evp/evp_locl.h
+13
-12
crypto/evp/pmeth_fn.c
crypto/evp/pmeth_fn.c
+12
-12
crypto/evp/pmeth_lib.c
crypto/evp/pmeth_lib.c
+12
-12
crypto/rsa/rsa_pmeth.c
crypto/rsa/rsa_pmeth.c
+17
-15
未找到文件。
crypto/dh/dh_pmeth.c
浏览文件 @
eaff5a14
...
...
@@ -187,7 +187,7 @@ static int pkey_dh_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
return
DH_generate_key
(
pkey
->
pkey
.
dh
);
}
static
int
pkey_dh_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
)
static
int
pkey_dh_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
keylen
)
{
int
ret
;
if
(
!
ctx
->
pkey
||
!
ctx
->
peerkey
)
...
...
crypto/dsa/dsa_pmeth.c
浏览文件 @
eaff5a14
...
...
@@ -98,8 +98,8 @@ static void pkey_dsa_cleanup(EVP_PKEY_CTX *ctx)
OPENSSL_free
(
dctx
);
}
static
int
pkey_dsa_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
static
int
pkey_dsa_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
int
ret
,
type
;
unsigned
int
sltmp
;
...
...
@@ -120,8 +120,8 @@ static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen,
}
static
int
pkey_dsa_verify
(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
int
ret
,
type
;
DSA_PKEY_CTX
*
dctx
=
ctx
->
data
;
...
...
crypto/ec/ec_pmeth.c
浏览文件 @
eaff5a14
...
...
@@ -99,11 +99,11 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx)
}
}
static
int
pkey_ec_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
static
int
pkey_ec_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
int
ret
,
type
;
unsigned
in
t
sltmp
;
size_
t
sltmp
;
EC_PKEY_CTX
*
dctx
=
ctx
->
data
;
EC_KEY
*
ec
=
ctx
->
pkey
->
pkey
.
ec
;
...
...
@@ -112,7 +112,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen,
*
siglen
=
ECDSA_size
(
ec
);
return
1
;
}
else
if
(
*
siglen
<
ECDSA_size
(
ec
))
else
if
(
*
siglen
<
(
size_t
)
ECDSA_size
(
ec
))
{
ECerr
(
EC_F_PKEY_EC_SIGN
,
EC_R_BUFFER_TOO_SMALL
);
return
0
;
...
...
@@ -133,8 +133,8 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen,
}
static
int
pkey_ec_verify
(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
int
ret
,
type
;
EC_PKEY_CTX
*
dctx
=
ctx
->
data
;
...
...
@@ -150,7 +150,7 @@ static int pkey_ec_verify(EVP_PKEY_CTX *ctx,
return
ret
;
}
static
int
pkey_ec_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
)
static
int
pkey_ec_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
keylen
)
{
int
ret
;
size_t
outlen
;
...
...
crypto/evp/evp.h
浏览文件 @
eaff5a14
...
...
@@ -964,28 +964,28 @@ void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);
int
EVP_PKEY_sign_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
);
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
);
int
EVP_PKEY_verify_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_verify
(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
);
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
);
int
EVP_PKEY_verify_recover_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_verify_recover
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
rout
,
in
t
*
routlen
,
const
unsigned
char
*
sig
,
in
t
siglen
);
unsigned
char
*
rout
,
size_
t
*
routlen
,
const
unsigned
char
*
sig
,
size_
t
siglen
);
int
EVP_PKEY_encrypt_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_encrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
);
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
);
int
EVP_PKEY_decrypt_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_decrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
);
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
);
int
EVP_PKEY_derive_init
(
EVP_PKEY_CTX
*
ctx
);
int
EVP_PKEY_derive_set_peer
(
EVP_PKEY_CTX
*
ctx
,
EVP_PKEY
*
peer
);
int
EVP_PKEY_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
);
int
EVP_PKEY_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
keylen
);
typedef
int
EVP_PKEY_gen_cb
(
EVP_PKEY_CTX
*
ctx
);
...
...
@@ -1013,23 +1013,23 @@ void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_sign
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
sign_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
));
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
));
void
EVP_PKEY_meth_set_verify
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
verify_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
));
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
));
void
EVP_PKEY_meth_set_verify_recover
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
verify_recover_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
verify_recover
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
));
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
));
void
EVP_PKEY_meth_set_signctx
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
signctx_init
)(
EVP_PKEY_CTX
*
ctx
,
EVP_MD_CTX
*
mctx
),
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
EVP_MD_CTX
*
mctx
));
void
EVP_PKEY_meth_set_verifyctx
(
EVP_PKEY_METHOD
*
pmeth
,
...
...
@@ -1039,17 +1039,17 @@ void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_encrypt
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
encrypt_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
));
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
));
void
EVP_PKEY_meth_set_decrypt
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
decrypt_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
));
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
));
void
EVP_PKEY_meth_set_derive
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
derive_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
));
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
keylen
));
void
EVP_PKEY_meth_set_ctrl
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
ctrl
)(
EVP_PKEY_CTX
*
ctx
,
int
type
,
int
p1
,
void
*
p2
),
...
...
crypto/evp/evp_locl.h
浏览文件 @
eaff5a14
...
...
@@ -273,20 +273,21 @@ struct evp_pkey_method_st
int
(
*
keygen
)(
EVP_PKEY_CTX
*
ctx
,
EVP_PKEY
*
pkey
);
int
(
*
sign_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
);
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
);
int
(
*
verify_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
int
siglen
,
const
unsigned
char
*
tbs
,
int
tbslen
);
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
size_t
siglen
,
const
unsigned
char
*
tbs
,
size_t
tbslen
);
int
(
*
verify_recover_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
verify_recover
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
rout
,
in
t
*
routlen
,
const
unsigned
char
*
sig
,
in
t
siglen
);
unsigned
char
*
rout
,
size_
t
*
routlen
,
const
unsigned
char
*
sig
,
size_
t
siglen
);
int
(
*
signctx_init
)(
EVP_PKEY_CTX
*
ctx
,
EVP_MD_CTX
*
mctx
);
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
EVP_MD_CTX
*
mctx
);
int
(
*
verifyctx_init
)(
EVP_PKEY_CTX
*
ctx
,
EVP_MD_CTX
*
mctx
);
...
...
@@ -294,15 +295,15 @@ struct evp_pkey_method_st
EVP_MD_CTX
*
mctx
);
int
(
*
encrypt_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
);
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
);
int
(
*
decrypt_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
);
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
);
int
(
*
derive_init
)(
EVP_PKEY_CTX
*
ctx
);
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
);
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
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
浏览文件 @
eaff5a14
...
...
@@ -66,7 +66,7 @@
#define M_check_autoarg(ctx, arg, arglen, err) \
if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) \
{ \
int pksize =
EVP_PKEY_size(ctx->pkey); \
size_t pksize = (size_t)
EVP_PKEY_size(ctx->pkey); \
if (!arg) \
{ \
*arglen = pksize; \
...
...
@@ -98,8 +98,8 @@ int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx)
}
int
EVP_PKEY_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
sign
)
{
...
...
@@ -135,8 +135,8 @@ int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx)
}
int
EVP_PKEY_verify
(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
verify
)
{
...
...
@@ -171,8 +171,8 @@ int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx)
}
int
EVP_PKEY_verify_recover
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
rout
,
in
t
*
routlen
,
const
unsigned
char
*
sig
,
in
t
siglen
)
unsigned
char
*
rout
,
size_
t
*
routlen
,
const
unsigned
char
*
sig
,
size_
t
siglen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
verify_recover
)
{
...
...
@@ -208,8 +208,8 @@ int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx)
}
int
EVP_PKEY_encrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
)
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
encrypt
)
{
...
...
@@ -245,8 +245,8 @@ int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx)
}
int
EVP_PKEY_decrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
)
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
decrypt
)
{
...
...
@@ -342,7 +342,7 @@ int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer)
}
int
EVP_PKEY_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
pkeylen
)
int
EVP_PKEY_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
pkeylen
)
{
if
(
!
ctx
||
!
ctx
->
pmeth
||
!
ctx
->
pmeth
->
derive
)
{
...
...
crypto/evp/pmeth_lib.c
浏览文件 @
eaff5a14
...
...
@@ -329,8 +329,8 @@ void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_sign
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
sign_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
))
int
(
*
sign
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
))
{
pmeth
->
sign_init
=
sign_init
;
pmeth
->
sign
=
sign
;
...
...
@@ -338,8 +338,8 @@ void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_verify
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
verify_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
))
int
(
*
verify
)(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
))
{
pmeth
->
verify_init
=
verify_init
;
pmeth
->
verify
=
verify
;
...
...
@@ -348,8 +348,8 @@ void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_verify_recover
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
verify_recover_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
verify_recover
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
))
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
))
{
pmeth
->
verify_recover_init
=
verify_recover_init
;
pmeth
->
verify_recover
=
verify_recover
;
...
...
@@ -357,7 +357,7 @@ void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_signctx
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
signctx_init
)(
EVP_PKEY_CTX
*
ctx
,
EVP_MD_CTX
*
mctx
),
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
int
(
*
signctx
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
EVP_MD_CTX
*
mctx
))
{
pmeth
->
signctx_init
=
signctx_init
;
...
...
@@ -375,8 +375,8 @@ void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_encrypt
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
encrypt_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
))
int
(
*
encrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
))
{
pmeth
->
encrypt_init
=
encrypt_init
;
pmeth
->
encrypt
=
encrypt
;
...
...
@@ -384,8 +384,8 @@ void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_decrypt
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
decrypt_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
in
t
*
outlen
,
const
unsigned
char
*
in
,
in
t
inlen
))
int
(
*
decrypt
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_
t
*
outlen
,
const
unsigned
char
*
in
,
size_
t
inlen
))
{
pmeth
->
decrypt_init
=
decrypt_init
;
pmeth
->
decrypt
=
decrypt
;
...
...
@@ -393,7 +393,7 @@ void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
void
EVP_PKEY_meth_set_derive
(
EVP_PKEY_METHOD
*
pmeth
,
int
(
*
derive_init
)(
EVP_PKEY_CTX
*
ctx
),
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
in
t
*
keylen
))
int
(
*
derive
)(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_
t
*
keylen
))
{
pmeth
->
derive_init
=
derive_init
;
pmeth
->
derive
=
derive
;
...
...
crypto/rsa/rsa_pmeth.c
浏览文件 @
eaff5a14
...
...
@@ -64,9 +64,9 @@
#include <openssl/evp.h>
#include "evp_locl.h"
extern
int
int_rsa_verify
(
int
dtype
,
const
unsigned
char
*
m
,
unsigned
in
t
m_len
,
unsigned
char
*
rm
,
unsigned
in
t
*
prm_len
,
const
unsigned
char
*
sigbuf
,
unsigned
in
t
siglen
,
extern
int
int_rsa_verify
(
int
dtype
,
const
unsigned
char
*
m
,
size_
t
m_len
,
unsigned
char
*
rm
,
size_
t
*
prm_len
,
const
unsigned
char
*
sigbuf
,
size_
t
siglen
,
RSA
*
rsa
);
/* RSA pkey context structure */
...
...
@@ -132,8 +132,8 @@ static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx)
}
}
static
int
pkey_rsa_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
in
t
*
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
static
int
pkey_rsa_sign
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
sig
,
size_
t
*
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
int
ret
;
RSA_PKEY_CTX
*
rctx
=
ctx
->
data
;
...
...
@@ -141,7 +141,7 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen,
if
(
rctx
->
md
)
{
if
(
tbslen
!=
EVP_MD_size
(
rctx
->
md
))
if
(
tbslen
!=
(
size_t
)
EVP_MD_size
(
rctx
->
md
))
{
RSAerr
(
RSA_F_PKEY_RSA_SIGN
,
RSA_R_INVALID_DIGEST_LENGTH
);
...
...
@@ -190,8 +190,8 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen,
static
int
pkey_rsa_verifyrecover
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
rout
,
in
t
*
routlen
,
const
unsigned
char
*
sig
,
in
t
siglen
)
unsigned
char
*
rout
,
size_
t
*
routlen
,
const
unsigned
char
*
sig
,
size_
t
siglen
)
{
int
ret
;
RSA_PKEY_CTX
*
rctx
=
ctx
->
data
;
...
...
@@ -245,12 +245,12 @@ static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx,
}
static
int
pkey_rsa_verify
(
EVP_PKEY_CTX
*
ctx
,
const
unsigned
char
*
sig
,
in
t
siglen
,
const
unsigned
char
*
tbs
,
in
t
tbslen
)
const
unsigned
char
*
sig
,
size_
t
siglen
,
const
unsigned
char
*
tbs
,
size_
t
tbslen
)
{
RSA_PKEY_CTX
*
rctx
=
ctx
->
data
;
RSA
*
rsa
=
ctx
->
pkey
->
pkey
.
rsa
;
in
t
rslen
;
size_
t
rslen
;
if
(
rctx
->
md
)
{
if
(
rctx
->
pad_mode
==
RSA_PKCS1_PADDING
)
...
...
@@ -298,8 +298,9 @@ static int pkey_rsa_verify(EVP_PKEY_CTX *ctx,
}
static
int
pkey_rsa_encrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
int
*
outlen
,
const
unsigned
char
*
in
,
int
inlen
)
static
int
pkey_rsa_encrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_t
*
outlen
,
const
unsigned
char
*
in
,
size_t
inlen
)
{
int
ret
;
RSA_PKEY_CTX
*
rctx
=
ctx
->
data
;
...
...
@@ -311,8 +312,9 @@ static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen,
return
1
;
}
static
int
pkey_rsa_decrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
int
*
outlen
,
const
unsigned
char
*
in
,
int
inlen
)
static
int
pkey_rsa_decrypt
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
out
,
size_t
*
outlen
,
const
unsigned
char
*
in
,
size_t
inlen
)
{
int
ret
;
RSA_PKEY_CTX
*
rctx
=
ctx
->
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录