summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2021-01-26 14:48:07 +1100
committerDarren Tucker <dtucker@dtucker.net>2021-01-26 14:48:07 +1100
commit48d0d7a4dd31154c4208ec39029d60646192f978 (patch)
tree5f1c1fbc167c418fff1fceed416e06b0562fbe39 /defines.h
parent37c70ea8d4f3664a88141bcdf0bf7a16bd5fd1ac (diff)
downloadopenssh-git-48d0d7a4dd31154c4208ec39029d60646192f978.tar.gz
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 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 */