Blame SPECS/libssh2.spec

eb5047
Name:		libssh2
eb5047
Version:	1.8.0
eb5047
Release:	3%{?dist}
eb5047
Summary:	A library implementing the SSH2 protocol
eb5047
Group:		System Environment/Libraries
eb5047
License:	BSD
eb5047
URL:		http://www.libssh2.org/
eb5047
Source0:	http://libssh2.org/download/libssh2-%{version}.tar.gz
eb5047
eb5047
# fix integer overflow in transport read resulting in out of bounds write (CVE-2019-3855)
eb5047
Patch1:     0001-libssh2-1.8.0-CVE-2019-3855.patch
eb5047
eb5047
# fix integer overflow in keyboard interactive handling resulting in out of bounds write (CVE-2019-3856)
eb5047
Patch2:     0002-libssh2-1.8.0-CVE-2019-3856.patch
eb5047
eb5047
# fix integer overflow in SSH packet processing channel resulting in out of bounds write (CVE-2019-3857)
eb5047
Patch3:     0003-libssh2-1.8.0-CVE-2019-3857.patch
eb5047
eb5047
# fix zero-byte allocation in SFTP packet processing resulting in out-of-bounds read (CVE-2019-3858)
eb5047
Patch4:     0004-libssh2-1.8.0-CVE-2019-3858.patch
eb5047
eb5047
# fix out-of-bounds reads with specially crafted SSH packets (CVE-2019-3861)
eb5047
Patch7:     0007-libssh2-1.8.0-CVE-2019-3861.patch
eb5047
eb5047
# fix out-of-bounds memory comparison with specially crafted message channel request (CVE-2019-3862)
eb5047
Patch8:     0008-libssh2-1.8.0-CVE-2019-3862.patch
eb5047
eb5047
# fix integer overflow in keyboard interactive handling that allows out-of-bounds writes (CVE-2019-3863)
eb5047
Patch9:     0009-libssh2-1.8.0-CVE-2019-3863.patch
eb5047
eb5047
Patch14:	0014-libssh2-1.4.3-scp-remote-exec.patch
eb5047
Patch15:	0015-libssh2-1.4.3-debug-msgs.patch
eb5047
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
eb5047
eb5047
BuildRequires:	coreutils
eb5047
BuildRequires:	findutils
eb5047
BuildRequires:	gcc
eb5047
BuildRequires:	make
eb5047
BuildRequires:	openssl-devel
eb5047
BuildRequires:	sed
eb5047
BuildRequires:	zlib-devel
eb5047
BuildRequires:	/usr/bin/man
eb5047
eb5047
# Test suite requirements - we run the OpenSSH server and try to connect to it
eb5047
BuildRequires:	openssh-server
eb5047
# We use matchpathcon to get the correct SELinux context for the ssh server
eb5047
# initialization script so that it can transition correctly in an SELinux
eb5047
# environment
eb5047
%if !(0%{?fedora} >= 17 || 0%{?rhel} >= 7)
eb5047
BuildRequires:	libselinux-utils
eb5047
BuildRequires:	selinux-policy-targeted
eb5047
%endif
eb5047
eb5047
%description
eb5047
libssh2 is a library implementing the SSH2 protocol as defined by
eb5047
Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25),
eb5047
SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*,
eb5047
SECSH-DHGEX(04), and SECSH-NUMBERS(10).
eb5047
eb5047
%package	devel
eb5047
Summary:	Development files for libssh2
eb5047
Group:		Development/Libraries
eb5047
Requires:	%{name}%{?_isa} = %{version}-%{release}
eb5047
Requires:	pkgconfig
eb5047
eb5047
%description	devel
eb5047
The libssh2-devel package contains libraries and header files for
eb5047
developing applications that use libssh2.
eb5047
eb5047
%package	docs
eb5047
Summary:	Documentation for libssh2
eb5047
Group:		Development/Libraries
eb5047
Requires:	%{name} = %{version}-%{release}
eb5047
BuildArch:	noarch
eb5047
eb5047
%description	docs
eb5047
The libssh2-docs package contains man pages and examples for
eb5047
developing applications that use libssh2.
eb5047
eb5047
%prep
eb5047
%setup -q
eb5047
%patch1 -p1
eb5047
%patch2 -p1
eb5047
%patch3 -p1
eb5047
%patch4 -p1
eb5047
%patch7 -p1
eb5047
%patch8 -p1
eb5047
%patch9 -p1
eb5047
eb5047
# Replace hard wired port number in the test suite to avoid collisions
eb5047
# between 32-bit and 64-bit builds running on a single build-host
eb5047
sed -i s/4711/47%{__isa_bits}/ tests/ssh2.{c,sh}
eb5047
eb5047
# scp: send valid commands for remote execution (#1489733)
eb5047
%patch14 -p1
eb5047
eb5047
# session: avoid printing misleading debug messages (#1503294)
eb5047
%patch15 -p1
eb5047
eb5047
# Make sshd transition appropriately if building in an SELinux environment
eb5047
%if !(0%{?fedora} >= 17 || 0%{?rhel} >= 7)
eb5047
chcon $(/usr/sbin/matchpathcon -n /etc/rc.d/init.d/sshd) tests/ssh2.sh || :
eb5047
chcon -R $(/usr/sbin/matchpathcon -n /etc) tests/etc || :
eb5047
chcon $(/usr/sbin/matchpathcon -n /etc/ssh/ssh_host_key) tests/etc/{host,user} || :
eb5047
%endif
eb5047
eb5047
%build
eb5047
%configure --disable-silent-rules --disable-static --enable-shared
eb5047
make %{?_smp_mflags}
eb5047
eb5047
# Avoid polluting libssh2.pc with linker options (#947813)
eb5047
sed -i -e 's|[[:space:]]-Wl,[^[:space:]]*||' libssh2.pc
eb5047
eb5047
%install
eb5047
rm -rf %{buildroot}
eb5047
make install DESTDIR=%{buildroot} INSTALL="install -p"
eb5047
find %{buildroot} -name '*.la' -delete
eb5047
eb5047
# clean things up a bit for packaging
eb5047
make -C example clean
eb5047
rm -rf example/.deps
eb5047
find example/ -type f '(' -name '*.am' -o -name '*.in' ')' -delete
eb5047
eb5047
# avoid multilib conflict on libssh2-devel
eb5047
mv -v example example.%{_arch}
eb5047
eb5047
%check
eb5047
echo "Running tests for %{_arch}"
eb5047
# The SSH test will fail if we don't have /dev/tty, as is the case in some
eb5047
# versions of mock (#672713)
eb5047
if [ ! -c /dev/tty ]; then
eb5047
	echo Skipping SSH test due to missing /dev/tty
