1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

libcrypto: detect non matching headers/shared lib

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2018-10-28 10:37:45 +01:00
committed by Andreas Schneider
parent 9546b20dec
commit 0197e5e1e5
2 changed files with 9 additions and 2 deletions

View File

@@ -143,7 +143,7 @@ void libssh_constructor(void)
* If the library is already initialized, increments the _ssh_initialized
* counter and return the error code cached in _ssh_init_ret.
*
* @returns 0 on success, -1 if an error occured.
* @returns SSH_OK on success, SSH_ERROR if an error occurred.
*/
int ssh_init(void) {
return _ssh_init(0);
@@ -188,7 +188,7 @@ _ret:
*
* This function is automatically called when the library is unloaded.
*
* @returns 0 on succes, -1 if an error occured.
* @returns SSH_OK on success, SSH_ERROR if an error occurred.
*
*/
void libssh_destructor(void)

View File

@@ -1052,6 +1052,13 @@ int ssh_crypto_init(void)
if (libcrypto_initialized) {
return SSH_OK;
}
if (SSLeay() != OPENSSL_VERSION_NUMBER){
SSH_LOG(SSH_LOG_WARNING, "libssh compiled with %s "
"headers, currently running with %s.",
OPENSSL_VERSION_TEXT,
SSLeay_version(SSLeay())
);
}
OpenSSL_add_all_algorithms();