Unverified Commit 9b454fda authored by Leo Izen's avatar Leo Izen

avformat/libssh: avoid deprecated functions

Avoid using the deprecated functions ssh_try_publickey_from_file among
others in favor of symbols introduced in libssh 0.6.0 (Jan 2014) and
update configure to require this version.
Signed-off-by: 's avatarLeo Izen <leo.izen@gmail.com>
parent da1d5677
...@@ -6796,7 +6796,7 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli ...@@ -6796,7 +6796,7 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli
require libsmbclient libsmbclient.h smbc_init -lsmbclient; } require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
......
...@@ -84,12 +84,9 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user ...@@ -84,12 +84,9 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user
if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) { if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
if (libssh->priv_key) { if (libssh->priv_key) {
ssh_string pub_key; ssh_key priv_key;
ssh_private_key priv_key; if (ssh_pki_import_privkey_file(libssh->priv_key, password, NULL, NULL, &priv_key) == SSH_OK) {
int type; if (ssh_userauth_publickey(libssh->session, NULL, priv_key) == SSH_AUTH_SUCCESS) {
if (!ssh_try_publickey_from_file(libssh->session, libssh->priv_key, &pub_key, &type)) {
priv_key = privatekey_from_file(libssh->session, libssh->priv_key, type, password);
if (ssh_userauth_pubkey(libssh->session, NULL, pub_key, priv_key) == SSH_AUTH_SUCCESS) {
av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n"); av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n");
authorized = 1; authorized = 1;
} }
...@@ -97,7 +94,7 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user ...@@ -97,7 +94,7 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user
av_log(libssh, AV_LOG_DEBUG, "Invalid key is provided.\n"); av_log(libssh, AV_LOG_DEBUG, "Invalid key is provided.\n");
return AVERROR(EACCES); return AVERROR(EACCES);
} }
} else if (ssh_userauth_autopubkey(libssh->session, password) == SSH_AUTH_SUCCESS) { } else if (ssh_userauth_publickey_auto(libssh->session, NULL, password) == SSH_AUTH_SUCCESS) {
av_log(libssh, AV_LOG_DEBUG, "Authentication successful with auto selected key.\n"); av_log(libssh, AV_LOG_DEBUG, "Authentication successful with auto selected key.\n");
authorized = 1; authorized = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment