summaryrefslogtreecommitdiffstats
path: root/defines.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2021-01-26 04:48:07 +0100
committerDarren Tucker <dtucker@dtucker.net>2021-01-26 04:48:07 +0100
commit48d0d7a4dd31154c4208ec39029d60646192f978 (patch)
tree5f1c1fbc167c418fff1fceed416e06b0562fbe39 /defines.h
parentupstream: refactor key constraint parsing in ssh-agent (diff)
downloadopenssh-48d0d7a4dd31154c4208ec39029d60646192f978.tar.xz
openssh-48d0d7a4dd31154c4208ec39029d60646192f978.zip
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@.
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/defines.h b/defines.h
index 79dcb507f..d6a1d014c 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 */