From 25aa2167f692210f2f47dede5c9bc5d79e42ecf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Tue, 17 Oct 2023 17:40:19 +0200 Subject: [PATCH] sys/psa_crypto: allow repeated calls to psa_crypto_init() as defined per https://armmbed.github.io/mbed-crypto/html/api/library/library.html?highlight=psa_crypto_init#c.psa_crypto_init --- sys/psa_crypto/psa_crypto.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/psa_crypto/psa_crypto.c b/sys/psa_crypto/psa_crypto.c index af0a9dab4c..a780593f33 100644 --- a/sys/psa_crypto/psa_crypto.c +++ b/sys/psa_crypto/psa_crypto.c @@ -113,6 +113,10 @@ const char *psa_status_to_humanly_readable(psa_status_t status) psa_status_t psa_crypto_init(void) { + if (lib_initialized) { + return PSA_SUCCESS; + } + lib_initialized = 1; #if (IS_USED(MODULE_PSA_KEY_SLOT_MGMT))