Skip to content

Commit b7d2405

Browse files
Vge0rgecvinayak
authored andcommitted
ext: oberon: Backport legacy + PSA fix
This fixes an issue in nrf_security which allows to support PSA APIs with Oberon PSA core when legacy mbedTLS APIs are used. Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
1 parent d53d2b2 commit b7d2405

File tree

3 files changed

+2014
-1
lines changed

3 files changed

+2014
-1
lines changed

ext/oberon/psa/core/include/psa/crypto_extra.h

-1
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,6 @@ static inline void psa_pake_cs_set_key_confirmation(
21232123
cipher_suite->key_confirmation = key_confirmation;
21242124
}
21252125

2126-
21272126
#ifdef __cplusplus
21282127
}
21292128
#endif

ext/oberon/psa/core/library/common.h

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
#ifndef MBEDTLS_LIBRARY_COMMON_H
2424
#define MBEDTLS_LIBRARY_COMMON_H
2525

26+
/* This covers a corner case which needs PSA and Legacy crypto APIs at the same time */
27+
#ifdef CONFIG_NRF_SECURITY_LEGACY_AND_PSA
28+
#define MBEDTLS_PSA_CRYPTO_DRIVERS // Needed for the driver wrappers
29+
#define MBEDTLS_PSA_CRYPTO_STORAGE_C // Needed for supporting ITS
30+
#define PSA_ACCEL_GENERATE_RANDOM // Kconfigs for PSA_NEED_* not used so manually enable it RNG
31+
#define PSA_ACCEL_GET_ENTROPY
32+
#define PSA_NEED_CC3XX_CTR_DRBG_DRIVER
33+
#include "oberon_config.h" // The PSA_NEED symbols used from this file when not using Kconfigs
34+
#endif
35+
2636
#include "mbedtls/build_info.h"
2737
#include "alignment.h"
2838

0 commit comments

Comments
 (0)