gnu: openssh: Update to 6.8p1.
[jackhill/guix/guix.git] / gnu / packages / ssh.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages ssh)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages gnupg)
24 #:use-module (gnu packages groff)
25 #:use-module (gnu packages openssl)
26 #:use-module (gnu packages elf)
27 #:use-module (gnu packages guile)
28 #:use-module (gnu packages pkg-config)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages texinfo)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages ncurses)
33 #:autoload (gnu packages protobuf) (protobuf)
34 #:autoload (gnu packages boost) (boost)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system cmake))
42
43 (define-public libssh
44 (package
45 (name "libssh")
46 (version "0.6.3")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "https://red.libssh.org/attachments/download/87/libssh-"
50 version ".tar.xz"))
51 (sha256
52 (base32
53 "1jyaj9h1iglvn02hrvcchbx8ycjpj8b91h8mi459k7q5jp2xgd9b"))
54 (patches
55 ;; Apply the patch as discussed at
56 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00180.html>.
57 (list (origin
58 (uri
59 "http://git.libssh.org/projects/libssh.git/patch/?id=a033b93c616f4a81afc3fc6a017396d507d96c19")
60 (method url-fetch)
61 (sha256
62 (base32
63 "16fdkjcnhc6j7qxz9575fzr9044927ws5259yh0xb9yv1q14j0vh")))))))
64 (build-system cmake-build-system)
65 (arguments
66 '(#:configure-flags '("-DWITH_GCRYPT=ON")
67
68 ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
69 #:tests? #f))
70 (inputs `(("zlib" ,zlib)
71 ;; Link against an older gcrypt, because libssh tries to access
72 ;; fields of 'gcry_thread_cbs' that are now private:
73 ;; src/threads.c:72:26: error: 'struct gcry_thread_cbs' has no member named 'mutex_init'
74 ("libgcrypt", libgcrypt-1.5)))
75 (synopsis "SSH client library")
76 (description
77 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for
78 client and server implementations. With libssh, you can remotely execute
79 programs, transfer files, and use a secure and transparent tunnel for your
80 remote applications.")
81 (home-page "http://www.libssh.org")
82 (license license:lgpl2.1+)))
83
84 (define libssh-0.5 ; kept private
85 (package (inherit libssh)
86 (version "0.5.5")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append "https://red.libssh.org/attachments/download/51/libssh-"
90 version ".tar.gz"))
91 (sha256
92 (base32
93 "17cfdff4hc0ijzrr15biq29fiabafz0bw621zlkbwbc1zh2hzpy0"))
94 (patches (list (search-patch "libssh-CVE-2014-0017.patch")))))))
95
96 (define-public libssh2
97 (package
98 (name "libssh2")
99 (version "1.4.3")
100 (source (origin
101 (method url-fetch)
102 (uri (string-append
103 "http://www.libssh2.org/download/libssh2-"
104 version ".tar.gz"))
105 (sha256 (base32
106 "0vdr478dbhbdgnniqmirawjb7mrcxckn4slhhrijxnzrkmgziipa"))))
107 (build-system gnu-build-system)
108 ;; The installed libssh2.pc file does not include paths to libgcrypt and
109 ;; zlib libraries, so we need to propagate the inputs.
110 (propagated-inputs `(("libgcrypt" ,libgcrypt)
111 ("zlib" ,zlib)))
112 (arguments '(#:configure-flags `("--with-libgcrypt")))
113 (synopsis "Client-side C library implementing the SSH2 protocol")
114 (description
115 "libssh2 is a library intended to allow software developers access to
116 the SSH-2 protocol in an easy-to-use self-contained package. It can be built
117 into an application to perform many different tasks when communicating with
118 a server that supports the SSH-2 protocol.")
119 (license license:bsd-3)
120 (home-page "http://www.libssh2.org/")))
121
122 (define-public openssh
123 (package
124 (name "openssh")
125 (version "6.8p1")
126 (source (origin
127 (method url-fetch)
128 (uri (let ((tail (string-append name "-" version ".tar.gz")))
129 (list (string-append "ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
130 tail)
131 (string-append "ftp://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
132 tail))))
133 (sha256 (base32
134 "03hnrqvjq6ghg1mp3gkarfxh6g3x1n1vjrzpbc5lh9717vklrxiz"))))
135 (build-system gnu-build-system)
136 (inputs `(("groff" ,groff)
137 ("openssl" ,openssl)
138 ("zlib" ,zlib)))
139 (arguments
140 `(#:test-target "tests"
141 #:phases
142 (alist-cons-after
143 'configure 'reset-/var/empty
144 (lambda* (#:key outputs #:allow-other-keys)
145 (let ((out (assoc-ref outputs "out")))
146 (substitute* "Makefile"
147 (("PRIVSEP_PATH=/var/empty")
148 (string-append "PRIVSEP_PATH=" out "/var/empty")))))
149 (alist-cons-before
150 'check 'patch-tests
151 (lambda _
152 ;; remove 't-exec' regress target which requires user 'sshd'
153 (substitute* "regress/Makefile"
154 (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
155 (string-append pre post))))
156 (alist-replace
157 'install
158 (lambda* (#:key (make-flags '()) #:allow-other-keys)
159 ;; install without host keys and system configuration files
160 (zero? (apply system* "make" "install-nosysconf" make-flags)))
161 %standard-phases)))))
162 (synopsis "Client and server for the secure shell (ssh) protocol")
163 (description
164 "The SSH2 protocol implemented in OpenSSH is standardised by the
165 IETF secsh working group and is specified in several RFCs and drafts.
166 It is composed of three layered components:
167
168 The transport layer provides algorithm negotiation and a key exchange.
169 The key exchange includes server authentication and results in a
170 cryptographically secured connection: it provides integrity, confidentiality
171 and optional compression.
172
173 The user authentication layer uses the established connection and relies on
174 the services provided by the transport layer. It provides several mechanisms
175 for user authentication. These include traditional password authentication
176 as well as public-key or host-based authentication mechanisms.
177
178 The connection layer multiplexes many different concurrent channels over the
179 authenticated connection and allows tunneling of login sessions and
180 TCP-forwarding. It provides a flow control service for these channels.
181 Additionally, various channel-specific options can be negotiated.")
182 (license (license:non-copyleft "file://LICENSE"
183 "See LICENSE in the distribution."))
184 (home-page "http://www.openssh.org/")))
185
186 (define-public guile-ssh
187 (package
188 (name "guile-ssh")
189 (version "0.7.2")
190 (source (origin
191 (method git-fetch)
192 (uri (git-reference
193 (url "https://github.com/artyom-poptsov/libguile-ssh.git")
194 (commit (string-append "v" version))))
195 (sha256
196 (base32
197 "1wcv10xv7ayrhrg77zyng6flknnlkzhni24nf8x9nic00zha8znk"))))
198 (build-system gnu-build-system)
199 (arguments
200 '(#:phases (alist-cons-after
201 'unpack 'autoreconf
202 (lambda* (#:key inputs #:allow-other-keys)
203 (chmod "doc/version.texi" #o777) ;make it writable
204 (zero? (system* "autoreconf" "-vfi")))
205 (alist-cons-after
206 'install 'fix-libguile-ssh-file-name
207 (lambda* (#:key outputs #:allow-other-keys)
208 (let* ((out (assoc-ref outputs "out"))
209 (libdir (string-append out "/lib"))
210 (guiledir (string-append out
211 "/share/guile/site/2.0")))
212 (substitute* (find-files guiledir ".scm")
213 (("\"libguile-ssh\"")
214 (string-append "\"" libdir "/libguile-ssh\"")))
215
216 ;; Make sure it works.
217 (setenv "GUILE_LOAD_PATH" guiledir)
218 (setenv "GUILE_LOAD_COMPILED_PATH" guiledir)
219 (zero?
220 (system* "guile" "-c" "(use-modules (ssh session))"))))
221 %standard-phases))
222 #:configure-flags (list (string-append "--with-guilesitedir="
223 (assoc-ref %outputs "out")
224 "/share/guile/site/2.0"))
225
226 ;; Tests are not parallel-safe.
227 #:parallel-tests? #f))
228 (native-inputs `(("autoconf" ,autoconf)
229 ("automake" ,automake)
230 ("libtool" ,libtool)
231 ("texinfo" ,texinfo)
232 ("pkg-config" ,pkg-config)
233 ("which" ,which)))
234 (inputs `(("guile" ,guile-2.0)
235 ("libssh" ,libssh)
236 ("libgcrypt" ,libgcrypt-1.5)))
237 (synopsis "Guile bindings to libssh")
238 (description
239 "Guile-SSH is a library that provides access to the SSH protocol for
240 programs written in GNU Guile interpreter. It is a wrapper to the underlying
241 libssh library.")
242 (home-page "https://github.com/artyom-poptsov/libguile-ssh")
243 (license license:gpl3+)))
244
245 (define-public corkscrew
246 (package
247 (name "corkscrew")
248 (version "2.0")
249 (source
250 (origin
251 (method url-fetch)
252 (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-"
253 version ".tar.gz"))
254 (sha256 (base32
255 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
256 (build-system gnu-build-system)
257 (arguments
258 ;; Replace configure phase as the ./configure script does not link
259 ;; CONFIG_SHELL and SHELL passed as parameters
260 '(#:phases
261 (alist-replace
262 'configure
263 (lambda* (#:key outputs inputs system target
264 #:allow-other-keys #:rest args)
265 (let* ((configure (assoc-ref %standard-phases 'configure))
266 (prefix (assoc-ref outputs "out"))
267 (bash (which "bash"))
268 ;; Set --build and --host flags as the provided config.guess
269 ;; is not able to detect them
270 (flags `(,(string-append "--prefix=" prefix)
271 ,(string-append "--build=" system)
272 ,(string-append "--host="
273 (or target system)))))
274 (setenv "CONFIG_SHELL" bash)
275 (zero? (apply system* bash
276 (string-append "." "/configure")
277 flags))))
278 %standard-phases)))
279 (home-page "http://www.agroman.net/corkscrew")
280 (synopsis "Tunneling SSH through HTTP proxies")
281 (description
282 "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING:
283 At the moment only plain text authentication is supported, should you require
284 to use it with your HTTP proxy. Digest based authentication may be supported
285 in future and NTLM based authentication is most likey never be supported.")
286 (license license:gpl2+)))
287
288 (define-public mosh
289 (package
290 (name "mosh")
291 (version "1.2.4")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "http://mosh.mit.edu/mosh-"
295 version ".tar.gz"))
296 (sha256
297 (base32
298 "0inzfmqrab3n97m7rrmhd4xh3hjz0xva2sfl5m06w11668r0skg7"))))
299 (build-system gnu-build-system)
300 (arguments
301 '(#:phases (alist-cons-after
302 'install 'wrap
303 (lambda* (#:key outputs #:allow-other-keys)
304 ;; Make sure 'mosh' can find 'mosh-client' and
305 ;; 'mosh-server'.
306 (let* ((out (assoc-ref outputs "out"))
307 (bin (string-append out "/bin")))
308 (wrap-program (string-append bin "/mosh")
309 `("PATH" ":" prefix (,bin)))))
310 %standard-phases)))
311 (native-inputs
312 `(("pkg-config" ,pkg-config)))
313 (inputs
314 `(("openssl" ,openssl)
315 ("perl" ,perl)
316 ("perl-io-tty" ,perl-io-tty)
317 ("zlib" ,zlib)
318 ("ncurses" ,ncurses)
319 ("protobuf" ,protobuf)
320 ("boost-headers" ,boost)))
321 (home-page "http://mosh.mit.edu/")
322 (synopsis "Remote shell tolerant to intermittent connectivity")
323 (description
324 "Remote terminal application that allows roaming, supports intermittent
325 connectivity, and provides intelligent local echo and line editing of user
326 keystrokes. Mosh is a replacement for SSH. It's more robust and responsive,
327 especially over Wi-Fi, cellular, and long-distance links.")
328 (license license:gpl3+)))
329
330 (define-public dropbear
331 (package
332 (name "dropbear")
333 (version "2014.63")
334 (source (origin
335 (method url-fetch)
336 (uri (string-append
337 "http://matt.ucc.asn.au/" name "/releases/" name "-" version ".tar.bz2"))
338 (sha256
339 (base32 "1bjpbg2vi5f332q4bqxkidkjfxsqmnqvp4g1wyh8d99b8gg94nar"))))
340 (build-system gnu-build-system)
341 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
342 (inputs `(("zlib" ,zlib)))
343 (synopsis "Small SSH server and client")
344 (description "Dropbear is a relatively small SSH server and
345 client. It runs on a variety of POSIX-based platforms. Dropbear is
346 particularly useful for embedded systems, such as wireless routers.")
347 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
348 (license (license:x11-style "" "See file LICENSE."))))