diff options
author | Damien Miller <djm@mindrot.org> | 2014-08-19 11:28:11 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-08-19 11:28:11 +1000 |
commit | 88137902632aceb923990e98cf5dc923bb3ef2f5 (patch) | |
tree | 7b2fb21e286382edbc21016c81279231c2d0c46b | |
parent | 2f3d1e7fb2eabd3cfbfd8d0f7bdd2f9a1888690b (diff) |
- (djm) [sshbuf.h] Fix compilation on systems without OPENSSL_HAS_ECC.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | sshbuf.h | 16 |
2 files changed, 12 insertions, 5 deletions
@@ -1,5 +1,6 @@ | |||
1 | 20140819 | 1 | 20140819 |
2 | - (djm) [serverloop.c] Fix syntax error on Cygwin; from Corinna Vinschen | 2 | - (djm) [serverloop.c] Fix syntax error on Cygwin; from Corinna Vinschen |
3 | - (djm) [sshbuf.h] Fix compilation on systems without OPENSSL_HAS_ECC. | ||
3 | 4 | ||
4 | 20140811 | 5 | 20140811 |
5 | - (djm) [myproposal.h] Make curve25519 KEX dependent on | 6 | - (djm) [myproposal.h] Make curve25519 KEX dependent on |
@@ -21,8 +21,12 @@ | |||
21 | #include <sys/types.h> | 21 | #include <sys/types.h> |
22 | #include <stdarg.h> | 22 | #include <stdarg.h> |
23 | #include <stdio.h> | 23 | #include <stdio.h> |
24 | #include <openssl/bn.h> | 24 | #ifdef WITH_OPENSSL |
25 | #include <openssl/ec.h> | 25 | # include <openssl/bn.h> |
26 | # ifdef OPENSSL_HAS_ECC | ||
27 | # include <openssl/ec.h> | ||
28 | # endif /* OPENSSL_HAS_ECC */ | ||
29 | #endif /* WITH_OPENSSL */ | ||
26 | 30 | ||
27 | #define SSHBUF_SIZE_MAX 0x8000000 /* Hard maximum size */ | 31 | #define SSHBUF_SIZE_MAX 0x8000000 /* Hard maximum size */ |
28 | #define SSHBUF_REFS_MAX 0x100000 /* Max child buffers */ | 32 | #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, | |||
204 | * Functions to extract or store SSH wire encoded bignums and elliptic | 208 | * Functions to extract or store SSH wire encoded bignums and elliptic |
205 | * curve points. | 209 | * curve points. |
206 | */ | 210 | */ |
211 | int sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len); | ||
212 | #ifdef WITH_OPENSSL | ||
207 | int sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM *v); | 213 | int sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM *v); |
208 | int sshbuf_get_bignum1(struct sshbuf *buf, BIGNUM *v); | 214 | int sshbuf_get_bignum1(struct sshbuf *buf, BIGNUM *v); |
209 | int sshbuf_put_bignum2(struct sshbuf *buf, const BIGNUM *v); | 215 | int sshbuf_put_bignum2(struct sshbuf *buf, const BIGNUM *v); |
210 | int sshbuf_put_bignum1(struct sshbuf *buf, const BIGNUM *v); | 216 | int sshbuf_put_bignum1(struct sshbuf *buf, const BIGNUM *v); |
211 | int sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len); | 217 | # ifdef OPENSSL_HAS_ECC |
212 | #if !defined(WITH_OPENSSL) || defined(OPENSSL_HAS_ECC) | ||
213 | int sshbuf_get_ec(struct sshbuf *buf, EC_POINT *v, const EC_GROUP *g); | 218 | int sshbuf_get_ec(struct sshbuf *buf, EC_POINT *v, const EC_GROUP *g); |
214 | int sshbuf_get_eckey(struct sshbuf *buf, EC_KEY *v); | 219 | int sshbuf_get_eckey(struct sshbuf *buf, EC_KEY *v); |
215 | int sshbuf_put_ec(struct sshbuf *buf, const EC_POINT *v, const EC_GROUP *g); | 220 | int sshbuf_put_ec(struct sshbuf *buf, const EC_POINT *v, const EC_GROUP *g); |
216 | int sshbuf_put_eckey(struct sshbuf *buf, const EC_KEY *v); | 221 | int sshbuf_put_eckey(struct sshbuf *buf, const EC_KEY *v); |
217 | #endif | 222 | # endif /* OPENSSL_HAS_ECC */ |
223 | #endif /* WITH_OPENSSL */ | ||
218 | 224 | ||
219 | /* Dump the contents of the buffer in a human-readable format */ | 225 | /* Dump the contents of the buffer in a human-readable format */ |
220 | void sshbuf_dump(struct sshbuf *buf, FILE *f); | 226 | void sshbuf_dump(struct sshbuf *buf, FILE *f); |