Skip to content

Commit e825789

Browse files
pfalconAnas Nashif
authored andcommitted
mbedtls: Replace COAP-specific max len setting with generic
Instead of CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN, use recently introduced CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN. Signed-off-by: Paul Sokolovsky <[email protected]>
1 parent 7558ce8 commit e825789

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

ext/lib/crypto/mbedtls/configs/config-coap.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,11 @@
9191
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
9292

9393
/*
94-
* Save RAM at the expense of interoperability: do this only if you control
95-
* both ends of the connection! (See comments in "mbedtls/ssl.h".)
94+
* Allow to save RAM at the expense of interoperability: do this only if you
95+
* control both ends of the connection! (See comments in "mbedtls/ssl.h".)
9696
* The optimal size here depends on the typical size of records.
9797
*/
98-
#ifndef CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN
99-
#define MBEDTLS_SSL_MAX_CONTENT_LEN 1500
100-
#else
101-
#define MBEDTLS_SSL_MAX_CONTENT_LEN CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN
102-
#endif
98+
#define MBEDTLS_SSL_MAX_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN
10399

104100
#include "mbedtls/check_config.h"
105101

samples/net/coaps_client/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CONFIG_MBEDTLS_BUILTIN=y
2121
CONFIG_MBEDTLS_CFG_FILE="config-coap.h"
2222

2323
CONFIG_COAP=y
24-
CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN=256
24+
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=256
2525

2626
CONFIG_NET_APP_SETTINGS=y
2727
CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::3"

samples/net/coaps_server/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
1717
CONFIG_NET_MAX_CONTEXTS=10
1818

1919
CONFIG_COAP=y
20-
CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN=256
20+
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=256
2121

2222
CONFIG_MBEDTLS=y
2323
CONFIG_MBEDTLS_BUILTIN=y

subsys/net/lib/coap/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ config COAP_EXTENDED_OPTIONS_LEN_VALUE
6262
COAP_EXTENDED_OPTIONS_LEN is enabled. Define the value according to
6363
user requirement.
6464

65-
config COAP_MBEDTLS_SSL_MAX_CONTENT_LEN
66-
int "CoAP MBEDTLS maximum content length value"
67-
default 1500
68-
range 256 16384
69-
depends on MBEDTLS
70-
help
71-
This option sets the value of the MBEDTLS_SSL_MAX_CONTENT_LEN option
72-
in ext/lib/crypto/mbedtls/configs/config-coap.h For client/server
73-
communication to work these values need to be the same on both sides.
74-
7565
config NET_DEBUG_COAP
7666
bool "Debug COAP"
7767
default n

0 commit comments

Comments
 (0)