Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 909a3c1

Browse files
committed
Adaptions for mbedTLS v3.x.x, but backward compatibility kept.
1 parent e0a59ca commit 909a3c1

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/AsyncTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ bool AsyncClient::getNoDelay(){
351351
if (_socket == -1) return false;
352352

353353
int flag = 0;
354-
size_t size = sizeof(int);
354+
socklen_t size = sizeof(int);
355355
int res = getsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, &size);
356356
if(res < 0) {
357357
log_e("fail on fd %d, errno: %d, \"%s\"", _socket, errno, strerror(errno));

src/AsyncTCP_TLS_Context.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ int AsyncTCP_TLS_Context::_startSSLClient(int sck, const char * host_or_ip,
196196
}
197197

198198
log_v("Loading private key");
199+
#if MBEDTLS_VERSION_NUMBER < 0x03000000
199200
ret = mbedtls_pk_parse_key(&client_key, cli_key, cli_key_len, NULL, 0);
201+
#else
202+
ret = mbedtls_pk_parse_key(&client_key, cli_key, cli_key_len, NULL, 0, mbedtls_ctr_drbg_random, &drbg_ctx);
203+
#endif
200204
_have_client_key = true;
201205

202206
if (ret != 0) {

0 commit comments

Comments
 (0)