diff --git a/src/cli/cli_tcp.cpp b/src/cli/cli_tcp.cpp index 22c618e3d..13dc00e27 100644 --- a/src/cli/cli_tcp.cpp +++ b/src/cli/cli_tcp.cpp @@ -148,7 +148,9 @@ template <> otError TcpExample::Process(Arg aArgs[]) mbedtls_ssl_init(&mSslContext); mbedtls_ssl_config_init(&mSslConfig); +#if (MBEDTLS_VERSION_NUMBER <= 0x03060500) mbedtls_ssl_conf_rng(&mSslConfig, Crypto::MbedTls::CryptoSecurePrng, nullptr); +#endif mbedtls_ssl_conf_authmode(&mSslConfig, MBEDTLS_SSL_VERIFY_NONE); mbedtls_ssl_conf_ciphersuites(&mSslConfig, sCipherSuites); @@ -160,7 +162,7 @@ template <> otError TcpExample::Process(Arg aArgs[]) mbedtls_ssl_conf_max_version(&mSslConfig, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3); #endif -#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) && (MBEDTLS_VERSION_NUMBER <= 0x03060500) #include "crypto/mbedtls.hpp" int rv = mbedtls_pk_parse_key(&mPKey, reinterpret_cast(sSrvKey), sSrvKeyLength, nullptr, 0, Crypto::MbedTls::CryptoSecurePrng, nullptr); diff --git a/src/core/meshcop/secure_transport.cpp b/src/core/meshcop/secure_transport.cpp index 2af866e04..6f6841155 100644 --- a/src/core/meshcop/secure_transport.cpp +++ b/src/core/meshcop/secure_transport.cpp @@ -199,7 +199,9 @@ Error SecureSession::Setup(void) } #endif +#if (MBEDTLS_VERSION_NUMBER <= 0x03060500) mbedtls_ssl_conf_rng(&mConf, Crypto::MbedTls::CryptoSecurePrng, nullptr); +#endif #if (MBEDTLS_VERSION_NUMBER >= 0x03020000) mbedtls_ssl_conf_min_tls_version(&mConf, MBEDTLS_SSL_VERSION_TLS1_2); mbedtls_ssl_conf_max_tls_version(&mConf, MBEDTLS_SSL_VERSION_TLS1_2); @@ -278,7 +280,11 @@ Error SecureSession::Setup(void) if (mIsServer) { +#if (MBEDTLS_VERSION_NUMBER <= 0x03060500) rval = mbedtls_ssl_cookie_setup(&mCookieCtx, Crypto::MbedTls::CryptoSecurePrng, nullptr); +#else + rval = mbedtls_ssl_cookie_setup(&mCookieCtx); +#endif VerifyOrExit(rval == 0); mbedtls_ssl_conf_dtls_cookies(&mConf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &mCookieCtx);