aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2018-06-20 12:44:09 +0200
committerGitHub <noreply@github.com>2018-06-20 12:44:09 +0200
commitfb1dcb30a5ece0f8eab162f81a8ea89e428e9454 (patch)
tree6e9cf4b9723f8c327ffc86af37e52c28cfb2cce0
parentca0b9165d30b9b663f7a7f991fe20d576cb141bc (diff)
parentda7054759836fdaf169d37cb257dafdedbebca2f (diff)
Merge pull request #12005 from notspiff/remove_sftp
changed: remove internal sftp support
-rw-r--r--.travis.yml2
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/cpack/deb/copyright216
-rw-r--r--cmake/cpack/deb/packages/kodi.txt.in2
-rw-r--r--cmake/modules/FindSSH.cmake47
-rw-r--r--cmake/scripts/windows/ArchSetup.cmake2
-rw-r--r--docs/README.FreeBSD2
-rwxr-xr-xdocs/README.fedora2
-rw-r--r--docs/README.linux2
-rw-r--r--docs/README.opensuse4
-rw-r--r--docs/README.ubuntu2
-rw-r--r--project/BuildDependencies/scripts/0_package.target-win10-arm.list3
-rw-r--r--project/BuildDependencies/scripts/0_package.target-win10-win32.list1
-rw-r--r--project/BuildDependencies/scripts/0_package.target-win10-x64.list3
-rw-r--r--project/BuildDependencies/scripts/0_package.target-win32.list1
-rw-r--r--project/BuildDependencies/scripts/0_package.target-x64.list1
-rw-r--r--tools/depends/target/Makefile3
-rw-r--r--tools/depends/target/libssh/Makefile54
-rw-r--r--tools/depends/target/libssh/android.patch46
-rw-r--r--tools/depends/target/libssh/darwin-no-fork.patch36
-rw-r--r--tools/depends/target/libssh/darwin.patch17
-rw-r--r--tools/depends/target/libssh/fix-gcc-5-compile.patch55
-rw-r--r--tools/depends/target/libssh/md5.patch64
-rw-r--r--tools/depends/target/libssh/ntohl.patch12
-rw-r--r--tools/depends/target/libssh/pkg-config.patch10
-rw-r--r--tools/depends/target/libssh/removelegacy.patch10
-rw-r--r--xbmc/Application.cpp15
-rw-r--r--xbmc/filesystem/CMakeLists.txt7
-rw-r--r--xbmc/filesystem/DirectoryFactory.cpp6
-rw-r--r--xbmc/filesystem/FileFactory.cpp6
-rw-r--r--xbmc/filesystem/SFTPDirectory.cpp49
-rw-r--r--xbmc/filesystem/SFTPDirectory.h38
-rw-r--r--xbmc/filesystem/SFTPFile.cpp694
-rw-r--r--xbmc/filesystem/SFTPFile.h110
-rw-r--r--xbmc/network/GUIDialogNetworkSetup.cpp3
-rw-r--r--xbmc/network/ZeroconfBrowser.cpp1
-rw-r--r--xbmc/platform/darwin/DarwinUtils.h1
-rw-r--r--xbmc/platform/darwin/DarwinUtils.mm16
-rw-r--r--xbmc/utils/URIUtils.cpp1
39 files changed, 13 insertions, 1532 deletions
diff --git a/.travis.yml b/.travis.yml
index cdc092f6f1..a6074f9788 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -70,7 +70,7 @@ install:
gettext git-core gperf libasound2-dev libass-dev libbluray-dev libbz2-dev libcap-dev libcdio-dev libcec4-dev libcrossguid-dev libcurl3
libcurl4-openssl-dev libdbus-1-dev libfmt3-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev libgl1-mesa-dev
libglu1-mesa-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev
- libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev libsqlite3-dev libssh-dev
+ libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev libsqlite3-dev
libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev
libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils
nasm pmount python-dev python-imaging python-sqlite rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2aff11fb97..4350a82bd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,6 @@ set(optional_deps Alsa
Python
SmbClient
Sndio
- SSH
UDEV
XSLT
${PLATFORM_OPTIONAL_DEPS})
diff --git a/cmake/cpack/deb/copyright b/cmake/cpack/deb/copyright
index ba82f18883..3033afd865 100644
--- a/cmake/cpack/deb/copyright
+++ b/cmake/cpack/deb/copyright
@@ -1920,14 +1920,6 @@ Crystal HD
You should have received a copy of the GNU General Public License
along with this driver. If not, see <http://www.gnu.org/licenses/>.
-OpenSSH
-<http://www.openssh.org/>
-
- Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
- All rights reserved.
-
- See the section 'License: OpenSSH' for full license terms.
-
Enca - Extremely Naive Charset Analyser
<http://freshmeat.net/projects/enca/>
@@ -2916,211 +2908,3 @@ We are required to state that
CompuServe Incorporated."
-- End of IJG License --
-
-License: OpenSSH
-
-This file is part of the OpenSSH software.
-
-The licences which components of this software fall under are as
-follows. First, we will summarize and say that all components
-are under a BSD licence, or a licence more free than that.
-
-OpenSSH contains no GPL code.
-
-1)
- * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
- * All rights reserved
- *
- * As far as I am concerned, the code I have written for this software
- * can be used freely for any purpose. Any derived versions of this
- * software must be clearly marked as such, and if the derived work is
- * incompatible with the protocol description in the RFC file, it must be
- * called by a name other than "ssh" or "Secure Shell".
-
- [Tatu continues]
- * However, I am not implying to give any licenses to any patents or
- * copyrights held by third parties, and the software includes parts that
- * are not under my direct control. As far as I know, all included
- * source code is used in accordance with the relevant license agreements
- * and can be used freely for any purpose (the GNU license being the most
- * restrictive); see below for details.
-
- [However, none of that term is relevant at this point in time. All of
- these restrictively licenced software components which he talks about
- have been removed from OpenSSH, i.e.,
-
- - RSA is no longer included, found in the OpenSSL library
- - IDEA is no longer included, its use is deprecated
- - DES is now external, in the OpenSSL library
- - GMP is no longer used, and instead we call BN code from OpenSSL
- - Zlib is now external, in a library
- - The make-ssh-known-hosts script is no longer included
- - TSS has been removed
- - MD5 is now external, in the OpenSSL library
- - RC4 support has been replaced with ARC4 support from OpenSSL
- - Blowfish is now external, in the OpenSSL library
-
- [The licence continues]
-
- Note that any information and cryptographic algorithms used in this
- software are publicly available on the Internet and at any major
- bookstore, scientific library, and patent office worldwide. More
- information can be found e.g. at "http://www.cs.hut.fi/crypto".
-
- The legal status of this program is some combination of all these
- permissions and restrictions. Use only at your own responsibility.
- You will be responsible for any legal consequences yourself; I am not
- making any claims whether possessing or using this is legal or not in
- your country, and I am not taking any responsibility on your behalf.
-
-
- NO WARRANTY
-
- BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- REPAIR OR CORRECTION.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGES.
-
-2)
- The 32-bit CRC compensation attack detector in deattack.c was
- contributed by CORE SDI S.A. under a BSD-style license.
-
- * Cryptographic attack detector for ssh - source code
- *
- * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina.
- *
- * All rights reserved. Redistribution and use in source and binary
- * forms, with or without modification, are permitted provided that
- * this copyright notice is retained.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR
- * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS
- * SOFTWARE.
- *
- * Ariel Futoransky <futo@core-sdi.com>
- * <http://www.core-sdi.com>
-
-3)
- ssh-keyscan was contributed by David Mazieres under a BSD-style
- license.
-
- * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
- *
- * Modification and redistribution in source and binary forms is
- * permitted provided that due credit is given to the author and the
- * OpenBSD project by leaving this copyright notice intact.
-
-4)
- The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers
- and Paulo Barreto is in the public domain and distributed
- with the following license:
-
- * @version 3.0 (December 2000)
- *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
- *
- * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto@terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-5)
- One component of the ssh source code is under a 3-clause BSD license,
- held by the University of California, since we pulled these parts from
- original Berkeley code.
-
- * Copyright (c) 1983, 1990, 1992, 1993, 1995
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
-
-6)
- Remaining components of the software are provided under a standard
- 2-term BSD licence with the following names as copyright holders:
-
- Markus Friedl
- Theo de Raadt
- Niels Provos
- Dug Song
- Aaron Campbell
- Damien Miller
- Kevin Steves
- Daniel Kouril
- Wesley Griffin
- Per Allansson
- Nils Nordman
- Simon Wilkinson
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
--- End of OpenSSH License --
diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in
index 90ae9ea298..5ab89054cd 100644
--- a/cmake/cpack/deb/packages/kodi.txt.in
+++ b/cmake/cpack/deb/packages/kodi.txt.in
@@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all
PACKAGE_SECTION video
PACKAGE_PRIORITY optional
PACKAGE_SHLIBDEPS
-PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2
+PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2
PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1
PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame
PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone
diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake
deleted file mode 100644
index b88e769fe5..0000000000
--- a/cmake/modules/FindSSH.cmake
+++ /dev/null
@@ -1,47 +0,0 @@
-#.rst:
-# FindSSH
-# -------
-# Finds the SSH library
-#
-# This will define the following variables::
-#
-# SSH_FOUND - system has SSH
-# SSH_INCLUDE_DIRS - the SSH include directory
-# SSH_LIBRARIES - the SSH libraries
-# SSH_DEFINITIONS - the SSH definitions
-#
-# and the following imported targets::
-#
-# SSH::SSH - The SSH library
-
-if(PKG_CONFIG_FOUND)
- pkg_check_modules(PC_SSH libssh>=0.6 QUIET)
-endif()
-
-find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h
- PATHS ${PC_SSH_INCLUDEDIR})
-find_library(SSH_LIBRARY NAMES ssh
- PATHS ${PC_SSH_LIBDIR})
-
-set(SSH_VERSION ${PC_SSH_VERSION})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SSH
- REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR
- VERSION_VAR SSH_VERSION)
-
-if(SSH_FOUND)
- set(SSH_LIBRARIES ${SSH_LIBRARY})
- set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR})
- set(SSH_DEFINITIONS -DHAS_FILESYSTEM_SFTP=1)
-
- if(NOT TARGET SSH::SSH)
- add_library(SSH::SSH UNKNOWN IMPORTED)
- set_target_properties(SSH::SSH PROPERTIES
- IMPORTED_LOCATION "${SSH_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}"
- INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_SFTP=1)
- endif()
-endif()
-
-mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY)
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake
index 48d4a4738e..b94842f75f 100644
--- a/cmake/scripts/windows/ArchSetup.cmake
+++ b/cmake/scripts/windows/ArchSetup.cmake
@@ -87,7 +87,7 @@ foreach(_lib ${_nodefaultlibs_DEBUG})
endforeach()
# DELAYLOAD option
-set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll
+set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll
avcodec-58.dll avfilter-7.dll avformat-58.dll avutil-56.dll
postproc-55.dll swresample-3.dll swscale-5.dll d3dcompiler_47.dll)
foreach(_lib ${_delayloadlibs})
diff --git a/docs/README.FreeBSD b/docs/README.FreeBSD
index 1314730a55..4d752c670a 100644
--- a/docs/README.FreeBSD
+++ b/docs/README.FreeBSD
@@ -47,7 +47,7 @@ that are used to build Kodi packages on Debian/Ubuntu (with all supported
external libraries enabled).
$ pkg install taglib gstreamer1-vaapi hal libcapn \
-enca gawk gperf cmake zip nasm swig30 libssh openjdk8 libtool gettext-tools \
+enca gawk gperf cmake zip nasm swig30 openjdk8 libtool gettext-tools \
gmake pkgconf rapidjson mesa-libs doxygen glproto dri2proto dri3proto libass \
flac libcdio curl dbus fontconfig freetype2 fribidi \
libgcrypt gmp libgpg-error gnutls libidn libinotify lzo2 \
diff --git a/docs/README.fedora b/docs/README.fedora
index 69e05bd0c3..b9240ecd53 100755
--- a/docs/README.fedora
+++ b/docs/README.fedora
@@ -50,7 +50,7 @@ fribidi-devel giflib-devel \
libjpeg-turbo-devel libtool-ltdl-devel lzo-devel libmicrohttpd-devel \
libmpc-devel mariadb-devel libnfs-devel \
pcre-devel libplist-devel libpng12-devel \
-shairplay-devel libsmbclient-devel sqlite-devel libssh-devel openssl-devel ffmpeg-devel \
+shairplay-devel libsmbclient-devel sqlite-devel openssl-devel ffmpeg-devel \
taglib-devel tinyxml-devel libtool-ltdl-devel libudev-devel \
libusb-devel libva-devel libvdpau-devel libxml2-devel \
libXmu-devel libXrandr-devel libxslt-devel libXt-devel rapidjson-devel \
diff --git a/docs/README.linux b/docs/README.linux
index ee1c5b4cf4..e7e722010c 100644
--- a/docs/README.linux
+++ b/docs/README.linux
@@ -53,7 +53,7 @@ Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl,
libiso9660-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev,
libmpcdec-dev, libmysqlclient-dev, libnfs-dev,
libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev,
- libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssh-dev, libssl-dev, libswscale-dev,
+ libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libswscale-dev,
libtag1-dev (>= 1.8), libtinyxml-dev (>= 2.6.2), libtool, libudev-dev,
libusb-dev, libva-dev, libvdpau-dev, libxml2-dev,
libxmu-dev, libxrandr-dev, libxslt1-dev, libxt-dev, lsb-release, rapidjson-dev,
diff --git a/docs/README.opensuse b/docs/README.opensuse
index ba69543943..125db44f35 100644
--- a/docs/README.opensuse
+++ b/docs/README.opensuse
@@ -54,7 +54,7 @@ libvorbis-devel libmodplug-devel libcurl-devel flac-devel libbz2-devel libtiff-d
fribidi-devel sqlite3-devel libpng12-devel pcre-devel libcdio-devel libjasper-devel
libmicrohttpd-devel libsmbclient-devel python-devel gperf nasm tinyxml-devel libtag-devel libbluray-devel
libnfs-devel shairplay-devel swig libvdpau-devel libavahi-devel libcec-devel libdvdread-devel libva-devel libplist-devel
-libxst-devel alsa-devel libpulse-devel libXrandr-devel libXrender-devel randrproto-devel renderproto-devel libssh-devel
+libxst-devel alsa-devel libpulse-devel libXrandr-devel libXrender-devel randrproto-devel renderproto-devel
libudev-devel libpcap-devel libgudev-1_0-devel libcap-ng-devel libcap-devel ccache doxygen capi4linux-devel liblcms2-devel
libunistring-devel
@@ -69,7 +69,7 @@ Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl,
libiso9660-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev,
libmpcdec-dev, libmysqlclient-dev, libnfs-dev,
libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev,
- libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssh-dev, libssl-dev, libswscale-dev,
+ libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libswscale-dev,
libtag1-dev (>= 1.8), libtinyxml-dev (>= 2.6.2), libtool, libudev-dev,
libusb-dev, libva-dev, libvdpau-dev, libxml2-dev,
libxmu-dev, libxrandr-dev, libxslt1-dev, libxt-dev, libyajl-dev (>=2.0), lsb-release,
diff --git a/docs/README.ubuntu b/docs/README.ubuntu
index fba3d86cf9..313d9053d1 100644
--- a/docs/README.ubuntu
+++ b/docs/README.ubuntu
@@ -88,7 +88,7 @@ For Ubuntu (all versions >= 7.04):
libfribidi-dev libgif-dev libiso9660-dev libjpeg-dev liblzo2-dev \
libmicrohttpd-dev libmysqlclient-dev libnfs-dev \
libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev \
- libsqlite3-dev libssh-dev libssl-dev libtinyxml-dev libtool libudev-dev libusb-dev \
+ libsqlite3-dev libssl-dev libtinyxml-dev libtool libudev-dev libusb-dev \
libva-dev libvdpau-dev libxml2-dev libxmu-dev libxrandr-dev \
libxrender-dev libxslt1-dev libxt-dev mesa-utils nasm pmount python-dev python-imaging \
python-sqlite rapidjson-dev swig uuid-dev yasm zlib1g-dev liblirc-dev
diff --git a/project/BuildDependencies/scripts/0_package.target-win10-arm.list b/project/BuildDependencies/scripts/0_package.target-win10-arm.list
index a7874357c7..8ac20dd94a 100644
--- a/project/BuildDependencies/scripts/0_package.target-win10-arm.list
+++ b/project/BuildDependencies/scripts/0_package.target-win10-arm.list
@@ -22,7 +22,6 @@ libiconv-1.15-win10-ARM-v141.7z
libmicrohttpd-0.9.55-win10-ARM-v140.7z
libnfs-1.11.0-win10-ARM-v140.7z
libplist-1.12-win10-ARM-v140.7z
-libssh-0.7.0-v1-win10-ARM-v140.7z
libxml2-2.9.4-win10-ARM-v141.7z
libxslt-1.1.29-win10-ARM-v140.7z
lzo2-2.09-win10-ARM-v140.7z
@@ -38,4 +37,4 @@ shairplay-ce80e00-win10-ARM-v140.7z
sqlite-3170000-win10-ARM-v140.7z
taglib-1.11.1-win10-ARM-v140.7z
tinyxml-2.6.2-win10-ARM-v140.7z
-zlib-1.2.11-win10-ARM-v140.7z \ No newline at end of file
+zlib-1.2.11-win10-ARM-v140.7z
diff --git a/project/BuildDependencies/scripts/0_package.target-win10-win32.list b/project/BuildDependencies/scripts/0_package.target-win10-win32.list
index 67ba2bf86a..73ec8a18f9 100644
--- a/project/BuildDependencies/scripts/0_package.target-win10-win32.list
+++ b/project/BuildDependencies/scripts/0_package.target-win10-win32.list
@@ -22,7 +22,6 @@ libiconv-1.15-win10-Win32-v141.7z
libmicrohttpd-0.9.55-win10-Win32-v140.7z
libnfs-1.11.0-win10-Win32-v140.7z
libplist-1.12-win10-Win32-v140.7z
-libssh-0.7.0-v1-win10-Win32-v140.7z
libxml2-2.9.4-win10-Win32-v141.7z
libxslt-1.1.29-win10-Win32-v140.7z
lzo2-2.09-win10-Win32-v140.7z
diff --git a/project/BuildDependencies/scripts/0_package.target-win10-x64.list b/project/BuildDependencies/scripts/0_package.target-win10-x64.list
index b32aca19b4..77bd661027 100644
--- a/project/BuildDependencies/scripts/0_package.target-win10-x64.list
+++ b/project/BuildDependencies/scripts/0_package.target-win10-x64.list
@@ -22,7 +22,6 @@ libiconv-1.15-win10-x64-v141.7z
libmicrohttpd-0.9.55-win10-x64-v140.7z
libnfs-1.11.0-win10-x64-v140.7z
libplist-1.12-win10-x64-v140.7z
-libssh-0.7.0-v1-win10-x64-v140.7z
libxml2-2.9.4-win10-x64-v141.7z
libxslt-1.1.29-win10-x64-v140.7z
lzo2-2.09-win10-x64-v140.7z
@@ -38,4 +37,4 @@ shairplay-ce80e00-win10-x64-v140.7z
sqlite-3170000-win10-x64-v140.7z
taglib-1.11.1-win10-x64-v140.7z
tinyxml-2.6.2-win10-x64-v140.7z
-zlib-1.2.11-win10-x64-v140.7z \ No newline at end of file
+zlib-1.2.11-win10-x64-v140.7z
diff --git a/project/BuildDependencies/scripts/0_package.target-win32.list b/project/BuildDependencies/scripts/0_package.target-win32.list
index 5f1bd083b5..8eeee86e45 100644
--- a/project/BuildDependencies/scripts/0_package.target-win32.list
+++ b/project/BuildDependencies/scripts/0_package.target-win32.list
@@ -27,7 +27,6 @@ libmicrohttpd-0.9.55-win32-vc140.7z
libnfs-1.10.0-win32.7z
libplist-1.13.0-win32-vc140.7z
libpng-1.6.21-win32-vc140.7z
-libssh-0.7.0-win32-vc140.7z
libxml2-2.9.4-win32-vc140-v2.7z
libxslt-1.1.29-win32-vc140.7z
lzo-2.09-win32-vc140-v3.7z
diff --git a/project/BuildDependencies/scripts/0_package.target-x64.list b/project/BuildDependencies/scripts/0_package.target-x64.list
index a4a27add7b..a3151a7109 100644
--- a/project/BuildDependencies/scripts/0_package.target-x64.list
+++ b/project/BuildDependencies/scripts/0_package.target-x64.list
@@ -24,7 +24,6 @@ libiconv-1.15-x64-vc140.7z
libmicrohttpd-0.9.55-x64-vc140.7z
libnfs-1.11.0-x64-vc140-v2.7z
libplist-1.12-x64-vc140.7z
-libssh-0.7.4-x64-vc140.7z
libxml2-2.9.4-x64-vc140.7z
libxslt-1.1.29-x64-vc140.7z
lzo-2.09-x64-vc140.7z
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
index 4cd6060c60..f2028b235b 100644
--- a/tools/depends/target/Makefile
+++ b/tools/depends/target/Makefile
@@ -12,7 +12,7 @@ DEPENDS = \
libxml2 rapidjson libmicrohttpd mariadb libffi \
python27 libshairplay libfmt \
libplist libcec libbluray tinyxml \
- libssh taglib libusb libnfs \
+ taglib libusb libnfs \
pythonmodule-pil pythonmodule-pycryptodome pythonmodule-setuptools \
libxslt ffmpeg platform crossguid \
libdvdread libdvdnav libdvdcss p8-platform
@@ -99,7 +99,6 @@ libcdio: $(ICONV)
libcdio-gplv3: $(ICONV)
libplist: $(ZLIB)
libbluray: $(ICONV) libxml2
-libssh: libgcrypt openssl $(ZLIB)
mariadb: openssl $(ICONV) $(ZLIB)
libzip: $(ZLIB)
libpng: $(ZLIB)
diff --git a/tools/depends/target/libssh/Makefile b/tools/depends/target/libssh/Makefile
deleted file mode 100644
index 405bd210df..0000000000
--- a/tools/depends/target/libssh/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-include ../../Makefile.include
-DEPS= ../../Makefile.include Makefile removelegacy.patch android.patch darwin.patch darwin-no-fork.patch fix-gcc-5-compile.patch ntohl.patch md5.patch pkg-config.patch
-
-# lib name, version
-LIBNAME=libssh
-VERSION=0.7.0a
-SOURCE=$(LIBNAME)-$(VERSION)
-ARCHIVE=$(SOURCE).tar.gz
-
-LIBDYLIB=$(PLATFORM)/build/src/$(LIBNAME).a
-
-ifeq ($(OS),ios)
-#_tlv_bootstrap aka __thread is private under ios/tvos. That is thread local storage, so disable it
-CMAKE_EXTRAFLAGS=-DHAVE_GCC_THREAD_LOCAL_STORAGE=0
-endif
-
-all: .installed-$(PLATFORM)
-
-$(TARBALLS_LOCATION)/$(ARCHIVE):
- cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
-
-$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
- rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
- cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- cd $(PLATFORM); rm -rf build; mkdir -p build
- cd $(PLATFORM); patch -p0 < ../removelegacy.patch
- cd $(PLATFORM); patch -p0 < ../android.patch
- cd $(PLATFORM); patch -p0 < ../ntohl.patch
- cd $(PLATFORM); patch -p0 < ../md5.patch
- cd $(PLATFORM); patch -p1 < ../darwin.patch
- cd $(PLATFORM); patch -p0 < ../fix-gcc-5-compile.patch
- cd $(PLATFORM); patch -p0 < ../pkg-config.patch
-ifeq ($(OS),ios)
- cd $(PLATFORM); patch -p1 < ../darwin-no-fork.patch
-endif
- sed -ie "s|-fstack-protector|-fno-stack-protector|" "$(PLATFORM)/cmake/Modules/DefineCompilerFlags.cmake"
- sed -ie "s|add_subdirectory(examples)||" "$(PLATFORM)/CMakeLists.txt"
- cd $(PLATFORM)/build; $(CMAKE) -DWITH_STATIC_LIB=1 -DWITH_EXAMPLES=0 -DTHREADS_PTHREAD_ARG=0 $(CMAKE_EXTRAFLAGS) -DWITH_GSSAPI=0 VERBOSE=1 ..
-
-$(LIBDYLIB): $(PLATFORM)
- $(MAKE) -j 1 -C $(PLATFORM)/build
-
-.installed-$(PLATFORM): $(LIBDYLIB)
- $(MAKE) -C $(PLATFORM)/build install
- rm -f $(PREFIX)/lib/libssh.so $(PREFIX)/lib/libssh.so.4.3.0 $(PREFIX)/lib/libssh.so.4
- rm -f $(PREFIX)/lib/libssh.*dylib*
- rm -f $(PREFIX)/lib/libssh_threads.*dylib*
- touch $@
-
-clean:
- rm -rf $(PLATFORM) .installed-$(PLATFORM)
-
-distclean::
- rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/target/libssh/android.patch b/tools/depends/target/libssh/android.patch
deleted file mode 100644
index 8df5945608..0000000000
--- a/tools/depends/target/libssh/android.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- src/misc.c 2011-05-31 10:29:52.000000000 -0400
-+++ src/misc.c 2013-01-03 00:37:37.652737345 -0500
-@@ -207,6 +208,9 @@
-
- char *ssh_get_user_home_dir(void) {
- char *szPath = NULL;
-+#ifdef ANDROID
-+ return strdup(getenv("HOME"));
-+#else
- struct passwd pwd;
- struct passwd *pwdbuf;
- char buf[NSS_BUFLEN_PASSWD];
-@@ -225,7 +222,7 @@
- }
-
- szPath = strdup(pwd.pw_dir);
--
-+#endif
- return szPath;
- }
-
-@@ -239,6 +236,17 @@
- }
-
- char *ssh_get_local_username(void) {
-+#ifdef ANDROID
-+ char *name = NULL;
-+ struct passwd *pwd = NULL;
-+ pwd = getpwuid(getuid());
-+ if ( pwd == NULL) {
-+ return NULL;
-+ }
-+
-+ name = strdup(pwd->pw_name);
-+
-+#else
- struct passwd pwd;
- struct passwd *pwdbuf;
- char buf[NSS_BUFLEN_PASSWD];
-@@ -252,6 +264,7 @@
-
- name = strdup(pwd.pw_name);
-
-+#endif
- if (name == NULL) {
- return NULL;
diff --git a/tools/depends/target/libssh/darwin-no-fork.patch b/tools/depends/target/libssh/darwin-no-fork.patch
deleted file mode 100644
index f3bdf8844a..0000000000
--- a/tools/depends/target/libssh/darwin-no-fork.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/src/socket.c-org 2015-09-20 17:19:13.000000000 -0400
-+++ b/src/socket.c 2015-09-20 17:19:56.000000000 -0400
-@@ -797,7 +797,7 @@ int ssh_socket_connect(ssh_socket s, con
- return SSH_OK;
- }
-
--#ifndef _WIN32
-+#if 0
- /**
- * @internal
- * @brief executes a command and redirect input and outputs
---- a/include/libssh/socket.h-org 2015-09-20 17:19:28.000000000 -0400
-+++ b/include/libssh/socket.h 2015-09-20 17:20:49.000000000 -0400
-@@ -37,9 +37,11 @@ void ssh_socket_set_fd(ssh_socket s, soc
- socket_t ssh_socket_get_fd_in(ssh_socket s);
- #ifndef _WIN32
- int ssh_socket_unix(ssh_socket s, const char *path);
-+#if 0
- void ssh_execute_command(const char *command, socket_t in, socket_t out);
- int ssh_socket_connect_proxycommand(ssh_socket s, const char *command);
- #endif
-+#endif
- void ssh_socket_close(ssh_socket s);
- int ssh_socket_write(ssh_socket s,const void *buffer, int len);
- int ssh_socket_is_open(ssh_socket s);
---- a/src/client.c-org 2015-09-20 17:19:37.000000000 -0400
-+++ b/src/client.c 2015-09-20 17:20:04.000000000 -0400
-@@ -518,7 +518,7 @@ int ssh_connect(ssh_session session) {
- session->session_state=SSH_SESSION_STATE_SOCKET_CONNECTED;
- ssh_socket_set_fd(session->socket, session->opts.fd);
- ret=SSH_OK;
--#ifndef _WIN32
-+#if 0
- } else if (session->opts.ProxyCommand != NULL){
- ret = ssh_socket_connect_proxycommand(session->socket,
- session->opts.ProxyCommand);
diff --git a/tools/depends/target/libssh/darwin.patch b/tools/depends/target/libssh/darwin.patch
deleted file mode 100644
index 2f37854a10..0000000000
--- a/tools/depends/target/libssh/darwin.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/ConfigureChecks.cmake 2014-12-27 04:30:13.000000000 -0600
-+++ b/ConfigureChecks.cmake 2015-01-07 12:20:43.000000000 -0600
-@@ -104,8 +104,14 @@
- check_function_exists(poll HAVE_POLL)
- check_function_exists(select HAVE_SELECT)
- check_function_exists(getaddrinfo HAVE_GETADDRINFO)
-+
-+if (APPLE)
-+check_symbol_exists(ntohll sys/_endian.h HAVE_NTOHLL)
-+check_symbol_exists(htonll sys/_endian.h HAVE_HTONLL)
-+else (APPLE)
- check_function_exists(ntohll HAVE_NTOHLL)
- check_function_exists(htonll HAVE_HTONLL)
-+endif(APPLE)
-
- if (WIN32)
- check_function_exists(_strtoui64 HAVE__STRTOUI64)
diff --git a/tools/depends/target/libssh/fix-gcc-5-compile.patch b/tools/depends/target/libssh/fix-gcc-5-compile.patch
deleted file mode 100644
index d015a9be6c..0000000000
--- a/tools/depends/target/libssh/fix-gcc-5-compile.patch
+++ /dev/null
@@ -1,55 +0,0 @@
---- include/libssh/pki_priv.h 2015-11-05 09:39:40.011875890 +0100
-+++ include/libssh/pki_priv.h 2015-11-05 09:39:34.151849945 +0100
-@@ -29,7 +29,7 @@
- #define ECDSA_HEADER_END "-----END EC PRIVATE KEY-----"
-
- #define ssh_pki_log(...) \
-- _ssh_pki_log(__FUNCTION__, __VA_ARGS__)
-+ _ssh_pki_log(__extension__ __FUNCTION__, __VA_ARGS__)
- void _ssh_pki_log(const char *function,
- const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
-
---- include/libssh/priv.h 2015-11-05 09:39:40.011875890 +0100
-+++ include/libssh/priv.h 2015-11-05 09:41:01.272239916 +0100
-@@ -179,7 +179,7 @@
- const char *function,
- const char *buffer);
- #define SSH_LOG(priority, ...) \
-- _ssh_log(priority, __FUNCTION__, __VA_ARGS__)
-+ _ssh_log(priority, __extension__ __FUNCTION__, __VA_ARGS__)
-
- /* LEGACY */
- void ssh_log_common(struct ssh_common_struct *common,
-@@ -197,18 +197,18 @@
- };
-
- #define ssh_set_error(error, code, ...) \
-- _ssh_set_error(error, code, __FUNCTION__, __VA_ARGS__)
-+ _ssh_set_error(error, code, __extension__ __FUNCTION__, __VA_ARGS__)
- void _ssh_set_error(void *error,
- int code,
- const char *function,
- const char *descr, ...) PRINTF_ATTRIBUTE(4, 5);
-
- #define ssh_set_error_oom(error) \
-- _ssh_set_error_oom(error, __FUNCTION__)
-+ _ssh_set_error_oom(error, __extension__ __FUNCTION__)
- void _ssh_set_error_oom(void *error, const char *function);
-
- #define ssh_set_error_invalid(error) \
-- _ssh_set_error_invalid(error, __FUNCTION__)
-+ _ssh_set_error_invalid(error, __extension__ __FUNCTION__)
- void _ssh_set_error_invalid(void *error, const char *function);
-
-
---- src/auth.c 2014-12-27 11:30:13.000000000 +0100
-+++ src/auth.c 2015-11-05 09:42:41.732698584 +0100
-@@ -1548,7 +1548,7 @@
- * This should not happen
- */
- rc = SSH_AUTH_ERROR;
-- ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __FUNCTION__);
-+ ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __extension__ __FUNCTION__);
- }
- return rc;
- }
diff --git a/tools/depends/target/libssh/md5.patch b/tools/depends/target/libssh/md5.patch
deleted file mode 100644
index 84f4bec0ef..0000000000
--- a/tools/depends/target/libssh/md5.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- include/libssh/wrapper.h.orig 2014-12-27 12:03:55.521114159 +0100
-+++ include/libssh/wrapper.h 2014-12-27 12:06:35.072310640 +0100
-@@ -52,7 +52,7 @@
- };
-
- typedef struct ssh_mac_ctx_struct *ssh_mac_ctx;
--MD5CTX md5_init(void);
-+MD5CTX ssh_md5_init(void);
- void md5_update(MD5CTX c, const void *data, unsigned long len);
- void md5_final(unsigned char *md,MD5CTX c);
-
---- src/dh.c.orig 2014-12-27 12:08:07.441537435 +0100
-+++ src/dh.c 2014-12-27 12:09:25.539205892 +0100
-@@ -906,7 +906,7 @@
- return SSH_ERROR;
- }
-
-- ctx = md5_init();
-+ ctx = ssh_md5_init();
- if (ctx == NULL) {
- SAFE_FREE(h);
- return SSH_ERROR;
-@@ -1037,7 +1037,7 @@
- goto out;
- }
-
-- ctx = md5_init();
-+ ctx = ssh_md5_init();
- if (ctx == NULL) {
- free(h);
- rc = -1;
---- src/kex1.c.orig 2014-12-27 12:11:18.307842585 +0100
-+++ src/kex1.c 2014-12-27 12:11:38.999225682 +0100
-@@ -78,7 +78,7 @@
- ssh_string hostn) {
- MD5CTX md5 = NULL;
-
-- md5 = md5_init();
-+ md5 = ssh_md5_init();
- if (md5 == NULL) {
- return -1;
- }
---- src/libcrypto.c.orig 2014-12-27 12:12:40.977378184 +0100
-+++ src/libcrypto.c 2014-12-27 12:13:14.716372667 +0100
-@@ -234,7 +234,7 @@
- SHA512(digest, len, hash);
- }
-
--MD5CTX md5_init(void) {
-+MD5CTX ssh_md5_init(void) {
- MD5CTX c = malloc(sizeof(*c));
- if (c == NULL) {
- return NULL;
---- src/libgcrypt.c.orig 2014-12-27 12:13:46.319430927 +0100
-+++ src/libgcrypt.c 2014-12-27 12:13:59.611034883 +0100
-@@ -132,7 +132,7 @@
- gcry_md_hash_buffer(GCRY_MD_SHA512, hash, digest, len);
- }
-
--MD5CTX md5_init(void) {
-+MD5CTX ssh_md5_init(void) {
- MD5CTX c = NULL;
- gcry_md_open(&c, GCRY_MD_MD5, 0);
-
diff --git a/tools/depends/target/libssh/ntohl.patch b/tools/depends/target/libssh/ntohl.patch
deleted file mode 100644
index 2c0c0272a2..0000000000
--- a/tools/depends/target/libssh/ntohl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/packet_cb.c.orig 2014-12-26 09:41:09.220220531 +0100
-+++ src/packet_cb.c 2014-12-26 09:39:49.850555189 +0100
-@@ -36,6 +36,9 @@
- #include "libssh/socket.h"
- #include "libssh/ssh2.h"
- #include "libssh/curve25519.h"
-+#ifdef ANDROID
-+#include <sys/endian.h>
-+#endif
-
-
- /**
diff --git a/tools/depends/target/libssh/pkg-config.patch b/tools/depends/target/libssh/pkg-config.patch
deleted file mode 100644
index b87e8a866b..0000000000
--- a/tools/depends/target/libssh/pkg-config.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- libssh.pc.cmake.orig 2014-12-27 11:30:13.000000000 +0100
-+++ libssh.pc.cmake 2016-01-11 15:12:20.556549666 +0100
-@@ -1,6 +1,6 @@
- Name: ${APPLICATION_NAME}
- Description: The SSH Library
- Version: ${APPLICATION_VERSION}
--Libs: -L${LIB_INSTALL_DIR} -lssh
-+Libs: -L${LIB_INSTALL_DIR} -lssh -lcrypto
- Cflags: -I${INCLUDE_INSTALL_DIR}
-
diff --git a/tools/depends/target/libssh/removelegacy.patch b/tools/depends/target/libssh/removelegacy.patch
deleted file mode 100644
index 69683cb869..0000000000
--- a/tools/depends/target/libssh/removelegacy.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/CMakeLists.txt 2011-06-16 19:04:44.000000000 +0200
-+++ src/CMakeLists.txt 2011-06-16 19:03:40.000000000 +0200
-@@ -94,7 +94,6 @@
- keyfiles.c
- keys.c
- known_hosts.c
-- legacy.c
- libcrypto.c
- libgcrypt.c
- log.c
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index c33a3c1760..0f281bdf24 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -112,9 +112,6 @@
#ifdef HAS_FILESYSTEM_NFS
#include "filesystem/NFSFile.h"
#endif
-#ifdef HAS_FILESYSTEM_SFTP
-#include "filesystem/SFTPFile.h"
-#endif
#include "PartyModeManager.h"
#include "network/ZeroconfBrowser.h"
#ifndef TARGET_POSIX
@@ -2879,10 +2876,6 @@ void CApplication::Stop(int exitCode)
}
#endif
-#ifdef HAS_FILESYSTEM_SFTP
- CSFTPSessionManager::DisconnectAllSessions();
-#endif
-
for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances())
vfsAddon->DisconnectAll();
@@ -4390,10 +4383,6 @@ void CApplication::ProcessSlow()
gNfsConnection.CheckIfIdle();
#endif
-#ifdef HAS_FILESYSTEM_SFTP
- CSFTPSessionManager::ClearOutIdleSessions();
-#endif
-
for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances())
vfsAddon->ClearOutIdle();
@@ -5055,10 +5044,6 @@ void CApplication::CloseNetworkShares()
gNfsConnection.Deinit();
#endif
-#ifdef HAS_FILESYSTEM_SFTP
- CSFTPSessionManager::DisconnectAllSessions();
-#endif
-
for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances())
vfsAddon->DisconnectAll();
}
diff --git a/xbmc/filesystem/CMakeLists.txt b/xbmc/filesystem/CMakeLists.txt
index e07e0c6bb1..0575103166 100644
--- a/xbmc/filesystem/CMakeLists.txt
+++ b/xbmc/filesystem/CMakeLists.txt
@@ -155,13 +155,6 @@ if(NFS_FOUND)
NFSFile.h)
endif()
-if(SSH_FOUND)
- list(APPEND SOURCES SFTPDirectory.cpp
- SFTPFile.cpp)
- list(APPEND SOURCES SFTPDirectory.h
- SFTPFile.h)
-endif()
-
if(ENABLE_UPNP)
list(APPEND SOURCES NptXbmcFile.cpp
UPnPDirectory.cpp
diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp
index fd432433da..a2a3b2bcd0 100644
--- a/xbmc/filesystem/DirectoryFactory.cpp
+++ b/xbmc/filesystem/DirectoryFactory.cpp
@@ -74,9 +74,6 @@
#ifdef HAS_ZEROCONF
#include "ZeroconfDirectory.h"
#endif
-#ifdef HAS_FILESYSTEM_SFTP
-#include "SFTPDirectory.h"
-#endif
#ifdef HAS_FILESYSTEM_NFS
#include "NFSDirectory.h"
#endif
@@ -158,9 +155,6 @@ IDirectory* CDirectoryFactory::Create(const CURL& url)
if (url.IsProtocol("ftp") || url.IsProtocol("ftps")) return new CFTPDirectory();
if (url.IsProtocol("http") || url.IsProtocol("https")) return new CHTTPDirectory();
if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVDirectory();
-#ifdef HAS_FILESYSTEM_SFTP
- if (url.IsProtocol("sftp") || url.IsProtocol("ssh")) return new CSFTPDirectory();
-#endif
#ifdef HAS_FILESYSTEM_SMB
#ifdef TARGET_WINDOWS
if (url.IsProtocol("smb")) return new CWin32SMBDirectory();
diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp
index b76c41baea..7242f11c05 100644
--- a/xbmc/filesystem/FileFactory.cpp
+++ b/xbmc/filesystem/FileFactory.cpp
@@ -45,9 +45,6 @@
#endif
#include "XbtFile.h"
#include "ZipFile.h"
-#ifdef HAS_FILESYSTEM_SFTP
-#include "SFTPFile.h"
-#endif
#ifdef HAS_FILESYSTEM_NFS
#include "NFSFile.h"
#endif
@@ -154,9 +151,6 @@ IFile* CFileFactory::CreateLoader(const CURL& url)
|| url.IsProtocol("http")
|| url.IsProtocol("https")) return new CCurlFile();
else if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVFile();
-#ifdef HAS_FILESYSTEM_SFTP
- else if (url.IsProtocol("sftp") || url.IsProtocol("ssh")) return new CSFTPFile();
-#endif
else if (url.IsProtocol("shout")) return new CShoutcastFile();
#ifdef HAS_FILESYSTEM_SMB
#ifdef TARGET_WINDOWS
diff --git a/xbmc/filesystem/SFTPDirectory.cpp b/xbmc/filesystem/SFTPDirectory.cpp
deleted file mode 100644
index f987fd1f9d..0000000000
--- a/xbmc/filesystem/SFTPDirectory.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://kodi.tv
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "SFTPDirectory.h"
-
-#include "SFTPFile.h"
-#include "utils/log.h"
-#include "URL.h"
-
-using namespace XFILE;
-
-CSFTPDirectory::CSFTPDirectory(void) = default;
-
-CSFTPDirectory::~CSFTPDirectory(void) = default;
-
-bool CSFTPDirectory::GetDirectory(const CURL& url, CFileItemList &items)
-{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
- return session->GetDirectory(url.GetWithoutFilename().c_str(), url.GetFileName().c_str(), items);
-}
-
-bool CSFTPDirectory::Exists(const CURL& url)
-{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
- if (session)
- return session->DirectoryExists(url.GetFileName().c_str());
- else
- {
- CLog::Log(LOGERROR, "SFTPDirectory: Failed to create session to check exists");
- return false;
- }
-}
diff --git a/xbmc/filesystem/SFTPDirectory.h b/xbmc/filesystem/SFTPDirectory.h
deleted file mode 100644
index 24122dadb5..0000000000
--- a/xbmc/filesystem/SFTPDirectory.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://kodi.tv
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#pragma once
-
-#include "IDirectory.h"
-
-class CURL;
-class TiXmlElement;
-
-namespace XFILE
-{
- class CSFTPDirectory : public IDirectory
- {
- public:
- CSFTPDirectory(void);
- ~CSFTPDirectory(void) override;
- bool GetDirectory(const CURL& url, CFileItemList &items) override;
- bool Exists(const CURL& url) override;
- };
-}
diff --git a/xbmc/filesystem/SFTPFile.cpp b/xbmc/filesystem/SFTPFile.cpp
deleted file mode 100644
index fb1e017630..0000000000
--- a/xbmc/filesystem/SFTPFile.cpp
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://kodi.tv
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "threads/SystemClock.h"
-#include "SFTPFile.h"
-#include "threads/SingleLock.h"
-#include "utils/log.h"
-#include "URL.h"
-#include <fcntl.h>
-#include <sstream>
-
-#if defined(TARGET_DARWIN_IOS)
-#include "utils/StringUtils.h"
-#include "platform/darwin/DarwinUtils.h"
-#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(m) ((m & _S_IFDIR) != 0)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(m) ((m & _S_IFREG) != 0)
-#endif
-#ifndef O_RDONLY
-#define O_RDONLY _O_RDONLY
-#endif
-
-using namespace XFILE;
-
-
-static std::string CorrectPath(const std::string& path)
-{
- if (path == "~")
- return "./";
- else if (path.substr(0, 2) == "~/")
- return "./" + path.substr(2);
- else
- return "/" + path;
-}
-
-static const char * SFTPErrorText(int sftp_error)
-{
- switch(sftp_error)
- {
- case SSH_FX_OK:
- return "No error";
- case SSH_FX_EOF:
- return "End-of-file encountered";
- case SSH_FX_NO_SUCH_FILE:
- return "File doesn't exist";
- case SSH_FX_PERMISSION_DENIED:
- return "Permission denied";
- case SSH_FX_BAD_MESSAGE:
- return "Garbage received from server";
- case SSH_FX_NO_CONNECTION:
- return "No connection has been set up";
- case SSH_FX_CONNECTION_LOST:
- return "There was a connection, but we lost it";
- case SSH_FX_OP_UNSUPPORTED:
- return "Operation not supported by the server";
- case SSH_FX_INVALID_HANDLE:
- return "Invalid file handle";
- case SSH_FX_NO_SUCH_PATH:
- return "No such file or directory path exists";
- case SSH_FX_FILE_ALREADY_EXISTS:
- return "An attempt to create an already existing file or directory has been made";
- case SSH_FX_WRITE_PROTECT:
- return "We are trying to write on a write-protected filesystem";
- case SSH_FX_NO_MEDIA:
- return "No media in remote drive";
- case -1:
- return "Not a valid error code, probably called on an invalid session";
- default:
- CLog::Log(LOGERROR, "SFTPErrorText: Unknown error code: %d", sftp_error);
- }
- return "Unknown error code";
-}
-
-
-
-CSFTPSession::CSFTPSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password)
-{
- CLog::Log(LOGINFO, "SFTPSession: Creating new session on host '%s:%d'", host.c_str(), port);
- CSingleLock lock(m_critSect);
- if (!Connect(host, port, username, password))
- Disconnect();
-
- m_LastActive = XbmcThreads::SystemClockMillis();
-}
-
-CSFTPSession::~CSFTPSession()
-{
- CSingleLock lock(m_critSect);
- Disconnect();
-}
-
-sftp_file CSFTPSession::CreateFileHandle(const std::string &file)
-{
- if (m_connected)
- {
- CSingleLock lock(m_critSect);
- m_LastActive = XbmcThreads::SystemClockMillis();
- sftp_file handle = sftp_open(m_sftp_session, CorrectPath(file).c_str(), O_RDONLY, 0);
- if (handle)
- {
- sftp_file_set_blocking(handle);
- return handle;
- }
- else
- CLog::Log(LOGERROR, "SFTPSession: Was connected but couldn't create filehandle for '%s'", file.c_str());
- }
- else
- CLog::Log(LOGERROR, "SFTPSession: Not connected and can't create file handle for '%s'", file.c_str());
-
- return NULL;
-}
-
-void CSFTPSession::CloseFileHandle(sftp_file handle)
-{
- CSingleLock lock(m_critSect);
- sftp_close(handle);
-}
-
-bool CSFTPSession::GetDirectory(const std::string &base, const std::string &folder, CFileItemList &items)
-{
- int sftp_error = SSH_FX_OK;
- if (m_connected)
- {
- sftp_dir dir = NULL;
-
- {
- CSingleLock lock(m_critSect);
- m_LastActive = XbmcThreads::SystemClockMillis();
- dir = sftp_opendir(m_sftp_session, CorrectPath(folder).c_str());
-
- //Doing as little work as possible within the critical section
- if (!dir)
- sftp_error = sftp_get_error(m_sftp_session);
- }
-
- if (!dir)
- {
- CLog::Log(LOGERROR, "%s: %s for '%s'", __FUNCTION__, SFTPErrorText(sftp_error), folder.c_str());
- }
- else
- {
- bool read = true;
- while (read)
- {
- sftp_attributes attributes = NULL;
-
- {
- CSingleLock lock(m_critSect);
- read = sftp_dir_eof(dir) == 0;
- attributes = sftp_readdir(m_sftp_session, dir);
- }
-
- if (attributes && (attributes->name == NULL || strcmp(attributes->name, "..") == 0 || strcmp(attributes->name, ".") == 0))
- {
- CSingleLock lock(m_critSect);
- sftp_attributes_free(attributes);
- continue;
- }
-
- if (attributes)
- {
- std::string itemName = attributes->name;
- std::string localPath = folder;
- localPath.append(itemName);
-
- if (attributes->type == SSH_FILEXFER_TYPE_SYMLINK)
- {
- CSingleLock lock(m_critSect);
- sftp_attributes_free(attributes);
- attributes = sftp_stat(m_sftp_session, CorrectPath(localPath).c_str());
- if (attributes == NULL)
- continue;
- }
-
- CFileItemPtr pItem(new CFileItem);
- pItem->SetLabel(itemName);
-
- if (itemName[0] == '.')
- pItem->SetProperty("file:hidden", true);
-
- if (attributes->flags & SSH_FILEXFER_ATTR_ACMODTIME)
- pItem->m_dateTime = attributes->mtime;
-
- if (attributes->type & SSH_FILEXFER_TYPE_DIRECTORY)
- {
- localPath.append("/");
- pItem->m_bIsFolder = true;
- pItem->m_dwSize = 0;
- }
- else
- {
- pItem->m_dwSize = attributes->size;
- }
-
- pItem->SetPath(base + localPath);
- items.Add(pItem);
-
- {
- CSingleLock lock(m_critSect);
- sftp_attributes_free(attributes);
- }
- }
- else
- read = false;
- }
-
- {
- CSingleLock lock(m_critSect);
- sftp_closedir(dir);
- }
-
- return true;
- }
- }
- else
- CLog::Log(LOGERROR, "SFTPSession: Not connected, can't list directory '%s'", folder.c_str());
-
- return false;
-}
-
-bool CSFTPSession::DirectoryExists(const char *path)
-{
- uint32_t permissions = 0;
- bool exists = GetItemPermissions(path, permissions);
- return exists && S_ISDIR(permissions);
-}
-
-bool CSFTPSession::FileExists(const char *path)
-{
- uint32_t permissions = 0;
- bool exists = GetItemPermissions(path, permissions);
- return exists && S_ISREG(permissions);
-}
-
-int CSFTPSession::Stat(const char *path, struct __stat64* buffer)
-{
- CSingleLock lock(m_critSect);
- if(m_connected)
- {
- m_LastActive = XbmcThreads::SystemClockMillis();
- sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str());
-
- if (attributes)
- {
- memset(buffer, 0, sizeof(struct __stat64));
- buffer->st_size = attributes->size;
- buffer->st_mtime = attributes->mtime;
- buffer->st_atime = attributes->atime;
-
- if S_ISDIR(attributes->permissions)
- buffer->st_mode = _S_IFDIR;
- else if S_ISREG(attributes->permissions)
- buffer->st_mode = _S_IFREG;
-
- sftp_attributes_free(attributes);
- return 0;
- }
- else
- {
- CLog::Log(LOGERROR, "SFTPSession::Stat - Failed to get attributes for '%s'", path);
- return -1;
- }
- }
- else
- {
- CLog::Log(LOGERROR, "SFTPSession::Stat - Failed because not connected for '%s'", path);
- return -1;
- }
-}
-
-int CSFTPSession::Seek(sftp_file handle, uint64_t position)
-{
- CSingleLock lock(m_critSect);
- m_LastActive = XbmcThreads::SystemClockMillis();
- return sftp_seek64(handle, position);
-}
-
-int CSFTPSession::Read(sftp_file handle, void *buffer, size_t length)
-{
- CSingleLock lock(m_critSect);
- m_LastActive = XbmcThreads::SystemClockMillis();
- return sftp_read(handle, buffer, length);
-}
-
-int64_t CSFTPSession::GetPosition(sftp_file handle)
-{
- CSingleLock lock(m_critSect);
- m_LastActive = XbmcThreads::SystemClockMillis();
- return sftp_tell64(handle);
-}
-
-bool CSFTPSession::IsIdle()
-{
- return (XbmcThreads::SystemClockMillis() - m_LastActive) > 90000;
-}
-
-bool CSFTPSession::VerifyKnownHost(ssh_session session)
-{
- switch (ssh_is_server_known(session))
- {
- case SSH_SERVER_KNOWN_OK:
- return true;
- case SSH_SERVER_KNOWN_CHANGED:
- CLog::Log(LOGERROR, "SFTPSession: Server that was known has changed");
- return false;
- case SSH_SERVER_FOUND_OTHER:
- CLog::Log(LOGERROR, "SFTPSession: The host key for this server was not found but an other type of key exists. An attacker might change the default server key to confuse your client into thinking the key does not exist");
- return false;
- case SSH_SERVER_FILE_NOT_FOUND:
- CLog::Log(LOGINFO, "SFTPSession: Server file was not found, creating a new one");
- case SSH_SERVER_NOT_KNOWN:
- CLog::Log(LOGINFO, "SFTPSession: Server unknown, we trust it for now");
- if (ssh_write_knownhost(session) < 0)
- {
- CLog::Log(LOGERROR, "CSFTPSession: Failed to save host '%s'", strerror(errno));
- return false;
- }
-
- return true;
- case SSH_SERVER_ERROR:
- CLog::Log(LOGERROR, "SFTPSession: Failed to verify host '%s'", ssh_get_error(session));
- return false;
- }
-
- return false;
-}
-
-bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std::string &username, const std::string &password)
-{
- int timeout = SFTP_TIMEOUT;
- m_connected = false;
- m_session = NULL;
- m_sftp_session = NULL;
-
- m_session=ssh_new();
- if (m_session == NULL)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to initialize session for host '%s'", host.c_str());
- return false;
- }
-
- if (ssh_options_set(m_session, SSH_OPTIONS_USER, username.c_str()) < 0)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to set username '%s' for session", username.c_str());
- return false;
- }
-
- if (ssh_options_set(m_session, SSH_OPTIONS_HOST, host.c_str()) < 0)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to set host '%s' for session", host.c_str());
- return false;
- }
-
- if (ssh_options_set(m_session, SSH_OPTIONS_PORT, &port) < 0)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port);
- return false;
- }
-#if defined(TARGET_DARWIN_IOS)
- std::string home = CDarwinUtils::GetUserHomeDirectory();
- std::string sshFolder = StringUtils::Format("%s/.ssh", home.c_str());
- if (ssh_options_set(m_session, SSH_OPTIONS_SSH_DIR, sshFolder.c_str()) < 0)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to set .ssh folder to '%s' for session", sshFolder.c_str());
- return false;
- }
-#endif
- ssh_options_set(m_session, SSH_OPTIONS_LOG_VERBOSITY, 0);
- ssh_options_set(m_session, SSH_OPTIONS_TIMEOUT, &timeout);
-
- if(ssh_connect(m_session))
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to connect '%s'", ssh_get_error(m_session));
- return false;
- }
-
- if (!VerifyKnownHost(m_session))
- {
- CLog::Log(LOGERROR, "SFTPSession: Host is not known '%s'", ssh_get_error(m_session));
- return false;
- }
-
-
- int noAuth = SSH_AUTH_DENIED;
- if ((noAuth = ssh_userauth_none(m_session, NULL)) == SSH_AUTH_ERROR)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via guest '%s'", ssh_get_error(m_session));
- return false;
- }
-
- int method = ssh_userauth_list(m_session, NULL);
-
- // Try to authenticate with public key first
- int publicKeyAuth = SSH_AUTH_DENIED;
- if (method & SSH_AUTH_METHOD_PUBLICKEY && (publicKeyAuth = ssh_userauth_publickey_auto(m_session, NULL, NULL)) == SSH_AUTH_ERROR)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via publickey '%s'", ssh_get_error(m_session));
- return false;
- }
-
- // Try to authenticate with password
- int passwordAuth = SSH_AUTH_DENIED;
- if (method & SSH_AUTH_METHOD_PASSWORD)
- {
- if (publicKeyAuth != SSH_AUTH_SUCCESS &&
- (passwordAuth = ssh_userauth_password(m_session, username.c_str(), password.c_str())) == SSH_AUTH_ERROR)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via password '%s'", ssh_get_error(m_session));
- return false;
- }
- }
- else if (!password.empty())
- {
- CLog::Log(LOGERROR, "SFTPSession: Password present, but server does not support password authentication");
- }
-
- if (noAuth == SSH_AUTH_SUCCESS || publicKeyAuth == SSH_AUTH_SUCCESS || passwordAuth == SSH_AUTH_SUCCESS)
- {
- m_sftp_session = sftp_new(m_session);
-
- if (m_sftp_session == NULL)
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to initialize channel '%s'", ssh_get_error(m_session));
- return false;
- }
-
- if (sftp_init(m_sftp_session))
- {
- CLog::Log(LOGERROR, "SFTPSession: Failed to initialize sftp '%s'", ssh_get_error(m_session));
- return false;
- }
-
- m_connected = true;
- }
- else
- {
- CLog::Log(LOGERROR, "SFTPSession: No authentication method successful");
- }
-
- return m_connected;
-}
-
-void CSFTPSession::Disconnect()
-{
- if (m_sftp_session)
- sftp_free(m_sftp_session);
-
- if (m_session)
- ssh_disconnect(m_session);
-
- m_sftp_session = NULL;
- m_session = NULL;
-}
-
-/*!
- \brief Gets POSIX compatible permissions information about the specified file or directory.
- \param path Remote SSH path to the file or directory.
- \param permissions POSIX compatible permissions information for the file or directory (if it exists). i.e. can use macros S_ISDIR() etc.
- \return Returns \e true, if it was possible to get permissions for the file or directory, \e false otherwise.
- */
-bool CSFTPSession::GetItemPermissions(const char *path, uint32_t &permissions)
-{
- bool gotPermissions = false;
- CSingleLock lock(m_critSect);
- if(m_connected)
- {
- sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str());
- if (attributes)
- {
- if (attributes->flags & SSH_FILEXFER_ATTR_PERMISSIONS)
- {
- permissions = attributes->permissions;
- gotPermissions = true;
- }
-
- sftp_attributes_free(attributes);
- }
- }
- return gotPermissions;
-}
-
-CCriticalSection CSFTPSessionManager::m_critSect;
-std::map<std::string, CSFTPSessionPtr> CSFTPSessionManager::sessions;
-
-CSFTPSessionPtr CSFTPSessionManager::CreateSession(const CURL &url)
-{
- std::string username = url.GetUserName().c_str();
- std::string password = url.GetPassWord().c_str();
- std::string hostname = url.GetHostName().c_str();
- unsigned int port = url.HasPort() ? url.GetPort() : 22;
-
- return CSFTPSessionManager::CreateSession(hostname, port, username, password);
-}
-
-CSFTPSessionPtr CSFTPSessionManager::CreateSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password)
-{
- // Convert port number to string
- std::stringstream itoa;
- itoa << port;
- std::string portstr = itoa.str();
-
- CSingleLock lock(m_critSect);
- std::string key = username + ':' + password + '@' + host + ':' + portstr;
- CSFTPSessionPtr ptr = sessions[key];
- if (ptr == NULL)
- {
- ptr = CSFTPSessionPtr(new CSFTPSession(host, port, username, password));
- sessions[key] = ptr;
- }
-
- return ptr;
-}
-
-void CSFTPSessionManager::ClearOutIdleSessions()
-{
- CSingleLock lock(m_critSect);
- for(std::map<std::string, CSFTPSessionPtr>::iterator iter = sessions.begin(); iter != sessions.end();)
- {
- if (iter->second->IsIdle())
- sessions.erase(iter++);
- else
- ++iter;
- }
-}
-
-void CSFTPSessionManager::DisconnectAllSessions()
-{
- CSingleLock lock(m_critSect);
- sessions.clear();
-}
-
-CSFTPFile::CSFTPFile()
-{
- m_sftp_handle = NULL;
-}
-
-CSFTPFile::~CSFTPFile()
-{
- Close();
-}
-
-bool CSFTPFile::Open(const CURL& url)
-{
- m_session = CSFTPSessionManager::CreateSession(url);
- if (m_session)
- {
- m_file = url.GetFileName().c_str();
- m_sftp_handle = m_session->CreateFileHandle(m_file);
-
- return (m_sftp_handle != NULL);
- }
- else
- {
- CLog::Log(LOGERROR, "SFTPFile: Failed to allocate session");
- return false;
- }
-}
-
-void CSFTPFile::Close()
-{
- if (m_session && m_sftp_handle)
- {
- m_session->CloseFileHandle(m_sftp_handle);
- m_sftp_handle = NULL;
- m_session = CSFTPSessionPtr();
- }
-}
-
-int64_t CSFTPFile::Seek(int64_t iFilePosition, int iWhence)
-{
- if (m_session && m_sftp_handle)
- {
- uint64_t position = 0;
- if (iWhence == SEEK_SET)
- position = iFilePosition;
- else if (iWhence == SEEK_CUR)
- position = GetPosition() + iFilePosition;
- else if (iWhence == SEEK_END)
- position = GetLength() + iFilePosition;
-
- if (m_session->Seek(m_sftp_handle, position) == 0)
- return GetPosition();
- else
- return -1;
- }
- else
- {
- CLog::Log(LOGERROR, "SFTPFile: Can't seek without a filehandle");
- return -1;
- }
-}
-
-ssize_t CSFTPFile::Read(void* lpBuf, size_t uiBufSize)
-{
- if (m_session && m_sftp_handle)
- {
- if (uiBufSize > SSIZE_MAX)
- uiBufSize = SSIZE_MAX;
-
- int rc = m_session->Read(m_sftp_handle, lpBuf, (size_t)uiBufSize);
-
- if (rc >= 0)
- return rc;
- else
- CLog::Log(LOGERROR, "SFTPFile: Failed to read %i", rc);
- }
- else
- CLog::Log(LOGERROR, "SFTPFile: Can't read without a filehandle");
-
- return 0;
-}
-
-bool CSFTPFile::Exists(const CURL& url)
-{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
- if (session)
- return session->FileExists(url.GetFileName().c_str());
- else
- {
- CLog::Log(LOGERROR, "SFTPFile: Failed to create session to check exists for '%s'", url.GetFileName().c_str());
- return false;
- }
-}
-
-int CSFTPFile::Stat(const CURL& url, struct __stat64* buffer)
-{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
- if (session)
- return session->Stat(url.GetFileName().c_str(), buffer);
- else
- {
- CLog::Log(LOGERROR, "SFTPFile: Failed to create session to stat for '%s'", url.GetFileName().c_str());
- return -1;
- }
-}
-
-int CSFTPFile::Stat(struct __stat64* buffer)
-{
- if (m_session)
- return m_session->Stat(m_file.c_str(), buffer);
-
- CLog::Log(LOGERROR, "SFTPFile: Can't stat without a session for '%s'", m_file.c_str());
- return -1;
-}
-
-int64_t CSFTPFile::GetLength()
-{
- struct __stat64 buffer;
- if (Stat(&buffer) != 0)
- return 0;
- else
- {
- int64_t length = buffer.st_size;
- return length;
- }
-}
-
-int64_t CSFTPFile::GetPosition()
-{
- if (m_session && m_sftp_handle)
- return m_session->GetPosition(m_sftp_handle);
-
- CLog::Log(LOGERROR, "SFTPFile: Can't get position without a filehandle for '%s'", m_file.c_str());
- return 0;
-}
-
-int CSFTPFile::IoControl(EIoControl request, void* param)
-{
- if(request == IOCTRL_SEEK_POSSIBLE)
- return 1;
-
- return -1;
-}
diff --git a/xbmc/filesystem/SFTPFile.h b/xbmc/filesystem/SFTPFile.h
deleted file mode 100644
index 4ec5da6760..0000000000
--- a/xbmc/filesystem/SFTPFile.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://kodi.tv
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#pragma once
-
-#include "IFile.h"
-#include "FileItem.h"
-#include "threads/CriticalSection.h"
-
-#include <libssh/libssh.h>
-#ifdef TARGET_WINDOWS
-#define ssize_t SSIZE_T
-#include <libssh/sftp.h>
-#undef ssize_t
-#else // !TARGET_WINDOWS
-#include <libssh/sftp.h>
-#endif // !TARGET_WINDOWS
-#include <string>
-#include <map>
-#include <memory>
-
-class CURL;
-
-//five secs timeout for SFTP
-#define SFTP_TIMEOUT 5
-
-class CSFTPSession
-{
-public:
- CSFTPSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password);
- virtual ~CSFTPSession();
-
- sftp_file CreateFileHandle(const std::string &file);
- void CloseFileHandle(sftp_file handle);
- bool GetDirectory(const std::string &base, const std::string &folder, CFileItemList &items);
- bool DirectoryExists(const char *path);
- bool FileExists(const char *path);
- int Stat(const char *path, struct __stat64* buffer);
- int Seek(sftp_file handle, uint64_t position);
- int Read(sftp_file handle, void *buffer, size_t length);
- int64_t GetPosition(sftp_file handle);
- bool IsIdle();
-private:
- bool VerifyKnownHost(ssh_session session);
- bool Connect(const std::string &host, unsigned int port, const std::string &username, const std::string &password);
- void Disconnect();
- bool GetItemPermissions(const char *path, uint32_t &permissions);
- CCriticalSection m_critSect;
-
- bool m_connected;
- ssh_session m_session;
- sftp_session m_sftp_session;
- int m_LastActive;
-};
-
-typedef std::shared_ptr<CSFTPSession> CSFTPSessionPtr;
-
-class CSFTPSessionManager
-{
-public:
- static CSFTPSessionPtr CreateSession(const CURL &url);
- static CSFTPSessionPtr CreateSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password);
- static void ClearOutIdleSessions();
- static void DisconnectAllSessions();
-private:
- static CCriticalSection m_critSect;
- static std::map<std::string, CSFTPSessionPtr> sessions;
-};
-
-namespace XFILE
-{
- class CSFTPFile : public IFile
- {
- public:
- CSFTPFile();
- ~CSFTPFile() override;
- void Close() override;
- int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET) override;
- ssize_t Read(void* lpBuf, size_t uiBufSize) override;
- bool Open(const CURL& url) override;
- bool Exists(const CURL& url) override;
- int Stat(const CURL& url, struct __stat64* buffer) override;
- int Stat(struct __stat64* buffer) override;
- int64_t GetLength() override;
- int64_t GetPosition() override;
- int GetChunkSize() override {return 1;};
- int IoControl(EIoControl request, void* param) override;
- private:
- std::string m_file;
- CSFTPSessionPtr m_session;
- sftp_file m_sftp_handle;
- };
-}
diff --git a/xbmc/network/GUIDialogNetworkSetup.cpp b/xbmc/network/GUIDialogNetworkSetup.cpp
index 44d60f8b6a..d7a9ba5ba6 100644
--- a/xbmc/network/GUIDialogNetworkSetup.cpp
+++ b/xbmc/network/GUIDialogNetworkSetup.cpp
@@ -480,7 +480,4 @@ void CGUIDialogNetworkSetup::UpdateAvailableProtocols()
#ifdef HAS_FILESYSTEM_NFS
m_protocols.emplace_back(Protocol{true, false, false, false, true, 0, "nfs", 20259});
#endif
-#ifdef HAS_FILESYSTEM_SFTP
- m_protocols.emplace_back(Protocol{true, true, true, true, false, 22, "sftp", 20260});
-#endif
}
diff --git a/xbmc/network/ZeroconfBrowser.cpp b/xbmc/network/ZeroconfBrowser.cpp
index 196ed01e5e..cee2a4d61c 100644
--- a/xbmc/network/ZeroconfBrowser.cpp
+++ b/xbmc/network/ZeroconfBrowser.cpp
@@ -62,7 +62,6 @@ CZeroconfBrowser::CZeroconfBrowser():mp_crit_sec(new CCriticalSection),m_started
#ifdef HAS_FILESYSTEM_NFS
AddServiceType("_nfs._tcp.");
#endif// HAS_FILESYSTEM_NFS
- AddServiceType("_sftp-ssh._tcp.");
}
CZeroconfBrowser::~CZeroconfBrowser()
diff --git a/xbmc/platform/darwin/DarwinUtils.h b/xbmc/platform/darwin/DarwinUtils.h
index caf1e5b229..29a300396a 100644
--- a/xbmc/platform/darwin/DarwinUtils.h
+++ b/xbmc/platform/darwin/DarwinUtils.h
@@ -39,7 +39,6 @@ public:
static const char *GetOSXVersionString(void);
static int GetFrameworkPath(bool forPython, char* path, size_t *pathsize);
static int GetExecutablePath(char* path, size_t *pathsize);
- static const char *GetUserHomeDirectory(void);
static const char *GetAppRootFolder(void);
static bool IsIosSandboxed(void);
static bool HasVideoToolboxDecoder(void);
diff --git a/xbmc/platform/darwin/DarwinUtils.mm b/xbmc/platform/darwin/DarwinUtils.mm
index e7008156c4..66351c270f 100644
--- a/xbmc/platform/darwin/DarwinUtils.mm
+++ b/xbmc/platform/darwin/DarwinUtils.mm
@@ -395,22 +395,6 @@ int CDarwinUtils::GetExecutablePath(char* path, size_t *pathsize)
return 0;
}
-const char* CDarwinUtils::GetUserHomeDirectory(void)
-{
- static std::string appHomeFolder;
- if (appHomeFolder.empty())
- {
-#if defined(TARGET_DARWIN_IOS)
- appHomeFolder = URIUtils::AddFileToFolder(CDarwinUtils::GetAppRootFolder(), CCompileInfo::GetAppName());
-#else
- appHomeFolder = URIUtils::AddFileToFolder(getenv("HOME"), "Library/Application Support");
- appHomeFolder = URIUtils::AddFileToFolder(appHomeFolder, CCompileInfo::GetAppName());
-#endif
- }
-
- return appHomeFolder.c_str();
-}
-
const char* CDarwinUtils::GetAppRootFolder(void)
{
static std::string rootFolder = "";
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
index e26c8e736c..8036f343f3 100644
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -982,6 +982,7 @@ bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */
return IsInternetStream(CStackDirectory::GetFirstStackedFile(url.Get()));
// Special case these
+ //! @todo sftp special case has to be handled by vfs addon
if (url.IsProtocol("ftp") || url.IsProtocol("ftps") ||
url.IsProtocol("dav") || url.IsProtocol("davs") ||
url.IsProtocol("sftp"))