From 1d210c013937b5e1e932302164ddf44af79ae94f Mon Sep 17 00:00:00 2001 From: teejusb <5017202+teejusb@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:12:56 -0700 Subject: [PATCH] Initialize the PSA Crypto API if requested (#514) --- README.md | 1 + ixwebsocket/IXSocketMbedTLS.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index a0f17753..f78bf9ff 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ If your company or project is using this library, feel free to open an issue or - [Abaddon](https://github.com/uowuo/abaddon), An alternative Discord client made with C++/gtkmm - [NovaCoin](https://github.com/novacoin-project/novacoin), a hybrid scrypt PoW + PoS based cryptocurrency. - [Candy](https://github.com/lanthora/candy), A WebSocket and TUN based VPN for Linux +- [ITGmania](https://github.com/itgmania/itgmania), a cross platform Dance Dance Revolution-like emulator. ## Alternative libraries diff --git a/ixwebsocket/IXSocketMbedTLS.cpp b/ixwebsocket/IXSocketMbedTLS.cpp index 97c87b97..f24612ff 100644 --- a/ixwebsocket/IXSocketMbedTLS.cpp +++ b/ixwebsocket/IXSocketMbedTLS.cpp @@ -47,6 +47,12 @@ namespace ix mbedtls_x509_crt_init(&_cacert); mbedtls_x509_crt_init(&_cert); mbedtls_pk_init(&_pkey); + // Initialize the PSA Crypto API if requested. + // This allows the X.509/TLS libraries to use PSA for crypto operations. + // See: https://github.com/Mbed-TLS/mbedtls/blob/development/docs/use-psa-crypto.md + #if defined(IXWEBSOCKET_MBEDTLS_USE_PSA_CRYPTO) + psa_crypto_init(); + #endif } bool SocketMbedTLS::loadSystemCertificates(std::string& errorMsg)