1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

Runtime engine detection with libssh2_crypto_engine() (#643)

File:
version.c, HACKING-CRYPTO, libssh2.h, libssh2_crypto_engine.3, makefile.

Notes:
libssh2_crypto_engine() API to get crypto engine at runtime.

Credit: Bastien Durel
This commit is contained in:
Bastien Durel
2022-01-06 19:06:02 +01:00
committed by GitHub
parent 64a555d6f5
commit e24a4a9d48
6 changed files with 47 additions and 0 deletions

View File

@@ -940,8 +940,21 @@ LIBSSH2_API int libssh2_base64_decode(LIBSSH2_SESSION *session, char **dest,
LIBSSH2_API
const char *libssh2_version(int req_version_num);
typedef enum {
libssh2_no_crypto = 0,
libssh2_openssl,
libssh2_gcrypt,
libssh2_mbedtls,
libssh2_wincng
} libssh2_crypto_engine_t;
LIBSSH2_API
libssh2_crypto_engine_t libssh2_crypto_engine(void);
#define HAVE_LIBSSH2_KNOWNHOST_API 0x010101 /* since 1.1.1 */
#define HAVE_LIBSSH2_VERSION_API 0x010100 /* libssh2_version since 1.1 */
#define HAVE_LIBSSH2_CRYPTOENGINE_API 0x011100 /* libssh2_crypto_engine
since 1.11 */
struct libssh2_knownhost {
unsigned int magic; /* magic stored by the library */