From 96010a82b8ca24ea5a50652a1d13812c8328d091 Mon Sep 17 00:00:00 2001 From: ailu1 Date: Tue, 5 Dec 2023 16:19:12 +0800 Subject: [PATCH 1/3] add err code and access type Signed-off-by: ailu1 --- security/huks/include/native_huks_type.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 6dcaa7a8c43..757656949fe 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -175,7 +175,7 @@ enum OH_Huks_KeySize { OH_HUKS_RSA_KEY_SIZE_3072 = 3072, /** RSA key of 4096 bits. */ OH_HUKS_RSA_KEY_SIZE_4096 = 4096, - + /** Elliptic Curve Cryptography (ECC) key of 224 bits. */ OH_HUKS_ECC_KEY_SIZE_224 = 224, /** ECC key of 256 bits. */ @@ -398,6 +398,10 @@ enum OH_Huks_ErrCode { OH_HUKS_ERR_CODE_INTERNAL_ERROR = 12000012, /** The authentication credential does not exist. */ OH_HUKS_ERR_CODE_CREDENTIAL_NOT_EXIST = 12000013, + /** The memory is not sufficient. */ + OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY = 12000014, + /** Failed to call service. */ + OH_HUKS_ERR_CODE_CALL_SERVICE_FAILED = 12000015, }; /** @@ -447,7 +451,9 @@ enum OH_Huks_AuthAccessType { /** The key is invalid after the password is cleared. */ OH_HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0, /** The key is invalid after a new biometric feature is enrolled. */ - OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1 + OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1, + /** The key is always valid. */ + OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 2, }; /** @@ -679,7 +685,7 @@ struct OH_Huks_Blob { struct OH_Huks_Param { /** Tag value. */ uint32_t tag; - + union { /** Parameter of the Boolean type. */ bool boolParam; -- Gitee From 2dfe742296fac6d91fa7751227958a8cd4ecc708 Mon Sep 17 00:00:00 2001 From: ailu1 Date: Tue, 5 Dec 2023 16:21:58 +0800 Subject: [PATCH 2/3] fix tab Signed-off-by: ailu1 --- security/huks/include/native_huks_type.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 757656949fe..da395ed2ce2 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -452,8 +452,8 @@ enum OH_Huks_AuthAccessType { OH_HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0, /** The key is invalid after a new biometric feature is enrolled. */ OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1, - /** The key is always valid. */ - OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 2, + /** The key is always valid. */ + OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 2, }; /** -- Gitee From 731a2e4e0a4ed8856662bc132744aeaafdbf5343 Mon Sep 17 00:00:00 2001 From: ailu1 Date: Tue, 5 Dec 2023 16:25:53 +0800 Subject: [PATCH 3/3] fix enum Signed-off-by: ailu1 --- security/huks/include/native_huks_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index da395ed2ce2..7f8f716da99 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -453,7 +453,7 @@ enum OH_Huks_AuthAccessType { /** The key is invalid after a new biometric feature is enrolled. */ OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1, /** The key is always valid. */ - OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 2, + OH_HUKS_AUTH_ACCESS_ALWAYS_VALID = 1 << 2, }; /** -- Gitee