diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2020-12-11 19:33:14 +0100 |
---|---|---|
committer | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2021-01-12 12:54:18 +0100 |
commit | d4258d1461d0acdca758f8df30d2f40ea6b7bf16 (patch) | |
tree | 182eefa383fca1a9d15a1f3d3df7d41b39d8a767 /src/CMakeLists.txt | |
parent | c50cfe7fc70e06a388139149a2ebab526d692919 (diff) | |
download | libssh-d4258d1461d0acdca758f8df30d2f40ea6b7bf16.tar.gz libssh-d4258d1461d0acdca758f8df30d2f40ea6b7bf16.tar.xz libssh-d4258d1461d0acdca758f8df30d2f40ea6b7bf16.zip |
libmbedcrypto: Fix chacha20-poly1305
Previously, the mbed TLS implementation wouldn't be use at all when
available, being the internal implementation always used instead.
This corrects few bugs and makes the mbed TLS implementation to be used
when ChaCha20 and Poly1305 are available.
This also makes the constant time comparison to be used when checking
the authentication tag.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f07a8933..0a91b45b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -211,10 +211,16 @@ elseif (WITH_MBEDTLS) external/fe25519.c external/ge25519.c external/sc25519.c - external/chacha.c - external/poly1305.c - chachapoly.c ) + if (NOT (HAVE_MBEDTLS_CHACHA20_H AND HAVE_MBEDTLS_POLY1305_H)) + set(libssh_SRCS + ${libssh_SRCS} + external/chacha.c + external/poly1305.c + chachapoly.c + ) + endif() + else (WITH_GCRYPT) set(libssh_SRCS ${libssh_SRCS} |