From 2429c0b6ee1f63cdeb25e9e1d5f38b28b7d691ab Mon Sep 17 00:00:00 2001 From: CheungVane Date: Tue, 5 Dec 2023 14:42:08 +0800 Subject: [PATCH 1/3] add AuthStorageLevel tags Signed-off-by: zhangwenzhi --- security/huks/include/native_huks_type.h | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 6dcaa7a8c..42791a40e 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -450,6 +450,29 @@ enum OH_Huks_AuthAccessType { OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1 }; +/** + * @brief Enumerates key file storage authentication levels. + * + * @since 11 + */ +enum OH_Huks_AuthStorageLevel { + /** + * Key file storage security level for device encryption standard. + * @since 11 + */ + OH_Huks_AUTH_STORAGE_LEVEL_DE = 0, + /** + * Key file storage security level for credential encryption standard. + * @since 11 + */ + OH_Huks_AUTH_STORAGE_LEVEL_CE = 1, + /** + * Key file storage security level for enhanced credential encryption standard. + * @since 11 + */ + OH_Huks_AUTH_STORAGE_LEVEL_ECE = 2, +}; + /** * @brief Enumerates the types of the challenges generated when a key is used. * @see OH_Huks_ChallengePosition @@ -590,6 +613,13 @@ enum OH_Huks_Tag { /** Purpose of key authentication */ OH_HUKS_TAG_KEY_AUTH_PURPOSE = OH_HUKS_TAG_TYPE_UINT | 311, + /** + * Security level of access control for key file storage, whose optional values are from enum OH_Huks_AuthStorageLevel. + * + * @since 11 + */ + OH_HUKS_TAG_AUTH_STORAGE_LEVEL = OH_HUKS_TAG_TYPE_UINT | 316, + /** Tags for key attestation. The value range is 501 to 600. */ /** Challenge value used in the attestation. */ OH_HUKS_TAG_ATTESTATION_CHALLENGE = OH_HUKS_TAG_TYPE_BYTES | 501, -- Gitee From 610a3b638126bd462590dedff3f5ef7f03bd9224 Mon Sep 17 00:00:00 2001 From: CheungVane Date: Tue, 5 Dec 2023 16:34:10 +0800 Subject: [PATCH 2/3] modify the upper case Signed-off-by: zhangwenzhi --- security/huks/include/native_huks_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 42791a40e..18bdda1c0 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -460,17 +460,17 @@ enum OH_Huks_AuthStorageLevel { * Key file storage security level for device encryption standard. * @since 11 */ - OH_Huks_AUTH_STORAGE_LEVEL_DE = 0, + OH_HUKS_AUTH_STORAGE_LEVEL_DE = 0, /** * Key file storage security level for credential encryption standard. * @since 11 */ - OH_Huks_AUTH_STORAGE_LEVEL_CE = 1, + OH_HUKS_AUTH_STORAGE_LEVEL_CE = 1, /** * Key file storage security level for enhanced credential encryption standard. * @since 11 */ - OH_Huks_AUTH_STORAGE_LEVEL_ECE = 2, + OH_HUKS_AUTH_STORAGE_LEVEL_ECE = 2, }; /** -- Gitee From 2d9d9b56718549880a19ff3ded3356d15eab56c5 Mon Sep 17 00:00:00 2001 From: CheungVane Date: Thu, 14 Dec 2023 15:45:31 +0800 Subject: [PATCH 3/3] fix code check Signed-off-by: zhangwenzhi --- security/huks/include/native_huks_type.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 18bdda1c0..9766b6f13 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. */ @@ -451,8 +451,8 @@ enum OH_Huks_AuthAccessType { }; /** - * @brief Enumerates key file storage authentication levels. - * + * @brief Enumerates key file storage authentication levels. + * * @since 11 */ enum OH_Huks_AuthStorageLevel { @@ -614,7 +614,7 @@ enum OH_Huks_Tag { OH_HUKS_TAG_KEY_AUTH_PURPOSE = OH_HUKS_TAG_TYPE_UINT | 311, /** - * Security level of access control for key file storage, whose optional values are from enum OH_Huks_AuthStorageLevel. + * Security level of access control for key file storage, whose optional values are from OH_Huks_AuthStorageLevel. * * @since 11 */ @@ -709,7 +709,7 @@ struct OH_Huks_Blob { struct OH_Huks_Param { /** Tag value. */ uint32_t tag; - + union { /** Parameter of the Boolean type. */ bool boolParam; -- Gitee