History

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.

Leo Izen committed 3 years ago

Commit 9b454fd1 parent da1d5672 files · +5 −8Browse files

Unified · Split

2 files
  1. configure +1 −1
  2. libavformat/libssh.c +4 −7
configure+1−1
@@ -6796,7 +6796,7 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli · 6795 unmodified lines
6796 require libsmbclient libsmbclient.h smbc_init -lsmbclient; }6796 require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
6797enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++6797enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
6798enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr6798enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
6799enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init6799enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
6800enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init6800enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
6801enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket6801enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
6802enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle6802enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
libavformat/libssh.c+4−7
@@ -84,12 +84,9 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user · 83 unmodified lines
84 84
85 if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {85 if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
86 if (libssh->priv_key) {86 if (libssh->priv_key) {
87 ssh_string pub_key;87 ssh_key priv_key;
88 ssh_private_key priv_key;88 if (ssh_pki_import_privkey_file(libssh->priv_key, password, NULL, NULL, &priv_key) == SSH_OK) {
89 int type;89 if (ssh_userauth_publickey(libssh->session, NULL, priv_key) == SSH_AUTH_SUCCESS) {
90 if (!ssh_try_publickey_from_file(libssh->session, libssh->priv_key, &pub_key, &type)) {
91 priv_key = privatekey_from_file(libssh->session, libssh->priv_key, type, password);
92 if (ssh_userauth_pubkey(libssh->session, NULL, pub_key, priv_key) == SSH_AUTH_SUCCESS) {
93 av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n");90 av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n");
94 authorized = 1;91 authorized = 1;
95 }92 }
@@ -97,7 +94,7 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user · 1 unmodified line
97 av_log(libssh, AV_LOG_DEBUG, "Invalid key is provided.\n");94 av_log(libssh, AV_LOG_DEBUG, "Invalid key is provided.\n");
98 return AVERROR(EACCES);95 return AVERROR(EACCES);
99 }96 }
100 } else if (ssh_userauth_autopubkey(libssh->session, password) == SSH_AUTH_SUCCESS) {97 } else if (ssh_userauth_publickey_auto(libssh->session, NULL, password) == SSH_AUTH_SUCCESS) {
101 av_log(libssh, AV_LOG_DEBUG, "Authentication successful with auto selected key.\n");98 av_log(libssh, AV_LOG_DEBUG, "Authentication successful with auto selected key.\n");
102 authorized = 1;99 authorized = 1;
103 }100 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t