From 97370f6c2c3b825f8c577b7e6c00b1a98d30a6cf Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2019 10:54:51 +1000 Subject: Fix building w/out ECC. Ifdef out ECC specific code so that that it'll build against an OpenSSL configured w/out ECC. With & ok djm@ --- kexecdh.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'kexecdh.c') diff --git a/kexecdh.c b/kexecdh.c index 0aeab2e9b..9a3bb81b8 100644 --- a/kexecdh.c +++ b/kexecdh.c @@ -208,4 +208,30 @@ kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob, kex->ec_client_key = NULL; return r; } + +#else + +#include "sshkey.h" +#include "kex.h" +#include "ssherr.h" + +int +kex_ecdh_keypair(struct kex *kex) +{ + return SSH_ERR_SIGN_ALG_UNSUPPORTED; +} + +int +kex_ecdh_enc(struct kex *kex, const struct sshbuf *client_blob, + struct sshbuf **server_blobp, struct sshbuf **shared_secretp) +{ + return SSH_ERR_SIGN_ALG_UNSUPPORTED; +} + +int +kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + return SSH_ERR_SIGN_ALG_UNSUPPORTED; +} #endif /* defined(WITH_OPENSSL) && defined(OPENSSL_HAS_ECC) */ -- cgit v1.2.3 From 9634ffbf29b3c2493e69d10b37077b09a8cbf5ff Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 23 Jul 2019 22:25:44 +1000 Subject: Add headers to prevent warnings w/out OpenSSL. --- auth2-passwd.c | 1 + entropy.c | 4 ++++ kexecdh.c | 2 ++ kexgen.c | 1 + loginrec.c | 1 + platform.c | 1 + ssh-keysign.c | 1 + ssh-pkcs11.c | 8 ++++++++ 8 files changed, 19 insertions(+) (limited to 'kexecdh.c') diff --git a/auth2-passwd.c b/auth2-passwd.c index 0395a69f4..f696abc21 100644 --- a/auth2-passwd.c +++ b/auth2-passwd.c @@ -29,6 +29,7 @@ #include #include +#include #include "packet.h" #include "ssherr.h" diff --git a/entropy.c b/entropy.c index 5c6594ac9..dc307e76c 100644 --- a/entropy.c +++ b/entropy.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include /* for offsetof */ @@ -248,6 +249,9 @@ seed_rng(void) #else /* WITH_OPENSSL */ +#include +#include + /* Acutal initialisation is handled in arc4random() */ void seed_rng(void) diff --git a/kexecdh.c b/kexecdh.c index 9a3bb81b8..be324a838 100644 --- a/kexecdh.c +++ b/kexecdh.c @@ -211,6 +211,8 @@ kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob, #else +#include + #include "sshkey.h" #include "kex.h" #include "ssherr.h" diff --git a/kexgen.c b/kexgen.c index 2abbb9ef6..54292652a 100644 --- a/kexgen.c +++ b/kexgen.c @@ -27,6 +27,7 @@ #include +#include #include #include #include diff --git a/loginrec.c b/loginrec.c index 5f2a47797..93e48d517 100644 --- a/loginrec.c +++ b/loginrec.c @@ -163,6 +163,7 @@ #endif #include #include +#include #include #include #include diff --git a/platform.c b/platform.c index 41acc9370..44ba71dc5 100644 --- a/platform.c +++ b/platform.c @@ -17,6 +17,7 @@ #include "includes.h" #include +#include #include #include "log.h" diff --git a/ssh-keysign.c b/ssh-keysign.c index 7c14cde8a..a4a1b8c21 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -31,6 +31,7 @@ #endif #include #include +#include #include #include #include diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c index d9413bc4f..45ab80d0a 100644 --- a/ssh-pkcs11.c +++ b/ssh-pkcs11.c @@ -1789,6 +1789,14 @@ out: } #endif /* WITH_PKCS11_KEYGEN */ #else /* ENABLE_PKCS11 */ + +#include +#include +#include + +#include "log.h" +#include "sshkey.h" + int pkcs11_init(int interactive) { -- cgit v1.2.3 From edd1d3a6261aecbf9a55944fd7be1db83571b46e Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 2 Oct 2019 10:54:28 +1000 Subject: remove duplicate #includes Prompted by Jakub Jelen --- auth-bsdauth.c | 2 -- auth-options.c | 1 - auth.h | 4 ++-- auth2.c | 3 --- dns.c | 1 - hmac.c | 1 - hostfile.c | 1 - kex.h | 15 +++------------ kexecdh.c | 8 +++----- krl.c | 1 - mac.c | 1 - sandbox-systrace.c | 1 - ssh-keysign.c | 1 - sshconnect.c | 1 - 14 files changed, 8 insertions(+), 33 deletions(-) (limited to 'kexecdh.c') diff --git a/auth-bsdauth.c b/auth-bsdauth.c index 4dc5045c2..d124e994e 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c @@ -29,8 +29,6 @@ #include #include -#include - #ifdef BSD_AUTH #include "xmalloc.h" #include "sshkey.h" diff --git a/auth-options.c b/auth-options.c index 9550f656f..90b0d7f25 100644 --- a/auth-options.c +++ b/auth-options.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/auth.h b/auth.h index 04ad99ffb..becc672b5 100644 --- a/auth.h +++ b/auth.h @@ -234,7 +234,7 @@ pid_t subprocess(const char *, struct passwd *, int sys_auth_passwd(struct ssh *, const char *); #if defined(KRB5) && !defined(HEIMDAL) -#include krb5_error_code ssh_krb5_cc_gen(krb5_context, krb5_ccache *); #endif -#endif + +#endif /* AUTH_H */ diff --git a/auth2.c b/auth2.c index 2143ff5de..0e7762242 100644 --- a/auth2.c +++ b/auth2.c @@ -52,14 +52,11 @@ #include "auth.h" #include "dispatch.h" #include "pathnames.h" -#include "sshbuf.h" #include "ssherr.h" - #ifdef GSSAPI #include "ssh-gss.h" #endif #include "monitor_wrap.h" -#include "ssherr.h" #include "digest.h" /* import */ diff --git a/dns.c b/dns.c index ff1a2c41c..e4f9bf830 100644 --- a/dns.c +++ b/dns.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include "xmalloc.h" diff --git a/hmac.c b/hmac.c index a79e8569c..32688876d 100644 --- a/hmac.c +++ b/hmac.c @@ -21,7 +21,6 @@ #include #include -#include #include "sshbuf.h" #include "digest.h" diff --git a/hostfile.c b/hostfile.c index 389aae1fc..96ab880d4 100644 --- a/hostfile.c +++ b/hostfile.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include "xmalloc.h" diff --git a/kex.h b/kex.h index 6465df88d..a5ae6ac05 100644 --- a/kex.h +++ b/kex.h @@ -30,6 +30,9 @@ #include "crypto_api.h" #ifdef WITH_OPENSSL +# include +# include +# include # ifdef OPENSSL_HAS_ECC # include # else /* OPENSSL_HAS_ECC */ @@ -45,18 +48,6 @@ # define EC_POINT void #endif /* WITH_OPENSSL */ -#ifdef WITH_OPENSSL -#include -#include -#include -#include -#else /* OPENSSL */ -#define BIGNUM void -#define DH void -#define EC_KEY void -#define EC_GROUP void -#endif /* WITH_OPENSSL */ - #define KEX_COOKIE_LEN 16 #define KEX_DH1 "diffie-hellman-group1-sha1" diff --git a/kexecdh.c b/kexecdh.c index be324a838..bcfa3b107 100644 --- a/kexecdh.c +++ b/kexecdh.c @@ -211,11 +211,9 @@ kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob, #else -#include - -#include "sshkey.h" -#include "kex.h" -#include "ssherr.h" +struct kex; +struct sshbuf; +struct sshkey; int kex_ecdh_keypair(struct kex *kex) diff --git a/krl.c b/krl.c index 10a8bcc87..a7f690955 100644 --- a/krl.c +++ b/krl.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "sshbuf.h" #include "ssherr.h" diff --git a/mac.c b/mac.c index de346ed20..f3dda6692 100644 --- a/mac.c +++ b/mac.c @@ -30,7 +30,6 @@ #include #include #include -#include #include "digest.h" #include "hmac.h" diff --git a/sandbox-systrace.c b/sandbox-systrace.c index add4c46d0..93e63b8e0 100644 --- a/sandbox-systrace.c +++ b/sandbox-systrace.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "atomicio.h" #include "log.h" diff --git a/ssh-keysign.c b/ssh-keysign.c index 3ede407d3..6cfd5b46c 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/sshconnect.c b/sshconnect.c index bcb732a32..6230dad32 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -56,7 +56,6 @@ #include "compat.h" #include "sshkey.h" #include "sshconnect.h" -#include "hostfile.h" #include "log.h" #include "misc.h" #include "readconf.h" -- cgit v1.2.3 From fa5bd8107e0e2b3e1e184f55d0f9320c119f65f0 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 2 Oct 2019 14:30:55 +1000 Subject: Put ssherr.h back as it's actually needed. --- kexecdh.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kexecdh.c') diff --git a/kexecdh.c b/kexecdh.c index bcfa3b107..efb2e55a6 100644 --- a/kexecdh.c +++ b/kexecdh.c @@ -211,6 +211,8 @@ kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob, #else +#include "ssherr.h" + struct kex; struct sshbuf; struct sshkey; -- cgit v1.2.3