mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-12 11:40:39 +03:00
coap_mbedtls.c: Enable PSA Crypto support if available
This commit is contained in:
1 parent
9603622715
commit
f34d955440
1 file changed
+7
@@ -76,6 +76,9 @@
|
||||
#if defined(ESPIDF_VERSION) && defined(CONFIG_MBEDTLS_DEBUG)
|
||||
#include <mbedtls/esp_debug.h>
|
||||
#endif /* ESPIDF_VERSION && CONFIG_MBEDTLS_DEBUG */
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#include <psa/crypto.h>
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
#define mbedtls_malloc(a) malloc(a)
|
||||
#define mbedtls_realloc(a,b) realloc(a,b)
|
||||
@@ -1512,6 +1515,10 @@ coap_dtls_new_mbedtls_env(coap_session_t *c_session,
|
||||
mbedtls_ssl_config_init(&m_env->conf);
|
||||
mbedtls_entropy_init(&m_env->entropy);
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
psa_crypto_init();
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
#if defined(ESPIDF_VERSION) && defined(CONFIG_MBEDTLS_DEBUG)
|
||||
mbedtls_esp_enable_debug_log(&m_env->conf, CONFIG_MBEDTLS_DEBUG_LEVEL);
|
||||
#endif /* ESPIDF_VERSION && CONFIG_MBEDTLS_DEBUG */
|
||||
|
||||
Reference in new issue
Block a user