Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
567782c6
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
567782c6
编写于
10月 21, 2022
作者:
Q
qiaozzzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
huks代码维护
Signed-off-by:
N
qiaozzzh
<
qiaozhang@huawei.com
>
上级
c1799ac5
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
38 addition
and
13 deletion
+38
-13
security_lite/huks/common/hks_test_cipher.c
security_lite/huks/common/hks_test_cipher.c
+3
-3
security_lite/huks/common/hks_test_common.c
security_lite/huks/common/hks_test_common.c
+1
-1
security_lite/huks/common/hks_test_file_operator.c
security_lite/huks/common/hks_test_file_operator.c
+3
-3
security_lite/huks/common/include/hks_test_common.h
security_lite/huks/common/include/hks_test_common.h
+1
-1
security_lite/huks/liteos_a_adapter/hks_derive_test.cpp
security_lite/huks/liteos_a_adapter/hks_derive_test.cpp
+1
-1
security_lite/huks/liteos_a_adapter/hks_mac_test.cpp
security_lite/huks/liteos_a_adapter/hks_mac_test.cpp
+1
-1
security_lite/huks/liteos_m_adapter/BUILD.gn
security_lite/huks/liteos_m_adapter/BUILD.gn
+1
-0
security_lite/huks/liteos_m_adapter/hks_aes_test.c
security_lite/huks/liteos_m_adapter/hks_aes_test.c
+3
-0
security_lite/huks/liteos_m_adapter/hks_agreement_test.c
security_lite/huks/liteos_m_adapter/hks_agreement_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_bn_exp_mod_test.c
security_lite/huks/liteos_m_adapter/hks_bn_exp_mod_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_cipher_test.c
security_lite/huks/liteos_m_adapter/hks_cipher_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_delete_test.c
security_lite/huks/liteos_m_adapter/hks_delete_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_derive_test.c
security_lite/huks/liteos_m_adapter/hks_derive_test.c
+1
-0
security_lite/huks/liteos_m_adapter/hks_exist_test.c
security_lite/huks/liteos_m_adapter/hks_exist_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_generate_key_test.c
security_lite/huks/liteos_m_adapter/hks_generate_key_test.c
+1
-0
security_lite/huks/liteos_m_adapter/hks_generate_random_test.c
...ity_lite/huks/liteos_m_adapter/hks_generate_random_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_hash_test.c
security_lite/huks/liteos_m_adapter/hks_hash_test.c
+1
-0
security_lite/huks/liteos_m_adapter/hks_mac_test.c
security_lite/huks/liteos_m_adapter/hks_mac_test.c
+1
-0
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
+3
-1
security_lite/huks/liteos_m_adapter/hks_others_test.c
security_lite/huks/liteos_m_adapter/hks_others_test.c
+1
-0
security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c
...ty_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c
+4
-2
未找到文件。
security_lite/huks/common/hks_test_cipher.c
浏览文件 @
567782c6
...
...
@@ -593,7 +593,7 @@ int32_t BaseTestCipher(uint32_t times, uint32_t index, uint32_t performTimes)
g_testCipherParams
[
index
].
genKeyParamSetParams
.
keyStorageFlag
==
HKS_STORAGE_TEMP
)
{
ret
=
GenerateLocalRandomKey
(
&
keyAlias
,
&
g_testCipherParams
[
index
].
localKeyParams
);
}
else
{
ret
=
GenerateKey
(
&
keyAlias
,
&
g_testCipherParams
[
index
].
keyAliasParams
,
ret
=
Huks
GenerateKey
(
&
keyAlias
,
&
g_testCipherParams
[
index
].
keyAliasParams
,
&
g_testCipherParams
[
index
].
genKeyParamSetParams
,
&
g_testCipherParams
[
index
].
genKeyParamSetParamsOut
);
}
HKS_TEST_ASSERT
(
ret
==
0
);
...
...
@@ -648,7 +648,7 @@ int32_t BaseTestEncrypt(uint32_t times, uint32_t index, uint32_t performTimes)
ret
=
GenerateLocalRandomKey
(
&
keyAlias
,
&
g_testEncryptParams
[
index
].
localKeyParams
);
}
else
{
if
(
g_testEncryptParams
[
index
].
keyAliasParams
.
blobExist
)
{
ret
=
GenerateKey
(
&
keyAlias
,
&
g_testEncryptParams
[
index
].
keyAliasParams
,
ret
=
Huks
GenerateKey
(
&
keyAlias
,
&
g_testEncryptParams
[
index
].
keyAliasParams
,
&
g_testEncryptParams
[
index
].
genKeyParamSetParams
,
NULL
);
}
else
{
ret
=
TestConstuctBlob
(
&
keyAlias
,
...
...
@@ -700,7 +700,7 @@ int32_t BaseTestDecrypt(uint32_t times, uint32_t index, uint32_t performTimes)
ret
=
GenerateLocalRandomKey
(
&
keyAlias
,
&
g_testDecryptParams
[
index
].
localKeyParams
);
}
else
{
if
(
g_testDecryptParams
[
index
].
keyAliasParams
.
blobExist
)
{
ret
=
GenerateKey
(
&
keyAlias
,
&
g_testDecryptParams
[
index
].
keyAliasParams
,
ret
=
Huks
GenerateKey
(
&
keyAlias
,
&
g_testDecryptParams
[
index
].
keyAliasParams
,
&
g_testDecryptParams
[
index
].
genKeyParamSetParams
,
NULL
);
}
else
{
ret
=
TestConstuctBlob
(
&
keyAlias
,
...
...
security_lite/huks/common/hks_test_common.c
浏览文件 @
567782c6
...
...
@@ -551,7 +551,7 @@ int32_t TestConstructHashParamSet(
return
ret
;
}
int32_t
GenerateKey
(
struct
HksBlob
**
keyAlias
,
const
struct
HksTestBlobParams
*
keyAliasParams
,
int32_t
Huks
GenerateKey
(
struct
HksBlob
**
keyAlias
,
const
struct
HksTestBlobParams
*
keyAliasParams
,
const
struct
HksTestGenKeyParamsParamSet
*
genKeyParamSetParams
,
const
struct
HksTestGenKeyParamsParamSetOut
*
genKeyParamSetParamsOut
)
{
...
...
security_lite/huks/common/hks_test_file_operator.c
浏览文件 @
567782c6
...
...
@@ -185,7 +185,7 @@ static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, ui
{
/* now offset is 0, but we maybe extend hi1131 file interfaces in the future */
if
(
offset
!=
0
)
{
return
HKS_ERROR_INVALID_ARGUMENT
;
return
(
uint32_t
)(
HKS_ERROR_INVALID_ARGUMENT
)
;
}
unsigned
int
fileSize
;
...
...
@@ -206,7 +206,7 @@ static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, ui
return
0
;
}
ret
=
UtilsFileRead
(
fd
,
buf
,
len
);
ret
=
UtilsFileRead
(
fd
,
(
char
*
)(
buf
)
,
len
);
UtilsFileClose
(
fd
);
if
(
ret
<
0
)
{
HKS_TEST_LOG_E
(
"failed to read file, errno = 0x%x"
,
ret
);
...
...
@@ -229,7 +229,7 @@ static int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *b
return
HKS_ERROR_OPEN_FILE_FAIL
;
}
int32_t
ret
=
UtilsFileWrite
(
fd
,
buf
,
len
);
int32_t
ret
=
UtilsFileWrite
(
fd
,
(
const
char
*
)
buf
,
len
);
if
(
ret
<
0
)
{
HKS_TEST_LOG_E
(
"failed to write key file, errno = 0x%x
\n
"
,
ret
);
ret
=
HKS_ERROR_WRITE_FILE_FAIL
;
...
...
security_lite/huks/common/include/hks_test_common.h
浏览文件 @
567782c6
...
...
@@ -412,7 +412,7 @@ int32_t TestConstructHashParamSet(
bool
paramSetExist
,
bool
setDigest
,
uint32_t
digest
);
int32_t
GenerateKey
(
struct
HksBlob
**
keyAlias
,
const
struct
HksTestBlobParams
*
keyAliasParams
,
int32_t
Huks
GenerateKey
(
struct
HksBlob
**
keyAlias
,
const
struct
HksTestBlobParams
*
keyAliasParams
,
const
struct
HksTestGenKeyParamsParamSet
*
genKeyParamSetParams
,
const
struct
HksTestGenKeyParamsParamSetOut
*
genKeyParamSetParamsOut
);
...
...
security_lite/huks/liteos_a_adapter/hks_derive_test.cpp
浏览文件 @
567782c6
...
...
@@ -154,7 +154,7 @@ static int32_t BaseTestDerive(uint32_t index)
ret
=
GenerateLocalRandomKey
(
&
keyAlias
,
&
g_testDeriveParams
[
index
].
localKeyParams
);
}
else
{
if
(
g_testDeriveParams
[
index
].
keyAliasParams
.
blobExist
)
{
ret
=
GenerateKey
(
&
keyAlias
,
&
g_testDeriveParams
[
index
].
keyAliasParams
,
ret
=
Huks
GenerateKey
(
&
keyAlias
,
&
g_testDeriveParams
[
index
].
keyAliasParams
,
&
g_testDeriveParams
[
index
].
genKeyParamSetParams
,
NULL
);
}
else
{
ret
=
TestConstuctBlob
(
&
keyAlias
,
...
...
security_lite/huks/liteos_a_adapter/hks_mac_test.cpp
浏览文件 @
567782c6
...
...
@@ -142,7 +142,7 @@ static int32_t BaseTestMac(uint32_t index)
g_testMacParams
[
index
].
keyParams
.
blobDataSize
);
}
else
{
if
(
g_testMacParams
[
index
].
keyAliasParams
.
blobExist
)
{
ret
=
GenerateKey
(
&
key
,
&
(
g_testMacParams
[
index
].
keyAliasParams
),
ret
=
Huks
GenerateKey
(
&
key
,
&
(
g_testMacParams
[
index
].
keyAliasParams
),
&
g_testMacParams
[
index
].
genKeyParamSetParams
,
NULL
);
}
else
{
ret
=
TestConstuctBlob
(
&
key
,
...
...
security_lite/huks/liteos_m_adapter/BUILD.gn
浏览文件 @
567782c6
...
...
@@ -39,6 +39,7 @@ hctest_suite("ActsHuksHalFunctionTest") {
include_dirs = [
"//base/security/huks/interfaces/innerkits/huks_standard/main/include",
"//base/iothardware/peripheral/interfaces/inner_api",
"//base/security/huks/frameworks/huks_standard/main/common/incloude",
"../common/include",
]
...
...
security_lite/huks/liteos_m_adapter/hks_aes_test.c
浏览文件 @
567782c6
...
...
@@ -17,10 +17,13 @@
#include "hks_api.h"
#include "hks_param.h"
#include "hks_test_aes.h"
#include "securec.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_agreement_test.c
浏览文件 @
567782c6
...
...
@@ -26,6 +26,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TMP_SIZE 512
#define X25519_KEY_SIZE 32
#define TEST_TASK_STACK_SIZE 0x2000
...
...
security_lite/huks/liteos_m_adapter/hks_bn_exp_mod_test.c
浏览文件 @
567782c6
...
...
@@ -25,6 +25,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_cipher_test.c
浏览文件 @
567782c6
...
...
@@ -24,6 +24,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_INDEX_0 0
#define TEST_INDEX_1 1
#define TEST_INDEX_2 2
...
...
security_lite/huks/liteos_m_adapter/hks_delete_test.c
浏览文件 @
567782c6
...
...
@@ -27,6 +27,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_derive_test.c
浏览文件 @
567782c6
...
...
@@ -15,6 +15,7 @@
#include <hctest.h>
#include <unistd.h>
#include "hks_derive_test.h"
...
...
security_lite/huks/liteos_m_adapter/hks_exist_test.c
浏览文件 @
567782c6
...
...
@@ -27,6 +27,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_generate_key_test.c
浏览文件 @
567782c6
...
...
@@ -18,6 +18,7 @@
#include "hks_generate_key_test.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
...
...
security_lite/huks/liteos_m_adapter/hks_generate_random_test.c
浏览文件 @
567782c6
...
...
@@ -26,6 +26,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_hash_test.c
浏览文件 @
567782c6
...
...
@@ -16,6 +16,7 @@
#ifndef _CUT_AUTHENTICATE_
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
...
...
security_lite/huks/liteos_m_adapter/hks_mac_test.c
浏览文件 @
567782c6
...
...
@@ -16,6 +16,7 @@
#include "hks_mac_test.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
...
...
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
浏览文件 @
567782c6
...
...
@@ -18,6 +18,7 @@
#include "hks_modify_key_test.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
...
...
@@ -291,7 +292,7 @@ int32_t BaseTestCipherProcess(const struct HksBlob *keyAlias, uint32_t index)
}
/* 3. decrypt */
struct
CipherDecryptStructure
testDecryptStruct
=
{
keyAlias
,
&
g_testCipherParams
[
index
],
cipherData
,
(
struct
HksBlob
*
)(
keyAlias
)
,
&
g_testCipherParams
[
index
],
cipherData
,
&
decryptedData
,
ivData
,
nonceData
,
aadData
,
1
};
ret
=
DecryptCipher
(
&
testDecryptStruct
);
...
...
@@ -330,6 +331,7 @@ int32_t __attribute__((weak)) HksStoreKeyBlob(const struct HksBlob *processName,
(
void
)
keyAlias
;
(
void
)
storageType
;
(
void
)
keyBlob
;
return
HKS_SUCCESS
;
}
static
void
ExecHksModifyKeyTest001
(
void
const
*
argument
)
...
...
security_lite/huks/liteos_m_adapter/hks_others_test.c
浏览文件 @
567782c6
...
...
@@ -18,6 +18,7 @@
#include "hks_others_test.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
...
...
security_lite/huks/liteos_m_adapter/hks_safe_compare_key_test.c
浏览文件 @
567782c6
...
...
@@ -18,8 +18,10 @@
#include "hks_safe_compare_key_test.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_mem.h"
#include "hks_param.h"
#include "hks_test_api_performance.h"
#include "hks_test_common.h"
...
...
@@ -197,13 +199,13 @@ static int32_t CompareKeyData(struct HksBlob *keyAliasOne, struct HksBlob *keyAl
g_storageImageBuffer
.
size
=
sizeOne
;
int32_t
offset1
;
int
ret
=
GetKeyOffsetByKeyAlias
(
keyAliasOne
,
&
offset1
);
int
ret
=
GetKeyOffsetByKeyAlias
(
keyAliasOne
,
(
uint32_t
*
)(
&
offset1
)
);
TEST_ASSERT_TRUE
(
ret
==
0
);
struct
HksStoreKeyInfo
*
keyInfo1
=
(
struct
HksStoreKeyInfo
*
)(
g_storageImageBuffer
.
data
+
offset1
);
int32_t
offset2
;
ret
=
GetKeyOffsetByKeyAlias
(
keyAliasTwo
,
&
offset2
);
ret
=
GetKeyOffsetByKeyAlias
(
keyAliasTwo
,
(
uint32_t
*
)(
&
offset2
)
);
TEST_ASSERT_TRUE
(
ret
==
0
);
struct
HksStoreKeyInfo
*
keyInfo2
=
(
struct
HksStoreKeyInfo
*
)(
g_storageImageBuffer
.
data
+
offset2
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录