From 88137902632aceb923990e98cf5dc923bb3ef2f5 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 19 Aug 2014 11:28:11 +1000 Subject: - (djm) [sshbuf.h] Fix compilation on systems without OPENSSL_HAS_ECC. --- sshbuf.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'sshbuf.h') diff --git a/sshbuf.h b/sshbuf.h index 4561c063..3602bc53 100644 --- a/sshbuf.h +++ b/sshbuf.h @@ -21,8 +21,12 @@ #include #include #include -#include -#include +#ifdef WITH_OPENSSL +# include +# ifdef OPENSSL_HAS_ECC +# include +# endif /* OPENSSL_HAS_ECC */ +#endif /* WITH_OPENSSL */ #define SSHBUF_SIZE_MAX 0x8000000 /* Hard maximum size */ #define SSHBUF_REFS_MAX 0x100000 /* Max child buffers */ @@ -204,17 +208,19 @@ int sshbuf_peek_string_direct(const struct sshbuf *buf, const u_char **valp, * Functions to extract or store SSH wire encoded bignums and elliptic * curve points. */ +int sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len); +#ifdef WITH_OPENSSL int sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM *v); int sshbuf_get_bignum1(struct sshbuf *buf, BIGNUM *v); int sshbuf_put_bignum2(struct sshbuf *buf, const BIGNUM *v); int sshbuf_put_bignum1(struct sshbuf *buf, const BIGNUM *v); -int sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len); -#if !defined(WITH_OPENSSL) || defined(OPENSSL_HAS_ECC) +# ifdef OPENSSL_HAS_ECC int sshbuf_get_ec(struct sshbuf *buf, EC_POINT *v, const EC_GROUP *g); int sshbuf_get_eckey(struct sshbuf *buf, EC_KEY *v); int sshbuf_put_ec(struct sshbuf *buf, const EC_POINT *v, const EC_GROUP *g); int sshbuf_put_eckey(struct sshbuf *buf, const EC_KEY *v); -#endif +# endif /* OPENSSL_HAS_ECC */ +#endif /* WITH_OPENSSL */ /* Dump the contents of the buffer in a human-readable format */ void sshbuf_dump(struct sshbuf *buf, FILE *f); -- cgit v1.2.1