mirror of
https://gitee.com/openharmony/security_huks
synced 2025-02-21 10:41:55 +00:00
修复有效告警
Signed-off-by: l00889714 <linzhaosheng@huawei.com>
This commit is contained in:
parent
43dcbc8f6c
commit
2a3b32ebff
@ -66,7 +66,7 @@ int32_t HksGetBlobFromWrappedData(const struct HksBlob *wrappedData, uint32_t bl
|
||||
|
||||
int32_t HksCheckKeyNeedStored(const struct HksParamSet *paramSet, bool *isNeedStorage);
|
||||
|
||||
int32_t HksCheckParamsetOneAndPatamsetTwoExist(const struct HksParamSet *keyBlobParamSet,
|
||||
int32_t HksCheckKeyBlobParamSetEqualRuntimeParamSet(const struct HksParamSet *keyBlobParamSet,
|
||||
const struct HksParamSet *runtimeParamSet, uint32_t tag);
|
||||
|
||||
void SetRsaPssSaltLenType(const struct HksParamSet *paramSet, struct HksUsageSpec *usageSpec);
|
||||
|
@ -239,7 +239,7 @@ int32_t HksCheckKeyNeedStored(const struct HksParamSet *paramSet, bool *isNeedSt
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t HksCheckParamsetOneAndPatamsetTwoExist(const struct HksParamSet *keyBlobParamSet,
|
||||
int32_t HksCheckKeyBlobParamSetEqualRuntimeParamSet(const struct HksParamSet *keyBlobParamSet,
|
||||
const struct HksParamSet *runtimeParamSet, uint32_t tag)
|
||||
{
|
||||
if (keyBlobParamSet == NULL || runtimeParamSet == NULL) {
|
||||
@ -249,13 +249,13 @@ int32_t HksCheckParamsetOneAndPatamsetTwoExist(const struct HksParamSet *keyBlob
|
||||
bool isExistInParamsetOne = true;
|
||||
struct HksParam *paramInParamsetOne = NULL;
|
||||
int32_t ret = HksGetParam(keyBlobParamSet, tag, ¶mInParamsetOne);
|
||||
if (ret == HKS_ERROR_PARAM_NOT_EXIST) {
|
||||
if (ret != HKS_SUCCESS) {
|
||||
isExistInParamsetOne = false;
|
||||
}
|
||||
bool isExistInParamsetTwo = true;
|
||||
struct HksParam *paramInParamsetTwo = NULL;
|
||||
ret = HksGetParam(runtimeParamSet, tag, ¶mInParamsetTwo);
|
||||
if (ret == HKS_ERROR_PARAM_NOT_EXIST) {
|
||||
if (ret != HKS_SUCCESS) {
|
||||
isExistInParamsetTwo = false;
|
||||
}
|
||||
if (isExistInParamsetOne && (!isExistInParamsetTwo)) {
|
||||
|
@ -341,8 +341,9 @@ static int32_t SignVerifyAuth(const struct HksKeyNode *keyNode, const struct Hks
|
||||
ret = HksGetParam(paramSet, HKS_TAG_PADDING, &padding);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "append sign/verify get padding param failed!")
|
||||
if (padding->uint32Param == HKS_PADDING_PSS) {
|
||||
ret = HksCheckParamsetOneAndPatamsetTwoExist(keyNode->paramSet, paramSet, HKS_TAG_RSA_PSS_SALT_LEN_TYPE);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "HksCheckParamsetOneAndPatamsetTwoExist failed!")
|
||||
ret = HksCheckKeyBlobParamSetEqualRuntimeParamSet(keyNode->paramSet,
|
||||
paramSet, HKS_TAG_RSA_PSS_SALT_LEN_TYPE);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "HksCheckKeyBlobParamSetEqualRuntimeParamSet failed!")
|
||||
}
|
||||
return HksAuth(HKS_AUTH_ID_SIGN_VERIFY_RSA, keyNode, paramSet);
|
||||
} else if (algParam->uint32Param == HKS_ALG_ECC) {
|
||||
|
@ -230,9 +230,9 @@ static int32_t SignVerifyAuth(const struct HuksKeyNode *keyNode, const struct Hk
|
||||
ret = HksGetParam(paramSet, HKS_TAG_PADDING, &padding);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "append sign/verify get padding param failed!")
|
||||
if (padding->uint32Param == HKS_PADDING_PSS) {
|
||||
ret = HksCheckParamsetOneAndPatamsetTwoExist(keyNode->keyBlobParamSet, keyNode->runtimeParamSet,
|
||||
HKS_TAG_RSA_PSS_SALT_LEN_TYPE);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "HksCheckParamsetOneAndPatamsetTwoExist failed!")
|
||||
ret = HksCheckKeyBlobParamSetEqualRuntimeParamSet(keyNode->keyBlobParamSet,
|
||||
keyNode->runtimeParamSet, HKS_TAG_RSA_PSS_SALT_LEN_TYPE);
|
||||
HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "HksCheckKeyBlobParamSetEqualRuntimeParamSet failed!")
|
||||
}
|
||||
return HksThreeStageAuth(HKS_AUTH_ID_SIGN_VERIFY_RSA, keyNode);
|
||||
} else if (algParam->uint32Param == HKS_ALG_ED25519) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user