blob: 7a083dd810d5d503ab818b42c6e9b1d6238796d1 [file] [log] [blame]
From 82735c44ddbd94b574e8873e2388c7e2796246c3 Mon Sep 17 00:00:00 2001
From: Antonio de Angelis <Antonio.deAngelis@arm.com>
Date: Thu, 21 Mar 2024 13:02:44 +0000
Subject: [PATCH 6/7] Enable psa_can_do_hash
CC312 driver want to use hash in md for entropy operations.
Enable psa_can_do_hash by directly returning 1.
This is a workaround for current cc312 driver. After switching
to new driver, this workaround is not needed.
Signed-off-by: Summer Qin <summer.qin@arm.com>
---
library/psa_crypto.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 08906dc68..80220ac4b 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -288,7 +288,8 @@ static uint8_t psa_get_drivers_initialized(void)
int psa_can_do_hash(psa_algorithm_t hash_alg)
{
(void) hash_alg;
- return psa_get_drivers_initialized();
+ /* Workaround for the legacy CryptoCell driver requiring hash during init */
+ return 1; //psa_get_drivers_initialized();
}
int psa_can_do_cipher(psa_key_type_t key_type, psa_algorithm_t cipher_alg)
--
2.34.1