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

!6808 huks派生接口参数新增

Merge pull request !6808 from yuanyuhang/cherry-pick-1670379814
......@@ -53,7 +53,8 @@ describe('SecurityHuksHKDFBasicAbort63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksHKDFBasicFinish63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksPBKDF2BasicAbort63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksPBKDF2BasicFinish63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -54,7 +54,8 @@ describe('SecurityHuksDeriveHKDFBasicAbort63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksDeriveHKDFBasicFinish63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksDerivePBKDF2BasicAbort63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -54,7 +54,8 @@ describe('SecurityHuksDerivePBKDF2BasicFinish63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -175,18 +175,20 @@ function deleteKey(srcKeyAlies, HuksOptions) {
});
}
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, thirdInderfaceName) {
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, deriveArray, thirdInderfaceName) {
try {
await publicDeriveGenFunc(srcKeyAlies, HuksOptions);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgHKDF);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
let deriveArrAlg = HuksOptions.properties[0];
let deriveArrLen = HuksOptions.properties[3];
HuksOptions.properties.splice(0, 1, deriveArray[0]);
HuksOptions.properties.splice(3, 1, deriveArray[1]);
await publicDeriveInitFunc(srcKeyAlies, HuksOptions);
await publicDeriveUpdateFunc(HuksOptions);
await publicDeriveFinishAbortFunc(huksOptionsFinish, thirdInderfaceName);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgAES);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyHKDFSize128);
HuksOptions.properties.splice(0, 1, deriveArrAlg);
HuksOptions.properties.splice(3, 1, deriveArrLen);
await publicDeriveDeleteFunc(srcKeyAlies, HuksOptions);
} catch (e) {
expect(null).assertFail();
......
......@@ -100,22 +100,24 @@ async function publicDeriveDeleteFunc(srcKeyAlies, HuksOptions) {
});
}
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, thirdInderfaceName) {
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, deriveArray, thirdInderfaceName) {
try {
await publicDeriveGenFunc(srcKeyAlies, HuksOptions);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgHKDF);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
let deriveArrAlg = HuksOptions.properties[0];
let deriveArrLen = HuksOptions.properties[3];
HuksOptions.properties.splice(0, 1, deriveArray[0]);
HuksOptions.properties.splice(3, 1, deriveArray[1]);
await publicDeriveInitFunc(srcKeyAlies, HuksOptions);
await publicDeriveUpdateFunc(HuksOptions);
await publicDeriveFinishAbortFunc(huksOptionsFinish, thirdInderfaceName);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgAES);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyHKDFSize128);
HuksOptions.properties.splice(0, 1, deriveArrAlg);
HuksOptions.properties.splice(3, 1, deriveArrLen);
await publicDeriveDeleteFunc(srcKeyAlies, HuksOptions);
} catch (e) {
expect(null).assertFail();
}
}
export { publicDeriveFunc };
export { publicDeriveFunc };
\ No newline at end of file
......@@ -53,7 +53,8 @@ describe('SecurityHuksHKDFBasicAbort63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksHKDFBasicFinish63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksPBKDF2BasicAbort63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksPBKDF2BasicFinish63KBCallbackJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -54,7 +54,8 @@ describe('SecurityHuksDeriveHKDFBasicAbort63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksDeriveHKDFBasicFinish63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDeriveHKDF.HuksKeyAlgHKDF,HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -53,7 +53,8 @@ describe('SecurityHuksDerivePBKDF2BasicAbort63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'abort');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'abort');
done();
});
});
......
......@@ -54,7 +54,8 @@ describe('SecurityHuksDerivePBKDF2BasicFinish63KBPromiseJsunit', function () {
),
inData: srcData63Kb,
};
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, 'finish');
let deriveArray = new Array(HuksDerivePBKDF2.HuksKeyAlgPBKDF2,HuksDerivePBKDF2.HuksKeyDERIVEKEYSIZE);
await publicDeriveFunc(srcKeyAliesFirst, HuksOptions63kb, huksOptionsFinish, deriveArray, 'finish');
done();
});
});
......
......@@ -221,18 +221,20 @@ function deleteKeyItem(srcKeyAlies, HuksOptions) {
});
}
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, thirdInderfaceName) {
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, deriveArray, thirdInderfaceName) {
try {
await publicDeriveGenFunc(srcKeyAlies, HuksOptions);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgHKDF);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
let deriveArrAlg = HuksOptions.properties[0];
let deriveArrLen = HuksOptions.properties[3];
HuksOptions.properties.splice(0, 1, deriveArray[0]);
HuksOptions.properties.splice(3, 1, deriveArray[1]);
await publicDeriveInitFunc(srcKeyAlies, HuksOptions);
await publicDeriveUpdateFunc(HuksOptions);
await publicDeriveFinishAbortFunc(huksOptionsFinish, thirdInderfaceName);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgAES);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyHKDFSize128);
HuksOptions.properties.splice(0, 1, deriveArrAlg);
HuksOptions.properties.splice(3, 1, deriveArrLen);
await publicDeriveDeleteFunc(srcKeyAlies, HuksOptions);
} catch (e) {
expect(null).assertFail();
......
......@@ -124,18 +124,20 @@ async function publicDeriveDeleteFunc(srcKeyAlies, HuksOptions) {
}
}
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, thirdInderfaceName) {
async function publicDeriveFunc(srcKeyAlies, HuksOptions, huksOptionsFinish, deriveArray, thirdInderfaceName) {
try {
await publicDeriveGenFunc(srcKeyAlies, HuksOptions);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgHKDF);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyDERIVEKEYSIZE);
let deriveArrAlg = HuksOptions.properties[0];
let deriveArrLen = HuksOptions.properties[3];
HuksOptions.properties.splice(0, 1, deriveArray[0]);
HuksOptions.properties.splice(3, 1, deriveArray[1]);
await publicDeriveInitFunc(srcKeyAlies, HuksOptions);
await publicDeriveUpdateFunc(HuksOptions);
await publicDeriveFinishAbortFunc(huksOptionsFinish, thirdInderfaceName);
HuksOptions.properties.splice(0, 1, paramPublic.HuksDeriveHKDF.HuksKeyAlgAES);
HuksOptions.properties.splice(3, 1, paramPublic.HuksDeriveHKDF.HuksKeyHKDFSize128);
HuksOptions.properties.splice(0, 1, deriveArrAlg);
HuksOptions.properties.splice(3, 1, deriveArrLen);
await publicDeriveDeleteFunc(srcKeyAlies, HuksOptions);
} catch (e) {
expect(null).assertFail();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册