package/mbedtls: fix zlib support
PATCH 1/1 package/mbedtls: fix zlib support
To enable compression support using zlib it is necessary to uncomment the define for MBEDTLS_ZLIB_SUPPORT in config.h [1].
Note, that enabling TLS compression may make mbedTLS vulnerable to the CRIME attack [1]. It should not be enabled unless is is sure CRIME and similar attacks are not applicable to the particulare situation.
As zlib is probably enabled in most systems, maybe it is best to make the compression support a user choice and add the warning from [1]?
[1] https://tls.mbed.org/kb/how-to/deflate-compression-in-ssl-tls
--- package/mbedtls/mbedtls.mk | 5 +++++ 1 file changed, 5 insertions(+)
package/mbedtls/mbedtls.mk +5 -0
@@ -42,6 +42,11 @@ endif ifeq ($(BR2_PACKAGE_ZLIB),y) MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=ON MBEDTLS_DEPENDENCIES += zlib +define MBEDTLS_ENABLE_ZLIB + $(SED) "s://#define MBEDTLS_ZLIB_SUPPORT:#define MBEDTLS_ZLIB_SUPPORT:" \ + $(@D)/include/mbedtls/config.h +endef +MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_ENABLE_ZLIB else MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=OFF endif
Signature · 1 line
2.11.0
Thomas Petazzoni
AppliedPATCH 1/1 package/mbedtls: fix zlib support
Hello,
Quoted 9 lines · J?rg Krause
To enable compression support using zlib it is necessary to uncomment the define for
MBEDTLS_ZLIB_SUPPORTinconfig.h[1].Note, that enabling TLS compression may make mbedTLS vulnerable to the CRIME attack [1]. It should not be enabled unless is is sure CRIME and similar attacks are not applicable to the particulare situation.
As zlib is probably enabled in most systems, maybe it is best to make the compression support a user choice and add the warning from [1]?
Yes, please do this, it seems to make sense.
Quoted 6 lines
[1] https://tls.mbed.org/kb/how-to/deflate-compression-in-ssl-tls
Signed-off-by J?rg Krause <[email protected]>--- package/mbedtls/mbedtls.mk | 5 +++++ 1 file changed, 5 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com