From 3b7179b5a7e525cd7445b6fdec3514ac4abb57d0 Mon Sep 17 00:00:00 2001 From: Harish Jenny K N Date: Fri, 18 Feb 2022 17:21:37 +0530 Subject: [PATCH] crypto: Support 4k Key generation Enabled 4096 bits key generation Signed-off-by: Harish Jenny K N Change-Id: I7f0364465dc08c442c682d457026ea9d9d0aaaa1 --- internal_api/crypto/crypto_utils.c | 2 +- internal_api/storage/storage_utils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal_api/crypto/crypto_utils.c b/internal_api/crypto/crypto_utils.c index 1d109d4..fe25318 100644 --- a/internal_api/crypto/crypto_utils.c +++ b/internal_api/crypto/crypto_utils.c @@ -544,7 +544,7 @@ bool valid_key_size_for_algorithm(uint32_t algorithm, uint32_t key) case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - if (key >= 256 && key <= 2048) + if (key >= 256 && key <= 4096) return true; return false; diff --git a/internal_api/storage/storage_utils.c b/internal_api/storage/storage_utils.c index f45beb1..1db59ce 100644 --- a/internal_api/storage/storage_utils.c +++ b/internal_api/storage/storage_utils.c @@ -179,12 +179,12 @@ int valid_object_type_and_max_size(uint32_t obj_type, return 1; case TEE_TYPE_RSA_PUBLIC_KEY: - if (obj_size >= 256 && obj_size <= 2048) + if (obj_size >= 256 && obj_size <= 4096) return 0; return 1; case TEE_TYPE_RSA_KEYPAIR: - if (obj_size >= 256 && obj_size <= 2048) + if (obj_size >= 256 && obj_size <= 4096) return 0; return 1;