mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
build: be friendly with 3rd-party build tools
After recent build changes, 3rd party build that took the list of C source to compile them as-is, stopped working as expected, due to `blowfish.c` and crypto-backend C sources no longer expected to compile separately but via `bcrypt_pbkdf.c` and `crypto.c`, respectively. This patch ensures that compiling these files directly result in an empty object instead of redundant code and duplicated symbols. Also: - add a compile-time error if none of the supported crypto backends are enabled. - fix `libssh2_crypto_engine()` for wolfSSL and os400qc3. Rearrange code to avoid a hard-to-find copy of crypto-backend selection guards. Follow-up to4f0f4bff5aFollow-up toff3c774e03Closes #951
This commit is contained in:
22
src/crypto.h
22
src/crypto.h
@@ -40,22 +40,16 @@
|
||||
|
||||
#if defined(LIBSSH2_OPENSSL) || defined(LIBSSH2_WOLFSSL)
|
||||
#include "openssl.h"
|
||||
#endif
|
||||
|
||||
#ifdef LIBSSH2_LIBGCRYPT
|
||||
#elif defined(LIBSSH2_LIBGCRYPT)
|
||||
#include "libgcrypt.h"
|
||||
#endif
|
||||
|
||||
#ifdef LIBSSH2_WINCNG
|
||||
#include "wincng.h"
|
||||
#endif
|
||||
|
||||
#ifdef LIBSSH2_OS400QC3
|
||||
#include "os400qc3.h"
|
||||
#endif
|
||||
|
||||
#ifdef LIBSSH2_MBEDTLS
|
||||
#elif defined(LIBSSH2_MBEDTLS)
|
||||
#include "mbedtls.h"
|
||||
#elif defined(LIBSSH2_OS400QC3)
|
||||
#include "os400qc3.h"
|
||||
#elif defined(LIBSSH2_WINCNG)
|
||||
#include "wincng.h"
|
||||
#else
|
||||
#error "no cryptography backend selected"
|
||||
#endif
|
||||
|
||||
#ifdef LIBSSH2_NO_MD5
|
||||
|
||||
Reference in New Issue
Block a user