Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8280c55a
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看板
提交
8280c55a
编写于
12月 21, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1216 设备认证依赖算法测试用例
Merge pull request !1216 from code4lala/master
上级
40a4fde7
fd279506
变更
10
展开全部
显示空白变更内容
内联
并排
Showing
10 changed file
with
1763 addition
and
1 deletion
+1763
-1
security/deviceauth/deviceauth_basic_deps/BUILD.gn
security/deviceauth/deviceauth_basic_deps/BUILD.gn
+10
-0
security/deviceauth/deviceauth_basic_deps/device_auth_test.cpp
...ity/deviceauth/deviceauth_basic_deps/device_auth_test.cpp
+13
-0
security/deviceauth/deviceauth_basic_deps/hc_alg_test.cpp
security/deviceauth/deviceauth_basic_deps/hc_alg_test.cpp
+1
-0
security/deviceauth/deviceauth_basic_deps/hctest.h
security/deviceauth/deviceauth_basic_deps/hctest.h
+4
-0
security_lite/deviceauth_basic_deps/BUILD.gn
security_lite/deviceauth_basic_deps/BUILD.gn
+28
-0
security_lite/deviceauth_basic_deps/deviceauth.gni
security_lite/deviceauth_basic_deps/deviceauth.gni
+8
-1
security_lite/deviceauth_basic_deps/hc_alg_test.c
security_lite/deviceauth_basic_deps/hc_alg_test.c
+1019
-0
security_lite/deviceauth_basic_deps/hc_alg_test.h
security_lite/deviceauth_basic_deps/hc_alg_test.h
+29
-0
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
+638
-0
security_lite/deviceauth_basic_deps/test.c
security_lite/deviceauth_basic_deps/test.c
+13
-0
未找到文件。
security/deviceauth/deviceauth_basic_deps/BUILD.gn
浏览文件 @
8280c55a
...
...
@@ -38,6 +38,7 @@ DEVICEAUTH_BASIC_DEPS_CPP_SOURCE = [
"${DEVICEAUTH_BASIC_DEPS_CPP_DIR}/hc_file_iot_flash_test.cpp",
"${DEVICEAUTH_BASIC_DEPS_CPP_DIR}/hc_time_test.cpp",
"${DEVICEAUTH_BASIC_DEPS_CPP_DIR}/hc_file_common.cpp",
"${DEVICEAUTH_BASIC_DEPS_CPP_DIR}/hc_alg_test.cpp",
]
ohos_moduletest_suite("ActsDeviceAuthBasicDepsTest") {
...
...
@@ -84,5 +85,14 @@ ohos_moduletest_suite("ActsDeviceAuthBasicDepsTest") {
"UTILS_FILE_IMPLEMENTED=0",
"TEST_PTHREAD_CREATE_DETACHED=1",
"TEST_HC_FILE_OPEN_SERIES=1",
"TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
"TEST_IMPORT_ASYMMETRIC_KEY=0",
"TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=0",
"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",
]
}
security/deviceauth/deviceauth_basic_deps/device_auth_test.cpp
浏览文件 @
8280c55a
...
...
@@ -21,6 +21,7 @@
#include <cstring>
#include <ctime>
#include "hc_alg_test.h"
#include "hc_condition_test.h"
#include "hc_dev_info_test.h"
#include "hc_file_f_test.h"
...
...
@@ -186,4 +187,16 @@ HWTEST_F(DeviceAuthTest, TestCaseHcTime, TestSize.Level1)
TestHcTime
();
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
}
/**
* @tc.name: DeviceAuthTest.TestCaseHcAlg
* @tc.desc:
* @tc.type: FUNC
*/
HWTEST_F
(
DeviceAuthTest
,
TestCaseHcAlg
,
TestSize
.
Level1
)
{
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
TestHcAlg
();
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
}
}
// namespace
security/deviceauth/deviceauth_basic_deps/hc_alg_test.cpp
0 → 120000
浏览文件 @
8280c55a
..
/
..
/
..
/
security_lite
/
deviceauth_basic_deps
/
hc_alg_test
.
c
\ No newline at end of file
security/deviceauth/deviceauth_basic_deps/hctest.h
浏览文件 @
8280c55a
...
...
@@ -24,6 +24,9 @@
#define TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements) \
EXPECT_THAT(std::vector<uint8_t>((actual), (actual) + (num_elements)), \
::testing::ElementsAreArray((expected), (num_elements)))
#define TEST_ASSERT_EQUAL_HEX8_ARRAY_MESSAGE(expected, actual, num_elements, message) \
EXPECT_THAT(std::vector<uint8_t>((actual), (actual) + (num_elements)), \
::testing::ElementsAreArray((expected), (num_elements))) << (message)
#define TEST_ASSERT_EQUAL(expected, actual) EXPECT_EQ((actual), (expected))
#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) EXPECT_EQ((actual), (expected)) << (message)
#define TEST_ASSERT_EQUAL_STRING(expected, actual) EXPECT_STREQ((actual), (expected))
...
...
@@ -35,6 +38,7 @@
#define TEST_ASSERT_NOT_EQUAL(expected, actual) EXPECT_NE((actual), (expected))
#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) EXPECT_NE((actual), (expected)) << (message)
#define TEST_ASSERT_NOT_NULL(pointer) EXPECT_NE((pointer), nullptr)
#define TEST_ASSERT_NULL(pointer) EXPECT_EQ((pointer), nullptr)
#define TEST_ASSERT_TRUE(condition) EXPECT_TRUE((condition))
#define TEST_ASSERT_TRUE_MESSAGE(condition, message) EXPECT_TRUE((condition)) << (message)
...
...
security_lite/deviceauth_basic_deps/BUILD.gn
浏览文件 @
8280c55a
...
...
@@ -50,9 +50,21 @@ 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",
]
if (defined(ohos_lite)) {
include_dirs += [
"//base/security/deviceauth/deps_adapter/os_adapter/interfaces/liteos",
]
if (ohos_kernel_type == "liteos_m") {
# liteos m
include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ]
...
...
@@ -72,6 +84,22 @@ hctest_suite("ActsSecurityHichainBasicDeps") {
}
if (board_name == "hispark_pegasus") {
# 3861
defines -= [
"TEST_HKDF_WITH_KEY_ALIAS_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 += [
"TEST_HKDF_WITH_KEY_ALIAS_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_BIG_NUM_EXP_MOD=0",
]
}
} else {
#liteos a or L1 linux
...
...
security_lite/deviceauth_basic_deps/deviceauth.gni
浏览文件 @
8280c55a
...
...
@@ -27,9 +27,16 @@ DEVICEAUTH_BASIC_DEPS_SOURCE = [
"${DEVICEAUTH_BASIC_DEPS_DIR}/hc_file_iot_flash_test.c",
"${DEVICEAUTH_BASIC_DEPS_DIR}/hc_time_test.c",
"${DEVICEAUTH_BASIC_DEPS_DIR}/hc_file_common.c",
"${DEVICEAUTH_BASIC_DEPS_DIR}/hc_alg_test.c",
]
DEVICEAUTH_BASIC_DEPS_INC = [
"//base/iot_hardware/peripheral/interfaces/kits",
"//utils/native/lite/include", # utils_file.h
"//utils/native/lite/include", # utils_file.h ohos_types.h
# alg test
"//base/security/deviceauth/deps_adapter/key_management_adapter/interfaces",
"//base/security/deviceauth/deps_adapter/os_adapter/interfaces",
"//base/security/deviceauth/common_lib/interfaces",
"//base/security/deviceauth/interfaces/innerkits",
]
security_lite/deviceauth_basic_deps/hc_alg_test.c
0 → 100644
浏览文件 @
8280c55a
此差异已折叠。
点击以展开。
security_lite/deviceauth_basic_deps/hc_alg_test.h
0 → 100644
浏览文件 @
8280c55a
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef HC_ALG_TEST_H
#define HC_ALG_TEST_H
#ifdef __cplusplus
extern
"C"
{
#endif
void
TestHcAlg
(
void
);
#ifdef __cplusplus
}
#endif
#endif // HC_ALG_TEST_H
security_lite/deviceauth_basic_deps/hc_alg_test_case.h
0 → 100644
浏览文件 @
8280c55a
此差异已折叠。
点击以展开。
security_lite/deviceauth_basic_deps/test.c
浏览文件 @
8280c55a
...
...
@@ -22,6 +22,7 @@
#include <string.h>
#include <time.h>
#include "hc_alg_test.h"
#include "hc_condition_test.h"
#include "hc_dev_info_test.h"
#include "hc_file_f_test.h"
...
...
@@ -169,4 +170,16 @@ LITE_TEST_CASE(DeviceAuthBasicDepsTestSuite, TestCaseHcTime, Function | SmallTes
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
}
/**
* @tc.name: DeviceAuthBasicDepsTestSuite.TestCaseHcAlg
* @tc.desc:
* @tc.type: FUNC
*/
LITE_TEST_CASE
(
DeviceAuthBasicDepsTestSuite
,
TestCaseHcAlg
,
Function
|
SmallTest
|
Level1
)
{
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
TestHcAlg
();
LOGI
(
"++++++++++++++++++++++++++++++++++++++++
\n
"
);
}
RUN_TEST_SUITE
(
DeviceAuthBasicDepsTestSuite
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录