Skip to content

Commit 301458a

Browse files
author
Arto Kinnunen
authored
Add mbedtls flag to SSL server spesific function (#33)
Flag function mbedtls_ssl_conf_dtls_cookies with MBEDTLS_SSL_SRV_C to enable SSL server disabling that can save flash ~3,2kB.
1 parent 0fcd1d4 commit 301458a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/coap_security_handler.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,11 @@ int coap_security_handler_connect(coap_security_t *sec, bool is_server, SecureSo
321321
return -1;
322322
}
323323

324-
//TODO: Only needed for server type?
324+
#ifdef MBEDTLS_SSL_SRV_C
325325
mbedtls_ssl_conf_dtls_cookies(&sec->_conf, simple_cookie_write,
326326
simple_cookie_check,
327327
&sec->_cookie);
328+
#endif
328329

329330
sec->_is_started = true;
330331

@@ -416,10 +417,11 @@ int coap_security_handler_connect_non_blocking(coap_security_t *sec, bool is_ser
416417
return -1;
417418
}
418419

419-
//Only needed for server type?
420+
#ifdef MBEDTLS_SSL_SRV_C
420421
mbedtls_ssl_conf_dtls_cookies(&sec->_conf, simple_cookie_write,
421422
simple_cookie_check,
422423
&sec->_cookie);
424+
#endif
423425

424426
mbedtls_ssl_conf_min_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);
425427
mbedtls_ssl_conf_max_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);

0 commit comments

Comments
 (0)