Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b4e7ef2f
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看板
提交
b4e7ef2f
编写于
10月 26, 2022
作者:
Q
qiaozzzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
huks代码维护
Signed-off-by:
N
qiaozzzh
<
qiaozhang@huawei.com
>
上级
2c331523
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
40 addition
and
13 deletion
+40
-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/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
+2
-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
+2
-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
+2
-0
security_lite/huks/liteos_m_adapter/hks_mac_test.c
security_lite/huks/liteos_m_adapter/hks_mac_test.c
+2
-0
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
+2
-0
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
-4
未找到文件。
security_lite/huks/common/hks_test_cipher.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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
,
(
char
const
*
)
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/liteos_a_adapter/hks_derive_test.cpp
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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/include",
"../common/include",
]
...
...
security_lite/huks/liteos_m_adapter/hks_aes_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -28,6 +28,8 @@
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
#include <unistd.h>
static
osPriority_t
g_setPriority
;
/*
...
...
security_lite/huks/liteos_m_adapter/hks_cipher_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -26,6 +26,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define DEFAULT_DERIVE_SIZE 32
#define DEFAULT_INFO_SIZE 55
#define DEFAULT_SALT_SIZE 16
...
...
security_lite/huks/liteos_m_adapter/hks_exist_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -27,6 +27,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define DEFAULT_X25519_PARAM_SET_OUT 104
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
...
...
security_lite/huks/liteos_m_adapter/hks_generate_random_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -28,6 +28,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define DEFAULT_SRC_DATA_SIZE 200
#define DIGEST_SHA256_HASH_SIZE 32
#define TEST_TASK_STACK_SIZE 0x2000
...
...
security_lite/huks/liteos_m_adapter/hks_mac_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -26,6 +26,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define HKS_TEST_MAC_REE_KEY_SIZE_32 32
#define HKS_DEFAULT_MAC_SRCDATA_SIZE 253
#define HKS_DEFAULT_MAC_SHA256_SIZE 32
...
...
security_lite/huks/liteos_m_adapter/hks_modify_key_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -30,6 +30,8 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#include <unistd.h>
#define DEFAULT_AES_CIPHER_PLAIN_SIZE 1000
#define AES_DEFAULT_GCM_NONCE_LENGTH 12
#define AES_DEFAULT_AAD_LEN 4
...
...
security_lite/huks/liteos_m_adapter/hks_others_test.c
浏览文件 @
b4e7ef2f
...
...
@@ -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
浏览文件 @
b4e7ef2f
...
...
@@ -16,9 +16,9 @@
#ifndef _CUT_AUTHENTICATE_
#include "hks_safe_compare_key_test.h"
#include "hks_mem.h"
#include <hctest.h>
#include <unistd.h>
#include "hks_api.h"
#include "hks_param.h"
#include "hks_test_api_performance.h"
...
...
@@ -197,13 +197,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录