eb5047
	echo "exit 0" > tests/ssh2.sh
eb5047
fi
eb5047
# Apparently it fails in the sparc and arm buildsystems too
eb5047
%ifarch %{sparc} %{arm}
eb5047
echo Skipping SSH test on sparc/arm
eb5047
echo "exit 0" > tests/ssh2.sh
eb5047
%endif
eb5047
# mansyntax check fails on PPC* and aarch64 with some strange locale error
eb5047
%ifarch ppc %{power64} aarch64
eb5047
echo "Skipping mansyntax test on PPC* and aarch64"
eb5047
echo "exit 0" > tests/mansyntax.sh
eb5047
%endif
eb5047
make -C tests check
eb5047
eb5047
%clean
eb5047
rm -rf %{buildroot}
eb5047
eb5047
%post -p /sbin/ldconfig
eb5047
eb5047
%postun -p /sbin/ldconfig
eb5047
eb5047
%files
eb5047
%doc COPYING docs/AUTHORS README RELEASE-NOTES
eb5047
%{_libdir}/libssh2.so.1
eb5047
%{_libdir}/libssh2.so.1.*
eb5047
eb5047
%files docs
eb5047
%doc docs/BINDINGS docs/HACKING docs/TODO NEWS
eb5047
%{_mandir}/man3/libssh2_*.3*
eb5047
eb5047
%files devel
eb5047
%doc example.%{_arch}/
eb5047
%{_includedir}/libssh2.h
eb5047
%{_includedir}/libssh2_publickey.h
eb5047
%{_includedir}/libssh2_sftp.h
eb5047
%{_libdir}/libssh2.so
eb5047
%{_libdir}/pkgconfig/libssh2.pc
eb5047
eb5047
%changelog
eb5047
* Wed Mar 20 2019 Kamil Dudka <kdudka@redhat.com> 1.8.0-3
eb5047
- sanitize public header file (detected by rpmdiff)
eb5047
eb5047
* Tue Mar 19 2019 Kamil Dudka <kdudka@redhat.com> 1.8.0-2
eb5047
- fix integer overflow in keyboard interactive handling that allows out-of-bounds writes (CVE-2019-3863)
eb5047
- fix out-of-bounds memory comparison with specially crafted message channel request (CVE-2019-3862)
eb5047
- fix out-of-bounds reads with specially crafted SSH packets (CVE-2019-3861)
eb5047
- fix zero-byte allocation in SFTP packet processing resulting in out-of-bounds read (CVE-2019-3858)
eb5047
- fix integer overflow in SSH packet processing channel resulting in out of bounds write (CVE-2019-3857)
eb5047
- fix integer overflow in keyboard interactive handling resulting in out of bounds write (CVE-2019-3856)
eb5047
- fix integer overflow in transport read resulting in out of bounds write (CVE-2019-3855)
eb5047
eb5047
* Wed Nov 21 2018 Kamil Dudka <kdudka@redhat.com> 1.8.0-1
eb5047
- rebase to 1.8.0 (#1592784)
eb5047
eb5047
* Tue Sep 26 2017 Kamil Dudka <kdudka@redhat.com> 1.4.3-12
eb5047
- session: avoid printing misleading debug messages (#1503294)
eb5047
- scp: send valid commands for remote execution (#1489733)
eb5047
eb5047
* Fri Feb 19 2016 Kamil Dudka <kdudka@redhat.com> 1.4.3-11
eb5047
- use secrects of the appropriate length in Diffie-Hellman (CVE-2016-0787)
eb5047
eb5047
* Mon Jun 01 2015 Kamil Dudka <kdudka@redhat.com> 1.4.3-10
eb5047
- check length of data extracted from the SSH_MSG_KEXINIT packet (CVE-2015-1782)
eb5047
eb5047
* Tue May 05 2015 Kamil Dudka <kdudka@redhat.com> 1.4.3-9
eb5047
- curl consumes too much memory during scp download (#1080459)
eb5047
- prevent a not-connected agent from closing STDIN (#1147717)
eb5047
eb5047
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.4.3-8
eb5047
- Mass rebuild 2014-01-24
eb5047
eb5047
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.4.3-7
eb5047
- Mass rebuild 2013-12-27
eb5047
eb5047
* Wed Aug 14 2013 Kamil Dudka <kdudka@redhat.com> 1.4.3-6
eb5047
- fix very slow sftp upload to localhost
eb5047
- fix a use after free in channel.c
eb5047
eb5047
* Tue Apr  9 2013 Richard W.M. Jones <rjones@redhat.com> 1.4.3-5
eb5047
- Add three patches from upstream git required for qemu ssh block driver.
eb5047
eb5047
* Wed Apr  3 2013 Paul Howarth <paul@city-fan.org> 1.4.3-4
eb5047
- Avoid polluting libssh2.pc with linker options (#947813)
eb5047
eb5047
* Tue Mar 26 2013 Kamil Dudka <kdudka@redhat.com> 1.4.3-3
eb5047
- Avoid collisions between 32-bit and 64-bit builds running on a single build
eb5047
  host
eb5047
eb5047
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-2
eb5047
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
eb5047
eb5047
* Wed Nov 28 2012 Paul Howarth <paul@city-fan.org> 1.4.3-1
eb5047
- Update to 1.4.3
eb5047
  - compression: add support for zlib@openssh.com
eb5047
  - sftp_read: return error if a too large package arrives
eb5047
  - libssh2_hostkey_hash.3: update the description of return value
eb5047
  - Fixed MSVC NMakefile
eb5047
  - examples: use stderr for messages, stdout for data
eb5047
  - openssl: do not leak memory when handling errors
eb5047
  - improved handling of disabled MD5 algorithm in OpenSSL
eb5047
  - known_hosts: Fail when parsing unknown keys in known_hosts file
eb5047
  - configure: gcrypt doesn't come with pkg-config support
eb5047
  - session_free: wrong variable used for keeping state
eb5047
  - libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL
eb5047
  - comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating
eb5047
- Drop upstreamed patches
eb5047
eb5047
* Wed Nov 07 2012 Kamil Dudka <kdudka@redhat.com> 1.4.2-4
eb5047
- examples: use stderr for messages, stdout for data (upstream commit b31e35ab)
eb5047
- Update libssh2_hostkey_hash(3) man page (upstream commit fe8f3deb)
eb5047
eb5047
* Wed Sep 26 2012 Kamil Dudka <kdudka@redhat.com> 1.4.2-3
eb5047
- Fix basic functionality of libssh2 in FIPS mode
eb5047
- Skip SELinux-related quirks on recent distros to prevent a test-suite failure
eb5047
eb5047
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.2-2
eb5047
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
eb5047
eb5047
* Sun May 20 2012 Paul Howarth <paul@city-fan.org> 1.4.2-1
eb5047
- Update to 1.4.2
eb5047
  - Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
eb5047
  - userauth.c: fread() from public key file to correctly detect any errors
eb5047
  - configure.ac: add option to disable build of the example applications
eb5047
  - added 'Requires.private:' line to libssh2.pc
eb5047
  - SFTP: filter off incoming "zombie" responses
eb5047
  - gettimeofday: no need for a replacement under cygwin
eb5047
  - SSH_MSG_CHANNEL_REQUEST: default to want_reply
eb5047
  - win32/libssh2_config.h: remove hardcoded #define LIBSSH2_HAVE_ZLIB
eb5047
eb5047
* Fri Apr 27 2012 Paul Howarth <paul@city-fan.org> 1.4.1-2
eb5047
- Fix multi-arch conflict again (#816969)
eb5047
eb5047
* Thu Apr  5 2012 Paul Howarth <paul@city-fan.org> 1.4.1-1
eb5047
- Update to 1.4.1
eb5047
  - Build error with gcrypt backend
eb5047
  - Always do "forced" window updates to avoid corner case stalls
eb5047
  - aes: the init function fails when OpenSSL has AES support
eb5047
  - transport_send: finish in-progress key exchange before sending data
eb5047
  - channel_write: acknowledge transport errors
eb5047
  - examples/x11.c: make sure sizeof passed to read operation is correct
eb5047
  - examples/x11.c: fix suspicious sizeof usage
eb5047
  - sftp_packet_add: verify the packet before accepting it
eb5047
  - SFTP: preserve the original error code more
eb5047
  - sftp_packet_read: adjust window size as necessary
eb5047
  - Use safer snprintf rather then sprintf in several places
eb5047
  - Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET
eb5047
  - sftp_write: cannot return acked data *and* EAGAIN
eb5047
  - sftp_read: avoid data *and* EAGAIN
eb5047
  - libssh2.h: add missing prototype for libssh2_session_banner_set()
eb5047
- Drop upstream patches now included in release tarball
eb5047
eb5047
* Mon Mar 19 2012 Kamil Dudka <kdudka@redhat.com> 1.4.0-4
eb5047
- Don't ignore transport errors when writing to channel (#804150)
eb5047
eb5047
* Sun Mar 18 2012 Paul Howarth <paul@city-fan.org> 1.4.0-3
eb5047
- Don't try to use openssl's AES-CTR functions
eb5047
  (http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml)
eb5047
eb5047
* Fri Mar 16 2012 Paul Howarth <paul@city-fan.org> 1.4.0-2
eb5047
- fix libssh2 failing key re-exchange when write channel is saturated (#804156)
eb5047
- drop %%defattr, redundant since rpm 4.4
eb5047
eb5047
* Wed Feb  1 2012 Paul Howarth <paul@city-fan.org> 1.4.0-1
eb5047
- update to 1.4.0
eb5047
  - added libssh2_session_supported_algs()
eb5047
  - added libssh2_session_banner_get()
eb5047
  - added libssh2_sftp_get_channel()
eb5047
  - libssh2.h: bump the default window size to 256K
eb5047
  - sftp-seek: clear EOF flag
eb5047
  - userauth: provide more informations if ssh pub key extraction fails
eb5047
  - ssh2_exec: skip error outputs for EAGAIN
eb5047
  - LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000
eb5047
  - knownhost_check(): don't dereference ext if NULL is passed
eb5047
  - knownhost_add: avoid dereferencing uninitialized memory on error path
eb5047
  - OpenSSL EVP: fix threaded use of structs
eb5047
  - _libssh2_channel_read: react on errors from receive_window_adjust
eb5047
  - sftp_read: cap the read ahead maximum amount
eb5047
  - _libssh2_channel_read: fix non-blocking window adjusting 
eb5047
- add upstream patch fixing undefined function reference in libgcrypt backend
eb5047
- BR: /usr/bin/man for test suite
eb5047
eb5047
* Sun Jan 15 2012 Peter Robinson <pbrobinson@fedoraproject.org> 1.3.0-4
eb5047
- skip the ssh test on ARM too
eb5047
eb5047
* Fri Jan 13 2012 Paul Howarth <paul@city-fan.org> 1.3.0-3
eb5047
- make docs package noarch where possible
eb5047
- example includes arch-specific bits, so move to devel package
eb5047
- use patch rather than scripted iconv to fix character encoding
eb5047
- don't make assumptions about SELinux context types used for the ssh server
eb5047
  in the test suite
eb5047
- skip the ssh test if /dev/tty isn't present, as in some versions of mock
eb5047
- make the %%files list more explicit
eb5047
- use tabs for indentation
eb5047
eb5047
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 1.3.0-2
eb5047
- rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
eb5047
eb5047
* Thu Sep 08 2011 Kamil Dudka <kdudka@redhat.com> 1.3.0-1
eb5047
- update to 1.3.0
eb5047
eb5047
* Sat Jun 25 2011 Dennis Gilmore <dennis@ausil.us> 1.2.7-2
eb5047
- sshd/loopback test fails in the sparc buildsystem
eb5047
eb5047
* Tue Oct 12 2010 Kamil Dudka <kdudka@redhat.com> 1.2.7-1
eb5047
- update to 1.2.7 (#632916)
eb5047
- avoid multilib conflict on libssh2-docs
eb5047
- avoid build failure in mock with SELinux in the enforcing mode (#558964)
eb5047
eb5047
* Fri Mar 12 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.4-1
eb5047
- update to 1.2.4
eb5047
- drop old patch0
eb5047
- be more aggressive about keeping .deps from intruding into -docs
eb5047
eb5047
* Wed Jan 20 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-5
eb5047
- pkgconfig dep should be with -devel, not -docs
eb5047
eb5047
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-4
eb5047
- enable tests; conditionalize sshd test, which fails with a funky SElinux
eb5047
  error when run locally
eb5047
eb5047
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-3
eb5047
- patch w/1aba38cd7d2658146675ce1737e5090f879f306; not yet in a GA release
eb5047
eb5047
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-2
eb5047
- correct bad file entry under -devel
eb5047
eb5047
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-1
eb5047
- update to 1.2.2
eb5047
- drop old patch now in upstream
eb5047
- add new pkgconfig file to -devel
eb5047
eb5047
* Mon Sep 21 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-2
eb5047
- patch based on 683aa0f6b52fb1014873c961709102b5006372fc
eb5047
- disable tests (*sigh*)
eb5047
eb5047
* Tue Aug 25 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-1
eb5047
- update to 1.2
eb5047
eb5047
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.0-4
eb5047
- rebuilt with new openssl
eb5047
eb5047
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
eb5047
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
eb5047
eb5047
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
eb5047
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
eb5047
eb5047
* Mon Feb 16 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.0-1
eb5047
- update to 1.0
eb5047
eb5047
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.18-8
eb5047
- rebuild with new openssl
eb5047
eb5047
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.18-7
eb5047
- Autorebuild for GCC 4.3
eb5047
eb5047
* Wed Dec 05 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-6
eb5047
- rebuild for new openssl...
eb5047
eb5047
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-5
eb5047
- bump
eb5047
eb5047
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-4
eb5047
- add INSTALL arg to make install vs env. var
eb5047
eb5047
* Mon Nov 26 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-3
eb5047
- run tests; don't package test
eb5047
eb5047
* Sun Nov 18 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-2
eb5047
- split docs into -docs (they seemed... large.)
eb5047
eb5047
* Tue Nov 13 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-1
eb5047
- update to 0.18
eb5047
eb5047
* Sun Oct 14 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.17-1
eb5047
- update to 0.17
eb5047
- many spec file changes
eb5047
eb5047
* Wed May 23 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.2.20070506
eb5047
- Fix release tag
eb5047
- Move manpages to -devel package
eb5047
- Add Examples dir to -devel package
eb5047
eb5047
* Sun May 06 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.20070506.1
eb5047
- Initial build