mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-31 16:21:13 +03:00
chacha: fix build for mbedTLS
Fix the build for mbedTLS: * set HAVE_CHACHA for non-mbedTLS builds * only compile chachapoly.c when HAVE_CHACHA * use empty CHACHA20 in src/kex.c unless HAVE_CHACHA Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
c8d6445d44
commit
c089b700c6
@ -138,7 +138,8 @@ endif ()
|
|||||||
|
|
||||||
if (NOT WITH_MBEDTLS)
|
if (NOT WITH_MBEDTLS)
|
||||||
set(HAVE_DSA 1)
|
set(HAVE_DSA 1)
|
||||||
endif()
|
set(HAVE_CHACHA 1)
|
||||||
|
endif (NOT WITH_MBEDTLS)
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
|
|
||||||
|
@ -89,6 +89,9 @@
|
|||||||
/* Define to 1 if you have DSA */
|
/* Define to 1 if you have DSA */
|
||||||
#cmakedefine HAVE_DSA 1
|
#cmakedefine HAVE_DSA 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have chacha20-poly1305 */
|
||||||
|
#cmakedefine HAVE_CHACHA 1
|
||||||
|
|
||||||
/*************************** FUNCTIONS ***************************/
|
/*************************** FUNCTIONS ***************************/
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||||
|
@ -122,7 +122,6 @@ set(libssh_SRCS
|
|||||||
bignum.c
|
bignum.c
|
||||||
buffer.c
|
buffer.c
|
||||||
callbacks.c
|
callbacks.c
|
||||||
chachapoly.c
|
|
||||||
channels.c
|
channels.c
|
||||||
client.c
|
client.c
|
||||||
config.c
|
config.c
|
||||||
@ -167,6 +166,13 @@ set(libssh_SRCS
|
|||||||
external/sc25519.c
|
external/sc25519.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (NOT WITH_MBEDTLS)
|
||||||
|
set(libssh_SRCS
|
||||||
|
${libssh_SRCS}
|
||||||
|
chachapoly.c
|
||||||
|
)
|
||||||
|
endif (NOT WITH_MBEDTLS)
|
||||||
|
|
||||||
if (WITH_GCRYPT)
|
if (WITH_GCRYPT)
|
||||||
set(libssh_SRCS
|
set(libssh_SRCS
|
||||||
${libssh_SRCS}
|
${libssh_SRCS}
|
||||||
|
@ -95,7 +95,11 @@
|
|||||||
#define ECDH ""
|
#define ECDH ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CHACHA
|
||||||
#define CHACHA20 "chacha20-poly1305@openssh.com,"
|
#define CHACHA20 "chacha20-poly1305@openssh.com,"
|
||||||
|
#else /* HAVE_CHACHA */
|
||||||
|
#define CHACHA20
|
||||||
|
#endif /* HAVE_CHACHA */
|
||||||
|
|
||||||
#define KEY_EXCHANGE CURVE25519 ECDH "diffie-hellman-group14-sha1,diffie-hellman-group1-sha1"
|
#define KEY_EXCHANGE CURVE25519 ECDH "diffie-hellman-group14-sha1,diffie-hellman-group1-sha1"
|
||||||
#define KEX_METHODS_SIZE 10
|
#define KEX_METHODS_SIZE 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user