Skip to content

Commit 32df5ee

Browse files
Initialize PSA crypto when it is present.
1 parent dd0b1ab commit 32df5ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libs/ssl/ssl.c

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ typedef int SOCKET;
3232
#include "mbedtls/x509_crt.h"
3333
#include "mbedtls/ssl.h"
3434

35+
#ifdef MBEDTLS_PSA_CRYPTO_C
36+
#include <psa/crypto.h>
37+
#endif
38+
3539
#ifdef HL_CONSOLE
3640
mbedtls_x509_crt *hl_init_cert_chain();
3741
#endif
@@ -763,6 +767,10 @@ HL_PRIM void HL_NAME(ssl_init)() {
763767
mbedtls_entropy_init(&entropy);
764768
mbedtls_ctr_drbg_init(&ctr_drbg);
765769
mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0);
770+
771+
#ifdef MBEDTLS_PSA_CRYPTO_C
772+
psa_crypto_init();
773+
#endif
766774
}
767775

768776
DEFINE_PRIM(_VOID, ssl_init, _NO_ARG);

0 commit comments

Comments
 (0)