未验证 提交 05b521e7 编写于 作者: O openharmony_ci 提交者: Gitee

!9027 【OpenHarmony 4.0.8.2】【安全子系统】【master】huks XTS Adapter

Merge pull request !9027 from qiaozzzh/0619_1
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import huks from "@ohos.security.huks";
import { describe, it, expect } from "@ohos/hypium";
import { describe, it, expect, beforeAll } from "@ohos/hypium";
import Data from '../../../../../../utils/data.json';
import {
stringToUint8Array,
......@@ -56,7 +56,7 @@ let handle;
let IV = '0000000000000000';
let IVErr = '00000000000000000000000000000000000000000000000000000000000000000000';
let AAD = '0000000000000000';
let NONCE = '00000000000';
let NONCE = '000000000000';
let AEAD = '0000000000000000';
let useSoftware = true;
......@@ -239,7 +239,7 @@ async function publicExportFunc(srcKeyAlies, HuksOptions) {
export default function SecurityHuksRSASignExtendJsunit() {
describe('SecurityHuksRSASignExtendJsunit', function () {
beforeAll(async function (done) {
useSoftware = checkSoftware();
useSoftware = await checkSoftware();
done();
})
......
......@@ -68,17 +68,14 @@ async function checkSoftware() {
HuksSignVerifyDSA.HuksTagDSADigestSHA256
)
};
try {
let res = await huks.generateKeyItem(dsaAlies, dsaOption);
if (res == null) {
await huks.deleteKeyItem(dsaAlies, dsaOption);
console.error("This device uses software");
return true;
} else {
console.error("This device does not use software");
return false;
}
} catch (e) {
let res = await huks.generateKey(dsaAlies, dsaOption);
console.log(`test generate:${JSON.stringify(res)}`);
if (res.errorCode == 0) {
await huks.deleteKey(dsaAlies, dsaOption);
console.error("This device uses software");
return true;
} else {
console.error("This device does not use software");
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册