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

!6141 补充覆盖

Merge pull request !6141 from 伞木希美/master
......@@ -94,6 +94,7 @@ async function publicInitFunc(srcKeyAlies, HuksOptions) {
.then((data) => {
console.info(`promise: doInit success, data = ${JSON.stringify(data)}`);
handle = data.handle;
expect(data.challenge == undefined).assertTrue();
})
.catch(error => {
console.error(`promise: doInit key failed, code: ${error.code}, msg: ${error.message}`);
......
......@@ -20,26 +20,6 @@ let challenge = stringToUint8Array("challenge_data");
let versionInfo = stringToUint8Array("version_info");
let keyAliasString = "key attest";
function attestKey(srcKeyAlies, HuksOptions) {
return new Promise((resolve, reject) => {
huks.attestKey(srcKeyAlies, HuksOptions, function (err, data) {
try {
if (err.code !== 0) {
console.log(
"test generateKey err information: " + JSON.stringify(err)
);
reject(err);
} else {
resolve(data);
}
} catch (e) {
console.log("test generateKey err information: " + JSON.stringify(e));
reject(e);
}
});
});
}
function publicAttestKey(srcKeyAlies, HuksOptions) {
return new Promise((resolve, reject) => {
try {
......@@ -417,6 +397,7 @@ export default function SecurityHuksFaceFingerNormalJsunit() {
await huks.attestKeyItem(aliasString, options)
.then((data) => {
console.info(`promise: attestKeyItem success, data = ${JSON.stringify(data)}`);
expect(data.certChains != null).assertTrue();
})
.catch(error => {
console.error(`promise: attestKeyItem failed, code: ${error.code}, msg: ${error.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册