Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0d4e2b02
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看板
未验证
提交
0d4e2b02
编写于
1月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1626 设备认证依赖算法测试用例
Merge pull request !1626 from code4lala/deviceauth_alg_xts_test_case
上级
44b25e27
a927a6d4
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
884 addition
and
94 deletion
+884
-94
security_lite/deviceauth_basic_deps/BUILD.gn
security_lite/deviceauth_basic_deps/BUILD.gn
+42
-11
security_lite/deviceauth_basic_deps/README.md
security_lite/deviceauth_basic_deps/README.md
+8
-0
security_lite/deviceauth_basic_deps/deviceauth.gni
security_lite/deviceauth_basic_deps/deviceauth.gni
+24
-0
security_lite/deviceauth_basic_deps/hc_alg_test.c
security_lite/deviceauth_basic_deps/hc_alg_test.c
+716
-78
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
+94
-5
未找到文件。
security_lite/deviceauth_basic_deps/BUILD.gn
浏览文件 @
0d4e2b02
...
...
@@ -50,16 +50,8 @@ hctest_suite("ActsSecurityHichainBasicDeps") {
"UTILS_FILE_IMPLEMENTED=1",
"TEST_PTHREAD_CREATE_DETACHED=0",
"TEST_HC_FILE_OPEN_SERIES=1",
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
"TEST_IMPORT_ASYMMETRIC_KEY=1",
"TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=1",
"TEST_HASH_TO_POINT=1",
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET=1",
"TEST_BIG_NUM_EXP_MOD=1",
]
defines += DEVICEAUTH_BASIC_DEPS_ALGORITHM_DEFINES
if (defined(ohos_lite)) {
include_dirs += [
...
...
@@ -76,11 +68,42 @@ hctest_suite("ActsSecurityHichainBasicDeps") {
defines -= [
"FLASH_START_ADDRESS_HICHAIN=0",
"TEST_HC_FILE_OPEN_SERIES=1",
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
"TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=1",
"TEST_HASH_TO_POINT=1",
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET=1",
"TEST_GENERATE_KEY_PAIR=1",
"TEST_EXPORT_PUBLIC_KEY=1",
"TEST_ALGORITHM_SIGN=1",
"TEST_ALGORITHM_VERIFY=1",
"TEST_IMPORT_PUBLIC_KEY=1",
"TEST_CHECK_KEY_EXIST=1",
"TEST_DELETE_KEY=1",
"TEST_AES_GCM_ENCRYPT=1",
"TEST_AES_GCM_DECRYPT=1",
]
defines += [
"FLASH_START_ADDRESS_HICHAIN=0x1F6000",
"TEST_HC_FILE_OPEN_SERIES=0",
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=0",
"TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=0",
"TEST_HASH_TO_POINT=0",
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=0",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=0",
"TEST_AGREE_SHARED_SECRET=0",
"TEST_GENERATE_KEY_PAIR=0",
"TEST_EXPORT_PUBLIC_KEY=0",
"TEST_ALGORITHM_SIGN=0",
"TEST_ALGORITHM_VERIFY=0",
"TEST_IMPORT_PUBLIC_KEY=0",
"TEST_CHECK_KEY_EXIST=0",
"TEST_DELETE_KEY=0",
"TEST_AES_GCM_ENCRYPT=0",
"TEST_AES_GCM_DECRYPT=0",
]
defines += [ "DO_NOT_TEST_DEPRECATED_IMPORT_SYMMETRIC_KEY=1" ]
}
if (board_name == "hispark_pegasus") {
# 3861
...
...
@@ -90,7 +113,11 @@ hctest_suite("ActsSecurityHichainBasicDeps") {
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET=1",
"TEST_BIG_NUM_EXP_MOD=1",
"TEST_GENERATE_KEY_PAIR=1",
"TEST_EXPORT_PUBLIC_KEY=1",
"TEST_ALGORITHM_SIGN=1",
"TEST_ALGORITHM_VERIFY=1",
"TEST_IMPORT_PUBLIC_KEY=1",
]
defines += [
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=0",
...
...
@@ -98,7 +125,11 @@ hctest_suite("ActsSecurityHichainBasicDeps") {
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=0",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=0",
"TEST_AGREE_SHARED_SECRET=0",
"TEST_BIG_NUM_EXP_MOD=0",
"TEST_GENERATE_KEY_PAIR=0",
"TEST_EXPORT_PUBLIC_KEY=0",
"TEST_ALGORITHM_SIGN=0",
"TEST_ALGORITHM_VERIFY=0",
"TEST_IMPORT_PUBLIC_KEY=0",
]
}
} else {
...
...
security_lite/deviceauth_basic_deps/README.md
0 → 100644
浏览文件 @
0d4e2b02
## wifiiot_hispark_pegasus
1.
compile command:
```
bash
cd test
/xts/tools/lite
./build.sh
product
=
wifiiot
xts
=
acts
target
=
//test/xts/acts/security_lite/deviceauth_basic_deps:ActsSecurityHichainBasicDeps
```
security_lite/deviceauth_basic_deps/deviceauth.gni
浏览文件 @
0d4e2b02
...
...
@@ -40,3 +40,27 @@ DEVICEAUTH_BASIC_DEPS_INC = [
"//base/security/deviceauth/common_lib/interfaces",
"//base/security/deviceauth/interfaces/innerkits",
]
DEVICEAUTH_BASIC_DEPS_ALGORITHM_DEFINES = [
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
"TEST_IMPORT_SYMMETRIC_KEY=1",
"TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=1",
"TEST_HASH_TO_POINT=1",
"TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
"TEST_AGREE_SHARED_SECRET=1",
"TEST_BIG_NUM_EXP_MOD=1",
"TEST_EXPORT_IMPORT_SIGN_VERIFY_ED25519=1",
"TEST_EXPORT_IMPORT_SIGN_VERIFY_P256=1",
"TEST_BIG_NUM_COMPARE=1",
"TEST_GENERATE_KEY_PAIR=1",
"TEST_EXPORT_PUBLIC_KEY=1",
"TEST_ALGORITHM_SIGN=1",
"TEST_ALGORITHM_VERIFY=1",
"TEST_IMPORT_PUBLIC_KEY=1",
"TEST_CHECK_DL_PUBLIC_KEY=1",
"TEST_CHECK_KEY_EXIST=1",
"TEST_DELETE_KEY=1",
"TEST_AES_GCM_ENCRYPT=1",
"TEST_AES_GCM_DECRYPT=1",
]
security_lite/deviceauth_basic_deps/hc_alg_test.c
浏览文件 @
0d4e2b02
此差异已折叠。
点击以展开。
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
浏览文件 @
0d4e2b02
...
...
@@ -372,9 +372,9 @@ enum {
HKDF_PAKE_SHAREDSECRET_DERIVE_UNIONKEY_SALT_LEN
=
16
,
HKDF_PAKE_SHAREDSECRET_DERIVE_UNIONKEY_OUTKEY_LEN
=
48
,
IMPORT_
A
SYMMETRIC_KEY_KEYALIAS_LEN_MAX
=
32
,
IMPORT_
A
SYMMETRIC_KEY_KEYALIAS_LEN_MIN
=
1
,
IMPORT_
A
SYMMETRIC_KEY_AUTHTOKEN_LEN
=
32
,
IMPORT_SYMMETRIC_KEY_KEYALIAS_LEN_MAX
=
32
,
IMPORT_SYMMETRIC_KEY_KEYALIAS_LEN_MIN
=
1
,
IMPORT_SYMMETRIC_KEY_AUTHTOKEN_LEN
=
32
,
};
enum
{
...
...
@@ -623,14 +623,103 @@ enum {
};
enum
{
TEST_IMPORT_
A
SYMMETRIC_KEY_AUTH_ID_LENGTH_32
=
32
,
TEST_IMPORT_
A
SYMMETRIC_KEY_AUTH_ID_LENGTH_64
=
64
,
TEST_IMPORT_SYMMETRIC_KEY_AUTH_ID_LENGTH_32
=
32
,
TEST_IMPORT_SYMMETRIC_KEY_AUTH_ID_LENGTH_64
=
64
,
};
enum
{
TEST_GENERATE_KEY_PAIR_WITH_STORAGE_AUTH_ID_LENGTH
=
32
,
};
// TestExportImportSignVerify
enum
{
TEST_EX_IM_SN_VF_EXTRA_INFO_AUTH_ID_LENGTH
=
32
,
TEST_EX_IM_SN_VF_KEY_ALIAS_LENGTH
=
64
,
TEST_EX_IM_SN_VF_KEY_LENGTH
=
32
,
TEST_EX_IM_SN_VF_OUT_PUB_KEY_LENGTH
=
32
,
TEST_SIGN_MESSAGE_LENGTH_1
=
1
,
TEST_SIGN_MESSAGE_LENGTH_2
=
2
,
TEST_SIGN_MESSAGE_LENGTH_4
=
4
,
TEST_SIGN_MESSAGE_LENGTH_8
=
8
,
TEST_SIGN_MESSAGE_LENGTH_16
=
16
,
TEST_SIGN_MESSAGE_LENGTH_32
=
32
,
TEST_SIGN_MESSAGE_LENGTH_64
=
64
,
TEST_SIGN_MESSAGE_LENGTH_128
=
128
,
TEST_SIGN_MESSAGE_LENGTH_256
=
256
,
TEST_SIGN_MESSAGE_LENGTH_512
=
512
,
TEST_SIGN_MESSAGE_LENGTH_1024
=
1024
,
TEST_SIGN_SIGNATURE_LENGTH
=
64
,
};
static
const
uint32_t
TEST_SIGN_MSG_LENGTHES
[]
=
{
TEST_SIGN_MESSAGE_LENGTH_1
,
TEST_SIGN_MESSAGE_LENGTH_2
,
TEST_SIGN_MESSAGE_LENGTH_4
,
TEST_SIGN_MESSAGE_LENGTH_8
,
TEST_SIGN_MESSAGE_LENGTH_16
,
TEST_SIGN_MESSAGE_LENGTH_32
,
TEST_SIGN_MESSAGE_LENGTH_64
,
TEST_SIGN_MESSAGE_LENGTH_128
,
TEST_SIGN_MESSAGE_LENGTH_256
,
TEST_SIGN_MESSAGE_LENGTH_512
,
TEST_SIGN_MESSAGE_LENGTH_1024
,
};
static
const
char
TEST_EXPORT_DIFFERENT_ERROR_MESSAGE
[]
=
"two different public keys are exported"
;
// g_largePrimeNumberHex384 and g_largePrimeNumberHex256 are from
// base/security/deviceauth/services/protocol/src/pake_protocol/pake_protocol_dl_common/pake_protocol_dl_common.c
static
const
char
LARGE_PRIME_NUM_HEX_384
[]
=
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74"
"020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437"
"4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"
"EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05"
"98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB"
"9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
"E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718"
"3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33"
"A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7"
"ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864"
"D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E2"
"08E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"
;
static
const
char
LARGE_PRIME_NUM_HEX_256
[]
=
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74"
"020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437"
"4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"
"EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05"
"98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB"
"9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
"E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718"
"3995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF"
;
enum
{
PAKE_DL_PRIME_LEN_256
=
256
,
PAKE_DL_PRIME_LEN_384
=
384
,
};
enum
{
TEST_CHECK_DL_VALUE_ONE
=
1
,
TEST_CHECK_DL_VALUE_TWO
=
2
,
};
enum
{
TEST_BIG_NUM_COMPARE_NUM_LENGTH_FULL
=
32
,
TEST_BIG_NUM_COMPARE_NUM_LENGTH_HALF
=
TEST_BIG_NUM_COMPARE_NUM_LENGTH_FULL
/
2
,
// 16
};
static
const
uint8_t
TEST_BIG_NUM_COMPARE_NUM_EXAMPLE_FULL
[
TEST_BIG_NUM_COMPARE_NUM_LENGTH_FULL
]
=
{
/* */
/* */
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
};
static
const
uint8_t
TEST_BIG_NUM_COMPARE_NUM_EXAMPLE_HALF
[
TEST_BIG_NUM_COMPARE_NUM_LENGTH_HALF
]
=
{
/* */
/* */
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xab
,
0xcd
,
0xef
,
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
};
#ifdef __cplusplus
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录