From 268050964b088a6000cca750e92dc6b5f54bbe7f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 3 Apr 2024 22:31:29 +0200 Subject: [PATCH] ustream-mbedtls: add missing psa_crypto_init call Required for a few features, including TLS1.3 on newer mbedtls versions Signed-off-by: Felix Fietkau --- ustream-mbedtls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c index 18ffe06..13785ce 100644 --- a/ustream-mbedtls.c +++ b/ustream-mbedtls.c @@ -25,6 +25,7 @@ #include "ustream-ssl.h" #include "ustream-internal.h" +#include static int s_ustream_read(void *ctx, unsigned char *buf, size_t len) { @@ -136,6 +137,13 @@ __ustream_ssl_context_new(bool server) mbedtls_ssl_config *conf; int ep; +#ifdef MBEDTLS_PSA_CRYPTO_C + static bool psa_init; + + if (!psa_init && !psa_crypto_init()) + psa_init = true; +#endif + ctx = calloc(1, sizeof(*ctx)); if (!ctx) return NULL; -- 2.30.2