From aa76f5673b8a9b17a0cc6ed248df61c9a82b63b4 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Wed, 30 Jul 2025 16:13:34 -0300 Subject: [PATCH] ChaCha20 not working in S390 (bigendian) --- mongoose.c | 2 ++ src/tls_builtin.c | 2 ++ test/Makefile | 1 + 3 files changed, 5 insertions(+) diff --git a/mongoose.c b/mongoose.c index 84ef6ef4..9f185123 100644 --- a/mongoose.c +++ b/mongoose.c @@ -10877,7 +10877,9 @@ int mg_aes_gcm_decrypt(unsigned char *output, const unsigned char *input, #if MG_TLS == MG_TLS_BUILTIN +#ifndef CHACHA20 #define CHACHA20 1 +#endif /* TLS 1.3 Record Content Type (RFC8446 B.1) */ #define MG_TLS_CHANGE_CIPHER 20 diff --git a/src/tls_builtin.c b/src/tls_builtin.c index 4cf82f4f..165cd66b 100644 --- a/src/tls_builtin.c +++ b/src/tls_builtin.c @@ -12,7 +12,9 @@ #if MG_TLS == MG_TLS_BUILTIN +#ifndef CHACHA20 #define CHACHA20 1 +#endif /* TLS 1.3 Record Content Type (RFC8446 B.1) */ #define MG_TLS_CHANGE_CIPHER 20 diff --git a/test/Makefile b/test/Makefile index b4e4a691..d33dd61c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -175,6 +175,7 @@ armhf: test s390: ASAN= s390: IPV6=0 s390: CFLAGS += -Wno-stringop-overflow +s390: DEFS += -DCHACHA20=0 s390: CC = $(DOCKER) mdashnet/s390 cc s390: RUN = $(DOCKER) --init mdashnet/s390 s390: test