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 /ConfigureChecks.cmake | |
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 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 3bc9edca..384e7856 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -272,6 +272,12 @@ endif (GCRYPT_FOUND) if (MBEDTLS_FOUND) set(HAVE_LIBMBEDCRYPTO 1) set(HAVE_ECC 1) + + set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls") + check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H) + check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H) + unset(CMAKE_REQUIRED_INCLUDES) + endif (MBEDTLS_FOUND) if (CMAKE_USE_PTHREADS_INIT) |