mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
mbedtls: Warn about missing featues of mbedTLS build
The libssh requires mbedTLS to have support for threading. Given the way how the mbedTLS builds are configured (at least to my limited understanding), by modifying mbedtls_config.h header file, this changes the silent failure to a message on stderr pointing the user in the right direction. Fixes: #304 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -52,6 +52,12 @@ int crypto_thread_init(struct ssh_threads_callbacks_struct *user_callbacks)
|
||||
#elif defined MBEDTLS_THREADING_PTHREAD
|
||||
return SSH_OK;
|
||||
#else
|
||||
fprintf(stderr,
|
||||
"MbedTLS needs to have threading enabled with "
|
||||
"MBEDTLS_THREADING_PTHREAD or MBEDTLS_THREADING_ALT "
|
||||
"in mbedtls_config.h\n");
|
||||
#warn "MbedTLS needs to have threading enabled with " \
|
||||
"MBEDTLS_THREADING_PTHREAD or MBEDTLS_THREADING_ALT in mbedtls_config.h"
|
||||
return SSH_ERROR;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user