Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6c495bdb
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6c495bdb
编写于
7月 01, 2009
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Upadte from 1.0.0-stable
上级
8b968750
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
crypto/engine/eng_cryptodev.c
crypto/engine/eng_cryptodev.c
+9
-9
未找到文件。
crypto/engine/eng_cryptodev.c
浏览文件 @
6c495bdb
...
@@ -70,9 +70,9 @@ struct dev_crypto_state {
...
@@ -70,9 +70,9 @@ struct dev_crypto_state {
int
d_fd
;
int
d_fd
;
#ifdef USE_CRYPTODEV_DIGESTS
#ifdef USE_CRYPTODEV_DIGESTS
char
dummy_mac_key
[
20
];
char
dummy_mac_key
[
HASH_MAX_LEN
];
unsigned
char
digest_res
[
20
];
unsigned
char
digest_res
[
HASH_MAX_LEN
];
char
*
mac_data
;
char
*
mac_data
;
int
mac_len
;
int
mac_len
;
...
@@ -90,7 +90,7 @@ static int get_cryptodev_digests(const int **cnids);
...
@@ -90,7 +90,7 @@ static int get_cryptodev_digests(const int **cnids);
static
int
cryptodev_usable_ciphers
(
const
int
**
nids
);
static
int
cryptodev_usable_ciphers
(
const
int
**
nids
);
static
int
cryptodev_usable_digests
(
const
int
**
nids
);
static
int
cryptodev_usable_digests
(
const
int
**
nids
);
static
int
cryptodev_cipher
(
EVP_CIPHER_CTX
*
ctx
,
unsigned
char
*
out
,
static
int
cryptodev_cipher
(
EVP_CIPHER_CTX
*
ctx
,
unsigned
char
*
out
,
const
unsigned
char
*
in
,
unsigned
in
t
inl
);
const
unsigned
char
*
in
,
size_
t
inl
);
static
int
cryptodev_init_key
(
EVP_CIPHER_CTX
*
ctx
,
const
unsigned
char
*
key
,
static
int
cryptodev_init_key
(
EVP_CIPHER_CTX
*
ctx
,
const
unsigned
char
*
key
,
const
unsigned
char
*
iv
,
int
enc
);
const
unsigned
char
*
iv
,
int
enc
);
static
int
cryptodev_cleanup
(
EVP_CIPHER_CTX
*
ctx
);
static
int
cryptodev_cleanup
(
EVP_CIPHER_CTX
*
ctx
);
...
@@ -343,7 +343,7 @@ cryptodev_usable_digests(const int **nids)
...
@@ -343,7 +343,7 @@ cryptodev_usable_digests(const int **nids)
static
int
static
int
cryptodev_cipher
(
EVP_CIPHER_CTX
*
ctx
,
unsigned
char
*
out
,
cryptodev_cipher
(
EVP_CIPHER_CTX
*
ctx
,
unsigned
char
*
out
,
const
unsigned
char
*
in
,
unsigned
in
t
inl
)
const
unsigned
char
*
in
,
size_
t
inl
)
{
{
struct
crypt_op
cryp
;
struct
crypt_op
cryp
;
struct
dev_crypto_state
*
state
=
ctx
->
cipher_data
;
struct
dev_crypto_state
*
state
=
ctx
->
cipher_data
;
...
@@ -421,7 +421,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
...
@@ -421,7 +421,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
if
((
state
->
d_fd
=
get_dev_crypto
())
<
0
)
if
((
state
->
d_fd
=
get_dev_crypto
())
<
0
)
return
(
0
);
return
(
0
);
sess
->
key
=
(
unsigned
char
*
)
key
;
sess
->
key
=
(
caddr_t
)
key
;
sess
->
keylen
=
ctx
->
key_len
;
sess
->
keylen
=
ctx
->
key_len
;
sess
->
cipher
=
cipher
;
sess
->
cipher
=
cipher
;
...
@@ -723,7 +723,7 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
...
@@ -723,7 +723,7 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
cryp
.
len
=
count
;
cryp
.
len
=
count
;
cryp
.
src
=
(
caddr_t
)
data
;
cryp
.
src
=
(
caddr_t
)
data
;
cryp
.
dst
=
NULL
;
cryp
.
dst
=
NULL
;
cryp
.
mac
=
state
->
digest_res
;
cryp
.
mac
=
(
caddr_t
)
state
->
digest_res
;
if
(
ioctl
(
state
->
d_fd
,
CIOCCRYPT
,
&
cryp
)
<
0
)
{
if
(
ioctl
(
state
->
d_fd
,
CIOCCRYPT
,
&
cryp
)
<
0
)
{
printf
(
"cryptodev_digest_update: digest failed
\n
"
);
printf
(
"cryptodev_digest_update: digest failed
\n
"
);
return
(
0
);
return
(
0
);
...
@@ -754,7 +754,7 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md)
...
@@ -754,7 +754,7 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md)
cryp
.
len
=
state
->
mac_len
;
cryp
.
len
=
state
->
mac_len
;
cryp
.
src
=
state
->
mac_data
;
cryp
.
src
=
state
->
mac_data
;
cryp
.
dst
=
NULL
;
cryp
.
dst
=
NULL
;
cryp
.
mac
=
md
;
cryp
.
mac
=
(
caddr_t
)
md
;
if
(
ioctl
(
state
->
d_fd
,
CIOCCRYPT
,
&
cryp
)
<
0
)
{
if
(
ioctl
(
state
->
d_fd
,
CIOCCRYPT
,
&
cryp
)
<
0
)
{
printf
(
"cryptodev_digest_final: digest failed
\n
"
);
printf
(
"cryptodev_digest_final: digest failed
\n
"
);
...
@@ -899,7 +899,7 @@ bn2crparam(const BIGNUM *a, struct crparam *crp)
...
@@ -899,7 +899,7 @@ bn2crparam(const BIGNUM *a, struct crparam *crp)
return
(
1
);
return
(
1
);
memset
(
b
,
0
,
bytes
);
memset
(
b
,
0
,
bytes
);
crp
->
crp_p
=
b
;
crp
->
crp_p
=
(
caddr_t
)
b
;
crp
->
crp_nbits
=
bits
;
crp
->
crp_nbits
=
bits
;
for
(
i
=
0
,
j
=
0
;
i
<
a
->
top
;
i
++
)
{
for
(
i
=
0
,
j
=
0
;
i
<
a
->
top
;
i
++
)
{
...
@@ -1253,7 +1253,7 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
...
@@ -1253,7 +1253,7 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
goto
err
;
goto
err
;
kop
.
crk_iparams
=
3
;
kop
.
crk_iparams
=
3
;
kop
.
crk_param
[
3
].
crp_p
=
key
;
kop
.
crk_param
[
3
].
crp_p
=
(
caddr_t
)
key
;
kop
.
crk_param
[
3
].
crp_nbits
=
keylen
*
8
;
kop
.
crk_param
[
3
].
crp_nbits
=
keylen
*
8
;
kop
.
crk_oparams
=
1
;
kop
.
crk_oparams
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录