libpcap_dep = dependency('', required: false)
endif
-libssh_version = '0.7'
+libssh_version = '0.8.1'
if conf.has('WITH_REMOTE')
libssh_dep = dependency('libssh', version: '>=' + libssh_version, required: get_option('libssh'))
if libssh_dep.found()
conf.set('WITH_LIBSSH', 1)
-
- # Check if new functions exists, if not redefine them with old deprecated ones.
- # List of [ new_function, deprecated_function ].
- functions = [
- [ 'ssh_get_server_publickey', 'ssh_get_publickey' ],
- [ 'ssh_session_is_known_server', 'ssh_is_server_known' ],
- [ 'ssh_session_update_known_hosts', 'ssh_write_knownhost' ],
- ]
- foreach name : functions
- if not cc.has_function(name[0], dependencies: libssh_dep)
- conf.set(name[0], name[1])
- endif
- endforeach
endif
else
libssh_dep = dependency('', required: false)
#define VIR_NET_LIBSSH_BUFFER_SIZE 1024
-#if LIBSSH_VERSION_INT < SSH_VERSION_INT(0, 8, 1)
-# define VIR_SSH_HOSTKEY_HASH SSH_PUBLICKEY_HASH_SHA1
-#else
-# define VIR_SSH_HOSTKEY_HASH SSH_PUBLICKEY_HASH_SHA256
-#endif
-
/* TRACE_LIBSSH=<level> enables tracing in libssh itself.
* The meaning of <level> is described here:
* https://api.libssh.org/master/group__libssh__log.html
/* calculate remote key hash, using SHA256 algorithm that is
* the default in modern OpenSSH, fallback to SHA1 for older
* libssh. The returned value must be freed */
- ret = ssh_get_publickey_hash(key, VIR_SSH_HOSTKEY_HASH,
+ ret = ssh_get_publickey_hash(key, SSH_PUBLICKEY_HASH_SHA256,
&keyhash, &keyhashlen);
ssh_key_free(key);
if (ret < 0) {