From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 99F4E475C0 for ; Wed, 13 Sep 2023 10:41:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B9B6D68C9B6; Wed, 13 Sep 2023 13:41:07 +0300 (EEST) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4371368C8C1 for ; Wed, 13 Sep 2023 13:41:01 +0300 (EEST) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-59bbe8d9bc0so712057b3.1 for ; Wed, 13 Sep 2023 03:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694601659; x=1695206459; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9aZ286/NLN7TCHMkQJoQ2lRzT3Vc8IIJab634kBYVKg=; b=C/OHyMbaC7aShkhITCpmNaCHGj54RKqPryCFLFBXtdUSe8YzRwM3+dUUESV+ftReX5 pff4uOVBJCOWlWx26jW7uOVTiZUqoCaKewx5tJo53n9r0N4vBdDMrAKP4j9+PdtrJqvH QjjftUtX4QcjJ0B2h54a1j4oZ+wAPmR738TbrrbX3pZ58U2n7pLBS19vigTrmpQGIDHv HuphYv1/kECJ1f119xPITFvEuG1iiiZ433thKoBhcK0hSDboYcOKk5Ah6KNf0lQinT7x qaBMK9SYQ+6HBi4yQw4jTDV7Z4omAv8CWjLHQaiL9XmvBNM/KWx9zdAqDbs/iVgDlnEF Inpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694601659; x=1695206459; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9aZ286/NLN7TCHMkQJoQ2lRzT3Vc8IIJab634kBYVKg=; b=N4MuVj34DgvKtcXKGJcvVtj4ZlsapS5/wmCjxJPoAFD0x+MwpWPEN+SQqL2v9iiOaj Tg5+JAZTdgDqTIZfDbJJYTcFgKdHaE8PoYRAFKHaXFALGSlgz1nCcBTwc3RpraFWPXhp rV+WzBW8T31jHNdu8L8WRg/yvFIYe7YdYc4kH4btiXzUBgsHoI5IOXlsl5NssrPKJ557 F5EDs2VV2hXq5R2CKh8qn/Z6PJYyn/waNfdf748kA889Brc5wKk3AHnykSNQ5GZOmIvr PNmP//GqxvF8v5MAI02Y+D7xQ2KLbu/ZnWTbVoL2VeGcoFFd/R/nQAIzYw8dPHdYugTE 58Hw== X-Gm-Message-State: AOJu0YyF5lTMul2zHALwp8V84RYrCGgJxWqqP6im9Hs5oT2XG6gSsPk8 m8dMbyZTJ2CIg4f9H0Peqz9GlDVkQeo= X-Google-Smtp-Source: AGHT+IHXu9LpnAEDzE049pb3uZFLAjcSHWlKqXJvMFCO4FtdYTFzBscTzTKAZvXTVfdpUl2uCZtI3g== X-Received: by 2002:a81:4812:0:b0:573:9743:a0a2 with SMTP id v18-20020a814812000000b005739743a0a2mr1960899ywa.1.1694601659626; Wed, 13 Sep 2023 03:40:59 -0700 (PDT) Received: from gauss.local (c-68-56-149-176.hsd1.mi.comcast.net. [68.56.149.176]) by smtp.gmail.com with ESMTPSA id n19-20020a819c53000000b0059b4e981fe6sm2967921ywa.102.2023.09.13.03.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 03:40:59 -0700 (PDT) From: Leo Izen To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Sep 2023 06:40:56 -0400 Message-ID: <20230913104056.40762-1-leo.izen@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/libssh: avoid deprecated functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Leo Izen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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: Leo Izen --- configure | 2 +- libavformat/libssh.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/configure b/configure index bd7f7697c8..48fee07f81 100755 --- a/configure +++ b/configure @@ -6796,7 +6796,7 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli require libsmbclient libsmbclient.h smbc_init -lsmbclient; } enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ 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 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 diff --git a/libavformat/libssh.c b/libavformat/libssh.c index 21474f0f0a..127faaabd3 100644 --- a/libavformat/libssh.c +++ b/libavformat/libssh.c @@ -84,12 +84,9 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) { if (libssh->priv_key) { - ssh_string pub_key; - ssh_private_key priv_key; - int type; - 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) { + ssh_key priv_key; + if (ssh_pki_import_privkey_file(libssh->priv_key, password, NULL, NULL, &priv_key) == SSH_OK) { + if (ssh_userauth_publickey(libssh->session, NULL, priv_key) == SSH_AUTH_SUCCESS) { av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n"); authorized = 1; } @@ -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"); 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"); authorized = 1; } -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".