未验证 提交 585dba0f 编写于 作者: O openharmony_ci 提交者: Gitee

!4328 【openharmony-3.2beta2】【安全子系统】huks删除HuksAbnormalTest与HuksAlgCompletionTest测试套

Merge pull request !4328 from yuanyuhang/beta2_20220714_1
...@@ -19,7 +19,6 @@ group("security") { ...@@ -19,7 +19,6 @@ group("security") {
deps = [ deps = [
"access_token/AccessTokenTest_Normal_js:ActsAccessTokenApiJSNormalTest", "access_token/AccessTokenTest_Normal_js:ActsAccessTokenApiJSNormalTest",
"cipher/datacipher:datacipher", "cipher/datacipher:datacipher",
"huks_standard",
"security_huks_basic", "security_huks_basic",
] ]
} }
......
# 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.
import("//build/ohos_var.gni")
group("huks_standard") {
testonly = true
if (is_standard_system) {
deps = [
"HuksAbnormalTest:ActsHuksAbnormalTest",
"HuksAlgCompletionTest:ActsHuksAlgCompletionTest",
]
}
}
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsHuksAbnormalTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsHuksAbnormalTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for algorithm completion test",
"driver": {
"type": "JSUnitTest",
"test-timeout": "7200000",
"package": "com.example.err",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsHuksAbnormalTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.err",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.err",
"name": ".MyApplication",
"mainAbility": "com.example.err.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.err.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "singleton",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("../../common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (C) 2022 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.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2022 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.
*/
import file from '@system.file';
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index';
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
const reportExtend = new ReportExtend(file);
core.addService('expect', expectExtend);
core.addService('report', reportExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 1000000;
configService.setConfig(this);
require('../../../test/hks_abnormal_testList.test.js');
core.execute();
}
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* 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.
*/
import hks from '@ohos.security.huks'
import { describe, it, expect } from 'deccjsunit/index'
import {
alias,
} from '../../../../../../hks_xts_common.test'
import {
generateAgreeKeyOption,
hmacGenerateKeyOption,
agreeInvalidAlgOption,
hmacInvalidPurposeOption,
} from './hks_abnormal_common.test.js'
describe('Hks_Abnormal_Callback_Part5', function () {
async function hmacGenerateKey() {
var option = hmacGenerateKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
};
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39100
* @tc.name InvalidAlgorithmAlgRsaForAgreeKeyCallback
* @tc.desc Invalid algorithm alg rsa for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39100', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_RSA);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39200
* @tc.name InvalidAlgorithmAlgEccForAgreeKeyCallback
* @tc.desc Invalid algorithm alg ecc for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39200', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_ECC);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39300
* @tc.name InvalidAlgorithmAlgDsaForAgreeKeyCallback
* @tc.desc Invalid algorithm alg dsa for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39300', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_DSA);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39400
* @tc.name InvalidAlgorithmAlgAesForAgreeKeyCallback
* @tc.desc Invalid algorithm alg aes for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39400', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_AES);
agreeOption.properties[1].value = hks.HuksKeySize.HUKS_ECC_KEY_SIZE_256;
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_KEY_INFO);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39500
* @tc.name InvalidAlgorithmAlgHmacForAgreeKeyCallback
* @tc.desc Invalid algorithm alg hmac for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39500', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_HMAC);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39600
* @tc.name InvalidAlgorithmAlgHkdfForAgreeKeyCallback
* @tc.desc Invalid algorithm alg hkdf for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39600', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_HKDF);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39700
* @tc.name InvalidAlgorithmAlgPbkdf2ForAgreeKeyCallback
* @tc.desc Invalid algorithm alg pbkdf2 for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39700', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_PBKDF2);
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_ALGORITHM);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39800
* @tc.name InvalidAlgorithmAlgEd25519ForAgreeKeyCallback
* @tc.desc Invalid algorithm alg ed25519 for agree key callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39800', 0, async function (done) {
var option = generateAgreeKeyOption();
var ret = await hks.generateKey(alias, option);
expect(ret.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var exportKeyRet = await hks.exportKey(alias, option);
expect(exportKeyRet.errorCode).assertEqual(hks.HuksErrorCode.HUKS_SUCCESS);
var agreeOption = agreeInvalidAlgOption(hks.HuksKeyAlg.HUKS_ALG_ED25519);
agreeOption.properties[1].value = hks.HuksKeySize.HUKS_ECC_KEY_SIZE_256;
agreeOption.inData = exportKeyRet.outData
hks.agreeKey(alias, agreeOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_KEY_INFO);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_39900
* @tc.name InvalidPurposeEncryptForMacCallback
* @tc.desc Invalid purpose encrypt for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_39900', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT, hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40000
* @tc.name InvalidPurposeDecryptForMacCallback
* @tc.desc Invalid purpose decrypt for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40000', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40100
* @tc.name InvalidPurposeSignForMacCallback
* @tc.desc Invalid purpose sign for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40100', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40200
* @tc.name InvalidPurposeVerifyForMacCallback
* @tc.desc Invalid purpose verify for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40200', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_VERIFY,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40300
* @tc.name InvalidPurposeDeriveForMacCallback
* @tc.desc Invalid purpose derive for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40300', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DERIVE,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40400
* @tc.name InvalidPurposeWrapForMacCallback
* @tc.desc Invalid purpose wrap for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40400', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_WRAP,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40500
* @tc.name InvalidPurposeUnwrapForMacCallback
* @tc.desc Invalid purpose unwrap for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40500', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_UNWRAP,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40600
* @tc.name InvalidPurposeAgreeForMacCallback
* @tc.desc Invalid purpose agree for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40600', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_AGREE,
hks.HuksKeyDigest.HUKS_DIGEST_SHA1);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_PURPOSE);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40700
* @tc.name InvalidDigestNoneForMacCallback
* @tc.desc Invalid digest none for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40700', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_MAC,
hks.HuksKeyDigest.HUKS_DIGEST_NONE);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_DIGEST);
done();
});
});
/**
* @tc.number HUKS_ABNORMAL_CALLBACK_40800
* @tc.name InvalidDigestMd5ForMacCallback
* @tc.desc Invalid digest md5 for mac callback.
*/
it('HUKS_ABNORMAL_CALLBACK_40800', 0, async function (done) {
await hmacGenerateKey();
var macOption = hmacInvalidPurposeOption(
hks.HuksKeyPurpose.HUKS_KEY_PURPOSE_MAC,
hks.HuksKeyDigest.HUKS_DIGEST_MD5);
hks.mac(alias, macOption, function (err, data) {
expect(data.errorCode).assertEqual(hks.HuksErrorCode.HUKS_ERROR_INVALID_DIGEST);
done();
});
});
});
/*
* 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.
*/
require('./hks_abnormal_promise_part1.test.js');
require('./hks_abnormal_promise_part2.test');
require('./hks_abnormal_promise_part3.test');
require('./hks_abnormal_promise_part4.test');
require('./hks_abnormal_promise_part5.test');
require('./hks_abnormal_promise_part6.test');
require('./hks_abnormal_callback_part1.test.js');
require('./hks_abnormal_callback_part2.test');
require('./hks_abnormal_callback_part3.test');
require('./hks_abnormal_callback_part4.test');
require('./hks_abnormal_callback_part5.test');
require('./hks_abnormal_callback_part6.test');
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsHuksAlgCompletionTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsHuksAlgCompletionTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for algorithm completion test",
"driver": {
"type": "JSUnitTest",
"test-timeout": "26000000",
"package": "com.example.hksxtstest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsHuksAlgCompletionTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册