diff --git a/security/huks_napi_BasicTest/include/huks_agree_dh_test.h b/security/huks_napi_BasicTest/include/huks_agree_dh_test.h index bd8e95045670faa71022d9366383ae4d3f7fa9cd..ca98b28533069e224e8e035a1c916e38d529ae5e 100644 --- a/security/huks_napi_BasicTest/include/huks_agree_dh_test.h +++ b/security/huks_napi_BasicTest/include/huks_agree_dh_test.h @@ -65,7 +65,7 @@ static struct OH_Huks_Param g_agreeParams01Init001[] = { .uint32Param = OH_HUKS_KEY_PURPOSE_AGREE }, { .tag = OH_HUKS_TAG_KEY_SIZE, - .uint32Param = OH_HUKS_DH_KEY_SIZE_2048 + .uint32Param = OH_HUKS_AES_KEY_SIZE_256 } }; static struct OH_Huks_Param g_agreeParams01Finish001[] = { @@ -107,7 +107,7 @@ static struct OH_Huks_Param g_agreeParams02Init001[] = { .uint32Param = OH_HUKS_KEY_PURPOSE_AGREE }, { .tag = OH_HUKS_TAG_KEY_SIZE, - .uint32Param = OH_HUKS_DH_KEY_SIZE_2048 + .uint32Param = OH_HUKS_AES_KEY_SIZE_256 } }; static struct OH_Huks_Param g_agreeParams02Finish001[] = { diff --git a/security/huks_napi_BasicTest/src/huks_derive_hkdf_test.cpp b/security/huks_napi_BasicTest/src/huks_derive_hkdf_test.cpp index 298bbbda0f29e9c41e45a8ab18ffac74b9ed492e..639650c5c567d04e494237001149c9a2b85ab05a 100644 --- a/security/huks_napi_BasicTest/src/huks_derive_hkdf_test.cpp +++ b/security/huks_napi_BasicTest/src/huks_derive_hkdf_test.cpp @@ -89,10 +89,10 @@ static struct OH_Huks_Param g_hkdfFinishParams001[] = { } }, { .tag = OH_HUKS_TAG_ALGORITHM, - .uint32Param = OH_HUKS_ALG_HKDF + .uint32Param = OH_HUKS_ALG_AES }, { .tag = OH_HUKS_TAG_KEY_SIZE, - .uint32Param = DERIVE_KEY_SIZE_32 + .uint32Param = 256 }, { .tag = OH_HUKS_TAG_PURPOSE, .uint32Param = OH_HUKS_KEY_PURPOSE_DERIVE diff --git a/security/huks_napi_BasicTest/src/huks_derive_pbkdf_test.cpp b/security/huks_napi_BasicTest/src/huks_derive_pbkdf_test.cpp index 0a940741c55f86c95f769a32f0db8372e6cf7bd3..98b7809f1c53f82b71847acd58d3103fbee183cb 100644 --- a/security/huks_napi_BasicTest/src/huks_derive_pbkdf_test.cpp +++ b/security/huks_napi_BasicTest/src/huks_derive_pbkdf_test.cpp @@ -118,7 +118,7 @@ static struct OH_Huks_Param g_pbkdf2FinishParams001[] = { .uint32Param = OH_HUKS_ALG_AES }, { .tag = OH_HUKS_TAG_KEY_SIZE, - .uint32Param = DERIVE_KEY_SIZE_32 + .uint32Param = 256 }, { .tag = OH_HUKS_TAG_PURPOSE, .uint32Param = OH_HUKS_KEY_PURPOSE_DERIVE diff --git a/security/security_huks_basic/utils/param/agree/publicAgreeCallback.js b/security/security_huks_basic/utils/param/agree/publicAgreeCallback.js index ff46f4992882c0489152aad0f64c2d7aa6d7db2c..8876658557d013fad56b2263bd6b8c874f992480 100644 --- a/security/security_huks_basic/utils/param/agree/publicAgreeCallback.js +++ b/security/security_huks_basic/utils/param/agree/publicAgreeCallback.js @@ -234,7 +234,10 @@ async function publicAgreeFunc( HuksOptions.properties.splice(5, 1); } - await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptions); + let HuksOptionsInit = JSON.parse(JSON.stringify(HuksOptions)); + HuksOptionsInit.properties.splice(2,1,HuksOptionsFinish.properties[3]) + + await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 1); await publicAgreeFinishAbortFunc(HuksOptionsFinish, thirdInderfaceName); @@ -245,7 +248,7 @@ async function publicAgreeFunc( value: stringToUint8Array(srcKeyAliesSecond + 'final'), }); - await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptions); + await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 2); await publicAgreeFinishAbortFunc(HuksOptionsFinishSecond, thirdInderfaceName); diff --git a/security/security_huks_basic/utils/param/agree/publicAgreePromise.js b/security/security_huks_basic/utils/param/agree/publicAgreePromise.js index 77ac2679780d1099744ebb4d74b23c2c2b86e085..15466eb44f383b17ce98663ed3fa7ac4c7a75a71 100644 --- a/security/security_huks_basic/utils/param/agree/publicAgreePromise.js +++ b/security/security_huks_basic/utils/param/agree/publicAgreePromise.js @@ -148,7 +148,10 @@ async function publicAgreeFunc( HuksOptions.properties.splice(5, 1); } - await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptions); + let HuksOptionsInit = JSON.parse(JSON.stringify(HuksOptions)); + HuksOptionsInit.properties.splice(2,1,HuksOptionsFinish.properties[3]) + + await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 1); await publicAgreeFinishAbortFunc(HuksOptionsFinish, thirdInderfaceName); @@ -159,7 +162,7 @@ async function publicAgreeFunc( value: stringToUint8Array(srcKeyAliesSecond + 'final'), }); - await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptions); + await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 2); await publicAgreeFinishAbortFunc(HuksOptionsFinishSecond, thirdInderfaceName); diff --git a/security/security_huks_reformed_test/huks_agree_promise_BasicTest/src/main/js/test/Agree/SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit.test.js b/security/security_huks_reformed_test/huks_agree_promise_BasicTest/src/main/js/test/Agree/SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit.test.js index 13d5f6a5ed62de419f6db5e479e128fa9b700441..417ddfc22de5357f4b32cc56a4e3445665b3cba5 100644 --- a/security/security_huks_reformed_test/huks_agree_promise_BasicTest/src/main/js/test/Agree/SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit.test.js +++ b/security/security_huks_reformed_test/huks_agree_promise_BasicTest/src/main/js/test/Agree/SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit.test.js @@ -51,10 +51,10 @@ function makehuksOptionsFinish(srcKeyAliesFirst){ function makehuksOptionsDerive(srcKeyAliesFirst){ let huksOptionsFinish = { properties: new Array( - HuksAgreeDH.HuksKeyALGORITHMAES, - HuksAgreeDH.HuksKeySIZE256, + HuksAgreeDH.HuksKeyALGORITHMAES, HuksAgreeDH.HuksKeyPurposeDERIVE, HuksAgreeDH.HuksKeyDIGESTSHA256, + HuksAgreeDH.HuksKeySIZE256, HuksAgreeDH.HuksKeyPADDINGNONE, HuksAgreeDH.HuksKeyBLOCKMODEECB, { @@ -73,9 +73,9 @@ function makehuksOptionsHmac(srcKeyAliesFirst){ let huksOptionsFinish = { properties: new Array( HuksAgreeDH.HuksKeyALGORITHMHMAC, - HuksAgreeDH.HuksKeySIZE256, HuksAgreeDH.HuksKeyPurposeMAC, HuksAgreeDH.HuksKeyDIGESTSHA256, + HuksAgreeDH.HuksKeySIZE256, HuksAgreeDH.HuksKeyPADDINGNONE, HuksAgreeDH.HuksKeyBLOCKMODEECB, { diff --git a/security/security_huks_reformed_test/utils/param/agree/publicAgreeCallback.js b/security/security_huks_reformed_test/utils/param/agree/publicAgreeCallback.js index caec68c4ec67f08e230ed96442f01ec0abc32d93..40446c84580ab062289bea804a37295659ce7d37 100644 --- a/security/security_huks_reformed_test/utils/param/agree/publicAgreeCallback.js +++ b/security/security_huks_reformed_test/utils/param/agree/publicAgreeCallback.js @@ -272,6 +272,7 @@ async function publicAgreeFunc( thirdInderfaceName ) { try { + await publicAgreeGenFunc(srcKeyAliesFrist, HuksOptions); await publicAgreeGenFunc(srcKeyAliesSecond, HuksOptions); await publicAgreeExport1Func(srcKeyAliesFrist, HuksOptions, 1); @@ -284,7 +285,10 @@ async function publicAgreeFunc( HuksOptions.properties.splice(5, 1); } - await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptions); + let HuksOptionsInit = JSON.parse(JSON.stringify(HuksOptions)); + HuksOptionsInit.properties.splice(2,1,HuksOptionsFinish.properties[3]) + + await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 1); await publicAgreeFinishAbortFunc(HuksOptionsFinish, thirdInderfaceName); @@ -295,7 +299,7 @@ async function publicAgreeFunc( value: stringToUint8Array(srcKeyAliesSecond + 'final'), }); - await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptions); + await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 2); await publicAgreeFinishAbortFunc(HuksOptionsFinishSecond, thirdInderfaceName); diff --git a/security/security_huks_reformed_test/utils/param/agree/publicAgreePromise.js b/security/security_huks_reformed_test/utils/param/agree/publicAgreePromise.js index 1d17c5ed0ae3426e7561c321eb43b1093f84bd44..a3b633bf421874eaf59e235efae9146f88a80421 100644 --- a/security/security_huks_reformed_test/utils/param/agree/publicAgreePromise.js +++ b/security/security_huks_reformed_test/utils/param/agree/publicAgreePromise.js @@ -166,6 +166,7 @@ async function publicAgreeFunc( thirdInderfaceName ) { try { + await publicAgreeGenFunc(srcKeyAliesFrist, HuksOptions); await publicAgreeGenFunc(srcKeyAliesSecond, HuksOptions); await publicAgreeExport1Func(srcKeyAliesFrist, HuksOptions, 1); @@ -178,7 +179,10 @@ async function publicAgreeFunc( HuksOptions.properties.splice(5, 1); } - await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptions); + let HuksOptionsInit = JSON.parse(JSON.stringify(HuksOptions)); + HuksOptionsInit.properties.splice(2,1,HuksOptionsFinish.properties[3]) + + await publicAgreeInitFunc(srcKeyAliesFrist, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 1); await publicAgreeFinishAbortFunc(HuksOptionsFinish, thirdInderfaceName); @@ -189,7 +193,7 @@ async function publicAgreeFunc( value: stringToUint8Array(srcKeyAliesSecond + 'final'), }); - await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptions); + await publicAgreeInitFunc(srcKeyAliesSecond, HuksOptionsInit); await publicAgreeUpdateFunc(HuksOptions, 2); await publicAgreeFinishAbortFunc(HuksOptionsFinishSecond, thirdInderfaceName);