From 48d0d7a4dd31154c4208ec39029d60646192f978 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 26 Jan 2021 14:48:07 +1100 Subject: Disable sntrup761 if compiler doesn't support VLAs. The sntrup761 code sourced from supercop uses variable length arrays. Although widely supported, they are not part of the ANSI C89 spec so if the compiler does not support VLAs, disable the sntrup761x25519-sha512@openssh.com KEX method by replacing the kex functions with no-op ones similar to what we do in kexecdh.c. This should allow OpenSSH to build with a plain C89 compiler again. Spotted by tim@, ok djm@. --- defines.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'defines.h') diff --git a/defines.h b/defines.h index 79dcb507..d6a1d014 100644 --- a/defines.h +++ b/defines.h @@ -894,4 +894,11 @@ struct winsize { # define USE_SYSTEM_GLOB #endif +/* + * sntrup761 uses variable length arrays, only enable if the compiler + * supports them. + */ +#ifdef VARIABLE_LENGTH_ARRAYS +# define USE_SNTRUP761X25519 1 +#endif #endif /* _DEFINES_H */ -- cgit v1.2.1