gnu: curl: Restore derivation.
[jackhill/guix/guix.git] / gnu / packages / ssh.scm
index b93cb03..a75096b 100644 (file)
@@ -1,16 +1,17 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2017 ng0 <ng0@n0.is>
 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
+;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -39,6 +40,7 @@
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages libedit)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages m4)
@@ -51,6 +53,7 @@
   #:use-module (gnu packages popt)
   #:autoload   (gnu packages protobuf) (protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
 (define-public libssh
   (package
     (name "libssh")
-    (version "0.7.6")
+    (version "0.8.7")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     ;; git.libssh.org does not support the fast "smart" HTTP
-                     ;; Git protocol. The "dumb" HTTP Git protocol is extremely
-                     ;; slow, and does not support shallow clones, so we use the
-                     ;; plain Git protocol despite its flaws. This offers an
-                     ;; incredible speedup and reduces the size of the the
-                     ;; source by more than half.
-                     (url "git://git.libssh.org/projects/libssh.git")
+                     (url "https://git.libssh.org/projects/libssh.git")
                      (commit (string-append "libssh-" version))))
-              (patches (search-patches "libssh-hostname-parser-bug.patch"))
               (sha256
                (base32
-                "0slwqa36mhyb6brdv2jvb9fxp7rvsv3ziv67kaxx615jxn52l5pa"))
+                "1iqik1ba0g008k1mb1n85iih1azi7giy0c485jnlmsrjxik4q3j2"))
               (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (outputs '("out" "debug"))
     (arguments
      '(#:configure-flags '("-DWITH_GCRYPT=ON")
 
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'avoid-werror
+                    (lambda _
+                      ;; Avoid '-Werror'.  Presumably this works fine with
+                      ;; gcc@8 on x86_64 but leads to errors with our older
+                      ;; compiler.
+                      (substitute* "CompilerChecks.cmake"
+                        (("-Werror=") "-W"))
+                      #t)))
+
        ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
        #:tests? #f))
     (inputs `(("zlib" ,zlib)
@@ -105,7 +111,7 @@ applications.")
 (define-public libssh2
   (package
    (name "libssh2")
-   (version "1.8.0")
+   (version "1.8.1")
    (source (origin
             (method url-fetch)
             (uri (string-append
@@ -113,7 +119,7 @@ applications.")
                    version ".tar.gz"))
             (sha256
              (base32
-              "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr"))
+              "0ngif3ynk6xqzy5nlfjs7bsmfm81g9f145av0z86kf0vbgrigda0"))
             (patches
              (search-patches "libssh2-fix-build-failure-with-gcrypt.patch"))))
    (build-system gnu-build-system)
@@ -122,23 +128,10 @@ applications.")
    (propagated-inputs `(("libgcrypt" ,libgcrypt)
                         ("zlib" ,zlib)))
    (arguments `(#:configure-flags `("--with-libgcrypt")
-                #:phases
-                ;; FIXME: In the next core-updates cycle, replace the entire
-                ;; following ,(...) form with its first 'modify-phases'
-                ;; subform.  The change made here is only strictly needed on
-                ;; MIPS, but should work on any system.  For now, we apply it
-                ;; only to MIPS to avoid forcing thousands of rebuilds on
-                ;; other systems.
-                ,(if (string-prefix? "mips" (or (%current-target-system)
-                                                (%current-system)))
-                     '(modify-phases %standard-phases
-                        (replace 'bootstrap
-                          (lambda _
-                            (invoke "autoreconf" "-v"))))
-                     '(modify-phases %standard-phases
-                        (add-before 'configure 'autoreconf
-                          (lambda _
-                            (invoke "autoreconf" "-v")))))))
+                #:phases (modify-phases %standard-phases
+                           (replace 'bootstrap
+                             (lambda _
+                               (invoke "autoreconf" "-v"))))))
    (native-inputs `(("autoconf" ,autoconf)
                     ("automake" ,automake)))
    (synopsis "Client-side C library implementing the SSH2 protocol")
@@ -148,7 +141,7 @@ the SSH-2 protocol in an easy-to-use self-contained package.  It can be built
 into an application to perform many different tasks when communicating with
 a server that supports the SSH-2 protocol.")
    (license license:bsd-3)
-   (home-page "http://www.libssh2.org/")))
+   (home-page "https://www.libssh2.org/")))
 
 (define-public openssh
   (package
@@ -158,12 +151,15 @@ a server that supports the SSH-2 protocol.")
              (method url-fetch)
              (uri (string-append "mirror://openbsd/OpenSSH/portable/"
                                  name "-" version ".tar.gz"))
+             (patches (search-patches "openssh-CVE-2018-20685.patch"))
              (sha256
               (base32
                "1b8sy6v0b8v4ggmknwcqx3y1rjcpsll0f1f8f4vyv11x4ni3njvb"))))
    (build-system gnu-build-system)
-   (native-inputs `(("groff" ,groff)))
-   (inputs `(("openssl" ,openssl)
+   (native-inputs `(("groff" ,groff)
+                    ("pkg-config" ,pkg-config)))
+   (inputs `(("libedit" ,libedit)
+             ("openssl" ,openssl)
              ("pam" ,linux-pam)
              ("mit-krb5" ,mit-krb5)
              ("zlib" ,zlib)
@@ -183,6 +179,9 @@ a server that supports the SSH-2 protocol.")
                                           (assoc-ref %build-inputs "mit-krb5")
                                           "/bin")
 
+                          ;; libedit needed for sftp completion
+                          "--with-libedit"
+
                           ;; Enable PAM support in sshd.
                           "--with-pam")
 
@@ -245,16 +244,29 @@ Additionally, various channel-specific options can be negotiated.")
     (version "0.11.3")
     (home-page "https://github.com/artyom-poptsov/guile-ssh")
     (source (origin
-              ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz
-              ;; exists, but the server appears to be too slow and unreliable.
-              ;; Also, using this URL allows the GitHub updater to work.
-              (method url-fetch)
-              (uri (string-append home-page "/archive/v"
-                                  version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1g2jzcg1p25zrkx06j160qb8bgcwa3001ys4q02496xs61pvywqk"))))
+                "03bv3hwp2s8f0bqgfjaan9jx4dyab0abv27n2zn2g0izlidv0vl6"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; libssh >= 0.8.0 no longer provides libssh_threads: see
+                  ;; <https://github.com/artyom-poptsov/guile-ssh/issues/9>.
+                  (substitute* "libguile-ssh/Makefile.am"
+                    (("-lssh_threads") ""))
+
+                  ;; This test would wrongfully pick DSS keys when running on
+                  ;; libssh >= 0.8.0, which fails:
+                  ;; <https://github.com/artyom-poptsov/guile-ssh/issues/10>.
+                  (substitute* "tests/server.scm"
+                    (("= %libssh-minor-version 7")
+                     ">= %libssh-minor-version 7"))
+                  #t))))
     (build-system gnu-build-system)
     (outputs '("out" "debug"))
     (arguments
@@ -451,6 +463,9 @@ TCP, not the SSH protocol.")
                 "0rgavbzw7jrs5wslxm0dnwx2m409yzxd9hazd92r7kx8xikr3yzj"))))
     (build-system gnu-build-system)
     (arguments `(#:tests? #f)) ; there is no "make check" or anything similar
+    ;; TODO: Investigate unbundling libtommath and libtomcrypt or at least
+    ;; cherry-picking important bug fixes from them. See <bugs.gnu.org/24674>
+    ;; for more information.
     (inputs `(("zlib" ,zlib)))
     (synopsis "Small SSH server and client")
     (description "Dropbear is a relatively small SSH server and
@@ -621,22 +636,22 @@ authentication}.")
 (define-public autossh
   (package
     (name "autossh")
-    (version "1.4f")
+    (version "1.4g")
     (source
      (origin
        (method url-fetch)
        (uri (string-append
-             "http://www.harding.motd.ca/autossh/autossh-"
+             "https://www.harding.motd.ca/autossh/autossh-"
              version ".tgz"))
        (sha256
-        (base32 "1wpqwa2872nqgqbhnb6nnkrlzpdawd5k69gh1qp68354pvhyawh1"))))
+        (base32 "0xqjw8df68f4kzkns5gcah61s5wk0m44qdk2z1d6388w6viwxhsz"))))
     (build-system gnu-build-system)
     (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
     (inputs `(("openssh" ,openssh)))
     (synopsis "Automatically restart SSH sessions and tunnels")
     (description "autossh is a program to start a copy of @command{ssh} and
 monitor it, restarting it as necessary should it die or stop passing traffic.")
-    (home-page "http://www.harding.motd.ca/autossh/")
+    (home-page "https://www.harding.motd.ca/autossh/")
     (license
      ;; Why point to a source file?  Well, all the individual files have a
      ;; copy of this license in their headers, but there's no separate file