[PATCH 1/4] Fix --without-openssl with OpenSSL 1.1

Alex Xu alex_y_xu at yahoo.ca
Mon Jun 11 00:05:38 AEST 2018


One function declaration was removed, determined to be unused by `grep'.
---
 authfd.h | 2 --
 buffer.h | 4 ++++
 kex.h    | 8 +++++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/authfd.h b/authfd.h
index ab954ffc..848dbb32 100644
--- a/authfd.h
+++ b/authfd.h
@@ -36,8 +36,6 @@ int	ssh_update_card(int sock, int add, const char *reader_id,
 	    const char *pin, u_int life, u_int confirm);
 int	ssh_remove_all_identities(int sock, int version);
 
-int	ssh_decrypt_challenge(int sock, struct sshkey* key, BIGNUM *challenge,
-	    u_char session_id[16], u_char response[16]);
 int	ssh_agent_sign(int sock, const struct sshkey *key,
 	    u_char **sigp, size_t *lenp,
 	    const u_char *data, size_t datalen, const char *alg, u_int compat);
diff --git a/buffer.h b/buffer.h
index 56174394..0e788a2b 100644
--- a/buffer.h
+++ b/buffer.h
@@ -47,11 +47,13 @@ int	 buffer_get_ret(Buffer *, void *, u_int);
 int	 buffer_consume_ret(Buffer *, u_int);
 int	 buffer_consume_end_ret(Buffer *, u_int);
 
+#ifdef WITH_OPENSSL
 #include <openssl/objects.h>
 #include <openssl/bn.h>
 void    buffer_put_bignum2(Buffer *, const BIGNUM *);
 void	buffer_get_bignum2(Buffer *, BIGNUM *);
 void	buffer_put_bignum2_from_string(Buffer *, const u_char *, u_int);
+#endif
 
 u_short	buffer_get_short(Buffer *);
 void	buffer_put_short(Buffer *, u_short);
@@ -73,8 +75,10 @@ void	buffer_put_cstring(Buffer *, const char *);
 
 #define buffer_skip_string(b) (void)buffer_get_string_ptr(b, NULL);
 
+#ifdef WITH_OPENSSL
 int	buffer_put_bignum2_ret(Buffer *, const BIGNUM *);
 int	buffer_get_bignum2_ret(Buffer *, BIGNUM *);
+#endif
 int	buffer_get_short_ret(u_short *, Buffer *);
 int	buffer_get_int_ret(u_int *, Buffer *);
 int	buffer_get_int64_ret(u_int64_t *, Buffer *);
diff --git a/kex.h b/kex.h
index 01bb3986..ac4f0241 100644
--- a/kex.h
+++ b/kex.h
@@ -158,10 +158,12 @@ struct kex {
 	    const u_char *, size_t, const char *, u_int);
 	int	(*kex[KEX_MAX])(struct ssh *);
 	/* kex specific state */
+#ifdef WITH_OPENSSL
 	DH	*dh;			/* DH */
-	u_int	min, max, nbits;	/* GEX */
 	EC_KEY	*ec_client_key;		/* ECDH */
 	const EC_GROUP *ec_group;	/* ECDH */
+#endif
+	u_int	min, max, nbits;	/* GEX */
 	u_char c25519_client_key[CURVE25519_SIZE]; /* 25519 */
 	u_char c25519_client_pubkey[CURVE25519_SIZE]; /* 25519 */
 };
@@ -184,7 +186,9 @@ int	 kex_send_kexinit(struct ssh *);
 int	 kex_input_kexinit(int, u_int32_t, struct ssh *);
 int	 kex_input_ext_info(int, u_int32_t, struct ssh *);
 int	 kex_derive_keys(struct ssh *, u_char *, u_int, const struct sshbuf *);
+#ifdef WITH_OPENSSL
 int	 kex_derive_keys_bn(struct ssh *, u_char *, u_int, const BIGNUM *);
+#endif
 int	 kex_send_newkeys(struct ssh *);
 int	 kex_start_rekex(struct ssh *);
 
@@ -197,6 +201,7 @@ int	 kexecdh_server(struct ssh *);
 int	 kexc25519_client(struct ssh *);
 int	 kexc25519_server(struct ssh *);
 
+#ifdef WITH_OPENSSL
 int	 kex_dh_hash(int, const char *, const char *,
     const u_char *, size_t, const u_char *, size_t, const u_char *, size_t,
     const BIGNUM *, const BIGNUM *, const BIGNUM *, u_char *, size_t *);
@@ -211,6 +216,7 @@ int	 kexgex_hash(int, const char *, const char *,
 int kex_ecdh_hash(int, const EC_GROUP *, const char *, const char *,
     const u_char *, size_t, const u_char *, size_t, const u_char *, size_t,
     const EC_POINT *, const EC_POINT *, const BIGNUM *, u_char *, size_t *);
+#endif
 
 int	 kex_c25519_hash(int, const char *, const char *,
     const u_char *, size_t, const u_char *, size_t,
-- 
2.17.1



More information about the openssh-unix-dev mailing list