blob: 7a083dd810d5d503ab818b42c6e9b1d6238796d1 [file] [log] [blame]
David Vincze485c5ac2025-03-21 11:14:56 +00001From 82735c44ddbd94b574e8873e2388c7e2796246c3 Mon Sep 17 00:00:00 2001
Antonio de Angelis8bb98512024-01-16 14:13:36 +00002From: Antonio de Angelis <Antonio.deAngelis@arm.com>
3Date: Thu, 21 Mar 2024 13:02:44 +0000
Antonio de Angelis214fbe42024-02-09 13:58:59 +00004Subject: [PATCH 6/7] Enable psa_can_do_hash
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +01005
6CC312 driver want to use hash in md for entropy operations.
7Enable psa_can_do_hash by directly returning 1.
8This is a workaround for current cc312 driver. After switching
9to new driver, this workaround is not needed.
10
11Signed-off-by: Summer Qin <summer.qin@arm.com>
12---
Antonio de Angelis8bb98512024-01-16 14:13:36 +000013 library/psa_crypto.c | 3 ++-
14 1 file changed, 2 insertions(+), 1 deletion(-)
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010015
16diff --git a/library/psa_crypto.c b/library/psa_crypto.c
David Vincze485c5ac2025-03-21 11:14:56 +000017index 08906dc68..80220ac4b 100644
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010018--- a/library/psa_crypto.c
19+++ b/library/psa_crypto.c
Antonio de Angelis8bb98512024-01-16 14:13:36 +000020@@ -288,7 +288,8 @@ static uint8_t psa_get_drivers_initialized(void)
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010021 int psa_can_do_hash(psa_algorithm_t hash_alg)
22 {
23 (void) hash_alg;
Antonio de Angelis8bb98512024-01-16 14:13:36 +000024- return psa_get_drivers_initialized();
25+ /* Workaround for the legacy CryptoCell driver requiring hash during init */
26+ return 1; //psa_get_drivers_initialized();
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010027 }
Antonio de Angelis8bb98512024-01-16 14:13:36 +000028
29 int psa_can_do_cipher(psa_key_type_t key_type, psa_algorithm_t cipher_alg)
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010030--
Antonio de Angelis8bb98512024-01-16 14:13:36 +0000312.34.1
Antonio de Angelis3fae3ae2023-10-01 00:28:56 +010032