gnu: avidemux: Don't replace 'sh' reference with 'bash'.
[jackhill/guix/guix.git] / gnu / packages / tls.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
3c0f7910 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
80cc3a0a 3;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
29a7c98a 4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
cc2b77df 5;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
9fd0838b 6;;; Copyright © 2015 David Thompson <davet@gnu.org>
12433a21 7;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name>
df0625ab 8;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
3ea110b7 9;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
679b535b 10;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
375cef6c 11;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
7543f865 12;;;
233e7676 13;;; This file is part of GNU Guix.
7543f865 14;;;
233e7676 15;;; GNU Guix is free software; you can redistribute it and/or modify it
7543f865
LC
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
233e7676 20;;; GNU Guix is distributed in the hope that it will be useful, but
7543f865
LC
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
233e7676 26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
7543f865 27
a7fd7b68 28(define-module (gnu packages tls)
e9aa8d0c 29 #:use-module ((guix licenses) #:prefix license:)
7543f865
LC
30 #:use-module (guix packages)
31 #:use-module (guix download)
29a7c98a 32 #:use-module (guix utils)
7543f865 33 #:use-module (guix build-system gnu)
cc2b77df 34 #:use-module (guix build-system perl)
7890e3ba 35 #:use-module (guix build-system python)
f61e0e79 36 #:use-module (gnu packages compression)
013ce67b 37 #:use-module (gnu packages)
1ffa7090 38 #:use-module (gnu packages guile)
0581c273 39 #:use-module (gnu packages libbsd)
27e86bed 40 #:use-module (gnu packages libffi)
866f469e 41 #:use-module (gnu packages libidn)
5d4c90ae 42 #:use-module (gnu packages linux)
7890e3ba 43 #:use-module (gnu packages ncurses)
27e86bed 44 #:use-module (gnu packages nettle)
1ffa7090 45 #:use-module (gnu packages perl)
27e86bed 46 #:use-module (gnu packages pkg-config)
7890e3ba 47 #:use-module (gnu packages python)
a31f4d35 48 #:use-module (gnu packages texinfo)
079f013b
LC
49 #:use-module (gnu packages base)
50 #:use-module (srfi srfi-1))
7543f865
LC
51
52(define-public libtasn1
53 (package
54 (name "libtasn1")
12433a21 55 (version "4.9")
7543f865
LC
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
60 version ".tar.gz"))
61 (sha256
62 (base32
12433a21 63 "0869cp6jx7cajgv6cnddsh3vc7bimmdkdjn80y1jpb4iss7plvsg"))))
7543f865 64 (build-system gnu-build-system)
3ea110b7 65 (native-inputs `(("perl" ,perl)))
7543f865 66 (home-page "http://www.gnu.org/software/libtasn1/")
f50d2669 67 (synopsis "ASN.1 library")
7543f865 68 (description
79c311b8
LC
69 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
70for transmitting machine-neutral encodings of data objects in computer
a22dc0c4
LC
71networking, allowing for formal validation of data according to some
72specifications.")
e9aa8d0c 73 (license license:lgpl2.0+)))
7543f865 74
375cef6c
HG
75(define-public asn1c
76 (package
77 (name "asn1c")
78 (version "0.9.27")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "https://lionet.info/soft/asn1c-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "17nvn2kzvlryasr9dzqg6gs27b9lvqpval0k31pb64bjqbhn8pq2"))))
86 (build-system gnu-build-system)
87 (native-inputs
88 `(("perl" ,perl)))
89 (home-page "https://lionet.info/asn1c")
90 (synopsis "ASN.1 to C compiler")
91 (description "The ASN.1 to C compiler takes ASN.1 module
92files and generates C++ compatible C source code. That code can be
93used to serialize the native C structures into compact and unambiguous
94BER/XER/PER-based data files, and deserialize the files back.
95
96Various ASN.1 based formats are widely used in the industry, such as to encode
97the X.509 certificates employed in the HTTPS handshake, to exchange control
98data between mobile phones and cellular networks, to car-to-car communication
99in intelligent transportation networks.")
100 (license license:bsd-2)))
101
27e86bed
AE
102(define-public p11-kit
103 (package
104 (name "p11-kit")
2b11b9ab 105 (version "0.23.2")
27e86bed
AE
106 (source
107 (origin
108 (method url-fetch)
5cc3096c 109 (uri (string-append "https://p11-glue.freedesktop.org/releases/p11-kit-"
27e86bed
AE
110 version ".tar.gz"))
111 (sha256
112 (base32
2b11b9ab 113 "1w7szm190phlkg7qx05ychlj2dbvkgkhx9gw6dx4d5rw62l6wwms"))
27e86bed
AE
114 (modules '((guix build utils))) ; for substitute*
115 (snippet
116 '(begin
117 ;; Drop one test that fails, also when trying to compile manually.
118 ;; Reported upstream at
119 ;; https://bugs.freedesktop.org/show_bug.cgi?id=89027
120 (substitute* "Makefile.in"
121 (("test-module\\$\\(EXEEXT\\) ") ""))))))
122 (build-system gnu-build-system)
123 (native-inputs
124 `(("pkg-config" ,pkg-config)))
125 (inputs
126 `(("libffi" ,libffi)
127 ("libtasn1" ,libtasn1)))
128 (arguments
129 `(#:configure-flags '("--without-trust-paths")))
130 (home-page "http://p11-glue.freedesktop.org/p11-kit.html")
131 (synopsis "PKCS#11 library")
132 (description
133 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
134provides a standard configuration setup for installing PKCS#11 modules
135in such a way that they are discoverable. It also solves problems with
136coordinating the use of PKCS#11 by different components or libraries
137living in the same process.")
e9aa8d0c 138 (license license:bsd-3)))
27e86bed 139
7543f865
LC
140(define-public gnutls
141 (package
142 (name "gnutls")
ce0b822e 143 (version "3.5.4")
3c0f7910 144 (replacement gnutls-3.5.8)
d7d408d5
LC
145 (source (origin
146 (method url-fetch)
147 (uri
148 ;; Note: Releases are no longer on ftp.gnu.org since the
149 ;; schism (after version 3.1.5).
d93627e4 150 (string-append "mirror://gnupg/gnutls/v"
29a7c98a 151 (version-major+minor version)
d93627e4 152 "/gnutls-" version ".tar.xz"))
d7d408d5
LC
153 (sha256
154 (base32
ce0b822e 155 "1sx8p7v452s9m854r2c5pvcd1k15a3caiv5h35fhrxz0691h2f2f"))))
7543f865 156 (build-system gnu-build-system)
b94ae0b8
AK
157 (arguments
158 '(#:configure-flags
159 (list (string-append "--with-guile-site-dir="
160 (assoc-ref %outputs "out")
aa7c7f21
MW
161 "/share/guile/site/2.0")
162 ;; GnuTLS doesn't consult any environment variables to specify
163 ;; the location of the system-wide trust store. Instead it has a
164 ;; configure-time option. Unless specified, its configure script
165 ;; attempts to auto-detect the location by looking for common
8f65585b 166 ;; places in the file system, none of which are present in our
aa7c7f21
MW
167 ;; chroot build environment. If not found, then no default trust
168 ;; store is used, so each program has to provide its own
169 ;; fallback, and users have to configure each program
170 ;; independently. This seems suboptimal.
866f469e
MW
171 "--with-default-trust-store-dir=/etc/ssl/certs"
172
173 ;; FIXME: Temporarily disable p11-kit support since it is not
174 ;; working on mips64el.
606c6380
LC
175 "--without-p11-kit")
176
177 #:phases (modify-phases %standard-phases
178 (add-after
179 'install 'move-doc
180 (lambda* (#:key outputs #:allow-other-keys)
181 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
182 (let* ((out (assoc-ref outputs "out"))
183 (doc (assoc-ref outputs "doc"))
9cdce047 184 (mandir (string-append doc "/share/man/man3"))
606c6380
LC
185 (oldman (string-append out "/share/man/man3")))
186 (mkdir-p mandir)
187 (copy-recursively oldman mandir)
188 (delete-file-recursively oldman)
189 #t))))))
190 (outputs '("out" ;4.4 MiB
191 "debug"
192 "doc")) ;4.1 MiB of man pages
a1db0975 193 (native-inputs
5d4c90ae
LF
194 `(("net-tools" ,net-tools)
195 ("pkg-config" ,pkg-config)
d2fcfd3d 196 ("which" ,which)))
7543f865
LC
197 (inputs
198 `(("guile" ,guile-2.0)
0cb9b456 199 ("perl" ,perl)))
7543f865 200 (propagated-inputs
d2fcfd3d 201 ;; These are all in the 'Requires.private' field of gnutls.pc.
7543f865 202 `(("libtasn1" ,libtasn1)
866f469e
MW
203 ("libidn" ,libidn)
204 ("nettle" ,nettle)
f61e0e79 205 ("zlib" ,zlib)))
c19700c3 206 (home-page "https://www.gnu.org/software/gnutls/")
f50d2669 207 (synopsis "Transport layer security library")
7543f865 208 (description
a22dc0c4 209 "GnuTLS is a secure communications library implementing the SSL, TLS
79c311b8 210and DTLS protocols. It is provided in the form of a C library to support the
a22dc0c4
LC
211protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
212required structures.")
63e8bb12
LC
213 (license license:lgpl2.1+)
214 (properties '((ftp-server . "ftp.gnutls.org")
215 (ftp-directory . "/gcrypt/gnutls")))))
cc2b77df 216
3c0f7910
LC
217(define gnutls-3.5.8 ;fixes GNUTLS-SA-2017-{1,2}
218 (package
219 (inherit gnutls)
220 (version "3.5.8")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "mirror://gnupg/gnutls/v"
224 (version-major+minor version)
225 "/gnutls-" version ".tar.xz"))
226 (sha256
227 (base32
228 "1zyl2z63s68hx1dpxqx0lykmlf3rwrzlrf44sq3h7dvjmr1z55qf"))))
229 (replacement #f)))
230
079f013b
LC
231(define-public gnutls/guile-2.2
232 ;; GnuTLS for Guile 2.2. This is supported by GnuTLS >= 3.5.5.
233 (package
234 (inherit gnutls-3.5.8)
235 (name "guile2.2-gnutls")
236 (arguments
237 ;; Remove '--with-guile-site-dir=…/2.0'.
238 (substitute-keyword-arguments (package-arguments gnutls-3.5.8)
239 ((#:configure-flags flags)
240 `(cdr ,flags))))
241 (inputs `(("guile" ,guile-next)
242 ,@(alist-delete "guile" (package-inputs gnutls-3.5.8))))))
243
cc2b77df
AE
244(define-public openssl
245 (package
246 (name "openssl")
1d8de185 247 (version "1.0.2j")
cc2b77df 248 (source (origin
4cff124b
LC
249 (method url-fetch)
250 (uri (list (string-append "ftp://ftp.openssl.org/source/"
251 name "-" version ".tar.gz")
252 (string-append "ftp://ftp.openssl.org/source/old/"
253 (string-trim-right version char-set:letter)
254 "/" name "-" version ".tar.gz")))
255 (sha256
256 (base32
1d8de185 257 "0cf4ar97ijfc7mg35zdgpad6x8ivkdx9qii6mz35khi1ps9g5bz7"))
fc1adab1 258 (patches (search-patches "openssl-runpath.patch"
1d8de185 259 "openssl-c-rehash-in.patch"))))
cc2b77df 260 (build-system gnu-build-system)
8c78aeb7 261 (outputs '("out"
a909b576 262 "doc" ;1.5MiB of man3 pages
8c78aeb7 263 "static")) ;6MiB of .a files
cc2b77df
AE
264 (native-inputs `(("perl" ,perl)))
265 (arguments
d03781c3
LC
266 `(#:disallowed-references (,perl)
267 #:parallel-build? #f
cc2b77df
AE
268 #:parallel-tests? #f
269 #:test-target "test"
8c9ec203
LF
270
271 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
272 ;; so we explicitly disallow it here.
273 #:disallowed-references ,(list (canonical-package perl))
cc2b77df 274 #:phases
b6cb1358 275 (modify-phases %standard-phases
4fb254a3 276 (add-before
86c8f1da 277 'configure 'patch-Makefile.org
4fb254a3
LC
278 (lambda* (#:key outputs #:allow-other-keys)
279 ;; The default MANDIR is some unusual place. Fix that.
280 (let ((out (assoc-ref outputs "out")))
86c8f1da 281 (patch-makefile-SHELL "Makefile.org")
4fb254a3
LC
282 (substitute* "Makefile.org"
283 (("^MANDIR[[:blank:]]*=.*$")
284 (string-append "MANDIR = " out "/share/man\n")))
285 #t)))
b6cb1358
LC
286 (replace
287 'configure
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let ((out (assoc-ref outputs "out")))
290 (zero?
291 (system* "./config"
292 "shared" ;build shared libraries
293 "--libdir=lib"
4fb254a3
LC
294
295 ;; The default for this catch-all directory is
296 ;; PREFIX/ssl. Change that to something more
297 ;; conventional.
298 (string-append "--openssldir=" out
299 "/share/openssl-" ,version)
300
b6cb1358
LC
301 (string-append "--prefix=" out)
302
303 ;; XXX FIXME: Work around a code generation bug in GCC
304 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
305 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
306 ,@(if (and (not (%current-target-system))
307 (string-prefix? "armhf" (%current-system)))
308 '("-mfpu=vfpv3")
309 '()))))))
fe8199a8
LC
310 (add-after
311 'install 'make-libraries-writable
312 (lambda* (#:key outputs #:allow-other-keys)
313 ;; Make libraries writable so that 'strip' does its job.
314 (let ((out (assoc-ref outputs "out")))
315 (for-each (lambda (file)
316 (chmod file #o644))
317 (find-files (string-append out "/lib")
318 "\\.so"))
319 #t)))
8c78aeb7
LC
320 (add-after 'install 'move-static-libraries
321 (lambda* (#:key outputs #:allow-other-keys)
322 ;; Move static libraries to the "static" output.
323 (let* ((out (assoc-ref outputs "out"))
324 (lib (string-append out "/lib"))
325 (static (assoc-ref outputs "static"))
326 (slib (string-append static "/lib")))
327 (mkdir-p slib)
328 (for-each (lambda (file)
329 (install-file file slib)
330 (delete-file file))
331 (find-files lib "\\.a$"))
332 #t)))
a909b576
LC
333 (add-after 'install 'move-man3-pages
334 (lambda* (#:key outputs #:allow-other-keys)
335 ;; Move section 3 man pages to "doc".
336 (let* ((out (assoc-ref outputs "out"))
337 (man3 (string-append out "/share/man/man3"))
338 (doc (assoc-ref outputs "doc"))
339 (target (string-append doc "/share/man/man3")))
340 (mkdir-p target)
341 (for-each (lambda (file)
342 (rename-file file
343 (string-append target "/"
344 (basename file))))
345 (find-files man3))
5c838ec9 346 (delete-file-recursively man3)
a909b576 347 #t)))
b6cb1358
LC
348 (add-before
349 'patch-source-shebangs 'patch-tests
350 (lambda* (#:key inputs native-inputs #:allow-other-keys)
351 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
352 (substitute* (find-files "test" ".*")
353 (("/bin/sh")
354 (string-append bash "/bin/bash"))
355 (("/bin/rm")
86c8f1da
MW
356 "rm"))
357 #t)))
784d6e91
LC
358 (add-after
359 'install 'remove-miscellany
360 (lambda* (#:key outputs #:allow-other-keys)
361 ;; The 'misc' directory contains random undocumented shell and Perl
362 ;; scripts. Remove them to avoid retaining a reference on Perl.
363 (let ((out (assoc-ref outputs "out")))
364 (delete-file-recursively (string-append out "/share/openssl-"
365 ,version "/misc"))
366 #t))))))
cc2b77df
AE
367 (native-search-paths
368 ;; FIXME: These two variables must designate a single file or directory
369 ;; and are not actually "search paths." In practice it works OK in user
370 ;; profiles because there's always just one item that matches the
371 ;; specification.
372 (list (search-path-specification
373 (variable "SSL_CERT_DIR")
374 (files '("etc/ssl/certs")))
375 (search-path-specification
376 (variable "SSL_CERT_FILE")
377 (files '("etc/ssl/certs/ca-certificates.crt")))))
378 (synopsis "SSL/TLS implementation")
379 (description
e881752c 380 "OpenSSL is an implementation of SSL/TLS.")
e9aa8d0c 381 (license license:openssl)
cc2b77df
AE
382 (home-page "http://www.openssl.org/")))
383
763899f0
LF
384(define-public openssl-next
385 (package
386 (inherit openssl)
387 (name "openssl")
fc184fe2 388 (version "1.1.0c")
763899f0
LF
389 (source (origin
390 (method url-fetch)
391 (uri (list (string-append "ftp://ftp.openssl.org/source/"
392 name "-" version ".tar.gz")
393 (string-append "ftp://ftp.openssl.org/source/old/"
394 (string-trim-right version char-set:letter)
395 "/" name "-" version ".tar.gz")))
396 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
397 (sha256
398 (base32
fc184fe2 399 "1xfn5ydl14myd9wgxm4nxy5a42cpp1g12ijf3g9m4mz0l90n8hzw"))))
763899f0
LF
400 (outputs '("out"
401 "doc" ;1.3MiB of man3 pages
402 "static")) ; 5.5MiB of .a files
403 (arguments
404 (substitute-keyword-arguments (package-arguments openssl)
405 ((#:phases phases)
406 `(modify-phases ,phases
407 (delete 'patch-tests) ; These two phases are not needed by
408 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
409
fc184fe2
MB
410 ;; Override configure phase since -rpath is now a configure option.
411 (replace 'configure
763899f0 412 (lambda* (#:key outputs #:allow-other-keys)
fc184fe2
MB
413 (let* ((out (assoc-ref outputs "out"))
414 (lib (string-append out "/lib")))
415 (zero?
416 (system* "./config"
417 "shared" ;build shared libraries
418 "--libdir=lib"
419
420 ;; The default for this catch-all directory is
421 ;; PREFIX/ssl. Change that to something more
422 ;; conventional.
423 (string-append "--openssldir=" out
424 "/share/openssl-" ,version)
425
426 (string-append "--prefix=" out)
427 (string-append "-Wl,-rpath," lib)
428
429 ;; XXX FIXME: Work around a code generation bug in GCC
430 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
431 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
432 ,@(if (and (not (%current-target-system))
433 (string-prefix? "armhf" (%current-system)))
434 '("-mfpu=vfpv3")
435 '()))))))
436
437 ;; XXX: Duplicate this phase to make sure 'version' evaluates
438 ;; in the current scope and not the inherited one.
439 (replace 'remove-miscellany
440 (lambda* (#:key outputs #:allow-other-keys)
441 ;; The 'misc' directory contains random undocumented shell and Perl
442 ;; scripts. Remove them to avoid retaining a reference on Perl.
443 (let ((out (assoc-ref outputs "out")))
444 (delete-file-recursively (string-append out "/share/openssl-"
445 ,version "/misc"))
763899f0
LF
446 #t)))))))))
447
cb6a802c
AE
448(define-public libressl
449 (package
450 (name "libressl")
a7c9b062 451 (version "2.5.0")
cb6a802c
AE
452 (source
453 (origin
454 (method url-fetch)
455 (uri (string-append
456 "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-"
457 version ".tar.gz"))
1a957c21
LF
458 (sha256
459 (base32
a7c9b062 460 "1bkfvapi4z826slycmicvs7hwgk4l82gd8w6nqvznldbammvyll6"))))
cb6a802c
AE
461 (build-system gnu-build-system)
462 (native-search-paths
463 ;; FIXME: These two variables must designate a single file or directory
464 ;; and are not actually "search paths." In practice it works OK in
465 ;; user profiles because there's always just one item that matches the
466 ;; specification.
467 (list (search-path-specification
468 (variable "SSL_CERT_DIR")
469 (files '("etc/ssl/certs")))
470 (search-path-specification
471 (variable "SSL_CERT_FILE")
472 (files '("etc/ssl/certs/ca-certificates.crt")))))
473 (home-page "http://www.libressl.org/")
474 (synopsis "SSL/TLS implementation")
475 (description "LibreSSL is a version of the TLS/crypto stack forked
476from OpenSSL in 2014, with the goals of modernizing the codebase, improving
477security, and applying best practice development processes.")
478 ;; Files taken from OpenSSL keep their license, others are under various
479 ;; non-copyleft licenses.
480 (license (list license:openssl
481 (license:non-copyleft
482 "file://COPYING"
483 "See COPYING in the distribution.")))))
484
6cefd53d 485(define-public python-acme
7890e3ba 486 (package
6cefd53d 487 (name "python-acme")
df0625ab 488 (version "0.10.1")
7890e3ba 489 (source (origin
9495cf9a 490 (method url-fetch)
f349d36e 491 (uri (pypi-uri "acme" version))
7890e3ba 492 (sha256
df0625ab
LF
493 (base32
494 "04d2464klbhvrsrlmca10qxyd968qz7xizdppr53cihnlfq2y77m"))))
7890e3ba
LF
495 (build-system python-build-system)
496 (arguments
6cefd53d 497 `(#:phases
9bee9d87 498 (modify-phases %standard-phases
50a7963a
LF
499 (add-after 'install 'docs
500 (lambda* (#:key outputs #:allow-other-keys)
501 (let* ((out (assoc-ref outputs "out"))
502 (man (string-append out "/share/man/man1"))
503 (info (string-append out "/info")))
504 (and (zero? (system* "make" "-C" "docs" "man" "info"))
505 (install-file "docs/_build/texinfo/acme-python.info" info)
506 (install-file "docs/_build/man/acme-python.1" man)
507 #t)))))))
508 ;; TODO: Add optional inputs for testing.
7890e3ba 509 (native-inputs
6cefd53d 510 `(("python-mock" ,python-mock)
50a7963a
LF
511 ;; For documentation
512 ("python-sphinx" ,python-sphinx)
513 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
514 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
50a7963a 515 ("texinfo" ,texinfo)))
7890e3ba 516 (propagated-inputs
6cefd53d
LF
517 `(("python-ndg-httpsclient" ,python-ndg-httpsclient)
518 ("python-werkzeug" ,python-werkzeug)
519 ("python-six" ,python-six)
520 ("python-requests" ,python-requests)
521 ("python-pytz" ,python-pytz)
522 ("python-pyrfc3339" ,python-pyrfc3339)
523 ("python-pyasn1" ,python-pyasn1)
524 ("python-cryptography" ,python-cryptography)
525 ("python-pyopenssl" ,python-pyopenssl)))
7890e3ba
LF
526 (home-page "https://github.com/letsencrypt/letsencrypt")
527 (synopsis "ACME protocol implementation in Python")
528 (description "ACME protocol implementation in Python")
529 (license license:asl2.0)))
530
6cefd53d
LF
531(define-public python2-acme
532 (package-with-python2 python-acme))
533
9495cf9a 534(define-public certbot
9fd0838b 535 (package
9495cf9a 536 (name "certbot")
df0625ab 537 (version "0.10.1")
9fd0838b
DT
538 (source (origin
539 (method url-fetch)
f349d36e 540 (uri (pypi-uri name version))
9fd0838b
DT
541 (sha256
542 (base32
df0625ab 543 "0hx71ba7w8kf8hpg1wy5zf8ggczb57g3kcsdg83kxjpqnfnrkmp0"))))
9fd0838b
DT
544 (build-system python-build-system)
545 (arguments
f9263d9a
LF
546 `(#:python ,python-2
547 #:phases
548 (modify-phases %standard-phases
234d0b69 549 (add-after 'build 'docs
f9263d9a
LF
550 (lambda* (#:key outputs #:allow-other-keys)
551 (let* ((out (assoc-ref outputs "out"))
552 (man1 (string-append out "/share/man/man1"))
553 (man7 (string-append out "/share/man/man7"))
554 (info (string-append out "/info")))
f9263d9a
LF
555 (and
556 (zero? (system* "make" "-C" "docs" "man" "info"))
9495cf9a
LF
557 (install-file "docs/_build/texinfo/Certbot.info" info)
558 (install-file "docs/_build/man/certbot.1" man1)
559 (install-file "docs/_build/man/certbot.7" man7)
f9263d9a
LF
560 #t)))))))
561 ;; TODO: Add optional inputs for testing.
9fd0838b
DT
562 (native-inputs
563 `(("python2-nose" ,python2-nose)
f9263d9a
LF
564 ("python2-mock" ,python2-mock)
565 ;; For documentation
566 ("python2-sphinx" ,python2-sphinx)
567 ("python2-sphinx-rtd-theme" ,python2-sphinx-rtd-theme)
568 ("python2-sphinx-repoze-autointerface" ,python2-sphinx-repoze-autointerface)
569 ("python2-sphinxcontrib-programoutput" ,python2-sphinxcontrib-programoutput)
570 ("texinfo" ,texinfo)))
9fd0838b 571 (propagated-inputs
6cefd53d 572 `(("python2-acme" ,python2-acme)
9fd0838b
DT
573 ("python2-zope-interface" ,python2-zope-interface)
574 ("python2-pythondialog" ,python2-pythondialog)
575 ("python2-pyrfc3339" ,python2-pyrfc3339)
576 ("python2-pyopenssl" ,python2-pyopenssl)
577 ("python2-configobj" ,python2-configobj)
578 ("python2-configargparse" ,python2-configargparse)
579 ("python2-zope-component" ,python2-zope-component)
580 ("python2-parsedatetime" ,python2-parsedatetime)
581 ("python2-six" ,python2-six)
582 ("python2-psutil" ,python2-psutil)
583 ("python2-requests" ,python2-requests)
584 ("python2-pytz" ,python2-pytz)))
d8a1be63 585 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
9fd0838b
DT
586 (description "Tool to automatically receive and install X.509 certificates
587to enable TLS on servers. The client will interoperate with the Let’s Encrypt CA which
588will be issuing browser-trusted certificates for free.")
24778368 589 (home-page "https://certbot.eff.org/")
9fd0838b
DT
590 (license license:asl2.0)))
591
9495cf9a
LF
592(define-public letsencrypt
593 (package (inherit certbot)
56ab55d1
LF
594 (name "letsencrypt")
595 (properties `((superseded . ,certbot)))))
9495cf9a 596
cc2b77df
AE
597(define-public perl-net-ssleay
598 (package
599 (name "perl-net-ssleay")
600 (version "1.68")
601 (source (origin
602 (method url-fetch)
603 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
604 "Net-SSLeay-" version ".tar.gz"))
605 (sha256
606 (base32
1084ec08 607 "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p"))))
cc2b77df 608 (build-system perl-build-system)
1084ec08
MW
609 (native-inputs
610 `(("patch" ,patch)
611 ("patch/disable-ede-test"
612 ,(search-patch "perl-net-ssleay-disable-ede-test.patch"))))
cc2b77df
AE
613 (inputs `(("openssl" ,openssl)))
614 (arguments
1084ec08
MW
615 `(#:phases
616 (modify-phases %standard-phases
617 (add-after
618 'unpack 'apply-patch
619 (lambda* (#:key inputs #:allow-other-keys)
620 ;; XXX We apply this patch here instead of in the 'origin' because
621 ;; this package's build system fails badly when the source file
622 ;; times are zeroed.
623 ;; XXX Try removing this patch for perl-net-ssleay > 1.68
624 (zero? (system* "patch" "--force" "-p1" "-i"
625 (assoc-ref inputs "patch/disable-ede-test")))))
626 (add-before
627 'configure 'set-ssl-prefix
628 (lambda* (#:key inputs #:allow-other-keys)
629 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
630 #t)))))
cc2b77df
AE
631 (synopsis "Perl extension for using OpenSSL")
632 (description
633 "This module offers some high level convenience functions for accessing
634web pages on SSL servers (for symmetry, the same API is offered for accessing
635http servers, too), an sslcat() function for writing your own clients, and
636finally access to the SSL api of the SSLeay/OpenSSL package so you can write
637servers or clients for more complicated applications.")
638 (license (package-license perl))
639 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
4532c0c0
DM
640
641(define-public perl-crypt-openssl-rsa
642 (package
643 (name "perl-crypt-openssl-rsa")
644 (version "0.28")
645 (source
646 (origin
647 (method url-fetch)
648 (uri (string-append
649 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
650 version
651 ".tar.gz"))
652 (sha256
653 (base32
654 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
655 (build-system perl-build-system)
656 (inputs
657 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
658 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
659 ("openssl" ,openssl)))
660 (arguments perl-crypt-arguments)
661 (home-page
662 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
663 (synopsis
664 "RSA encoding and decoding, using the openSSL libraries")
665 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
666OpenSSL libraries).")
667 (license (package-license perl))))
adff71ca
DM
668
669(define perl-crypt-arguments
670 `(#:phases (modify-phases %standard-phases
671 (add-before 'configure 'patch-Makefile.PL
672 (lambda* (#:key inputs #:allow-other-keys)
673 (substitute* "Makefile.PL"
674 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
675 (assoc-ref inputs "openssl")
676 "/lib -lcrypto'],")))
677 #t)))))
678
679(define-public perl-crypt-openssl-bignum
680 (package
681 (name "perl-crypt-openssl-bignum")
682 (version "0.06")
683 (source
684 (origin
685 (method url-fetch)
686 (uri (string-append
687 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
688 version
689 ".tar.gz"))
690 (sha256
691 (base32
692 "05yzrdglrrzp191krf77zrwfkmzrfwrsrx1vyskbj94522lszk67"))))
693 (build-system perl-build-system)
694 (inputs `(("openssl" ,openssl)))
695 (arguments perl-crypt-arguments)
696 (home-page
697 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
698 (synopsis
699 "OpenSSL's multiprecision integer arithmetic in Perl")
700 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
701arithmetic in Perl.")
702 ;; At your option either gpl1+ or the Artistic License
703 (license (package-license perl))))
cccb4d26
DM
704
705(define-public perl-crypt-openssl-random
706 (package
707 (name "perl-crypt-openssl-random")
708 (version "0.11")
709 (source
710 (origin
711 (method url-fetch)
712 (uri (string-append
713 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
714 version
715 ".tar.gz"))
716 (sha256
717 (base32
718 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
719 (build-system perl-build-system)
720 (inputs `(("openssl" ,openssl)))
721 (arguments perl-crypt-arguments)
722 (home-page
723 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
724 (synopsis
725 "OpenSSL/LibreSSL pseudo-random number generator access")
726 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
727number generator")
728 (license (package-license perl))))
0581c273
LF
729
730(define-public acme-client
731 (package
732 (name "acme-client")
4b569a4f 733 (version "0.1.15")
0581c273
LF
734 (source (origin
735 (method url-fetch)
736 (uri (string-append "https://kristaps.bsd.lv/" name "/"
737 "snapshots/" name "-portable-"
738 version ".tgz"))
739 (sha256
740 (base32
4b569a4f 741 "07p723391whrswl4rir0l1k03l457sjscnj0cfaxr8mfnkx4y3wi"))))
0581c273
LF
742 (build-system gnu-build-system)
743 (arguments
744 '(#:tests? #f ; no test suite
745 #:make-flags
746 (list "CC=gcc"
747 (string-append "PREFIX=" (assoc-ref %outputs "out")))
748 #:phases
749 (modify-phases %standard-phases
7c1a7bf4
LF
750 (add-after 'unpack 'patch-paths
751 (lambda* (#:key inputs #:allow-other-keys)
752 (let ((pem (string-append (assoc-ref inputs "libressl")
753 "/etc/ssl/cert.pem")))
754 (substitute* "http.c"
755 (("/etc/ssl/cert.pem") pem))
756 #t)))
0581c273 757 (delete 'configure)))) ; no './configure' script
4b569a4f
LF
758 (native-inputs
759 `(("pkg-config" ,pkg-config)))
0581c273
LF
760 (inputs
761 `(("libbsd" ,libbsd)
762 ("libressl" ,libressl)))
763 (synopsis "Let's Encrypt client by the OpenBSD project")
764 (description "acme-client is a Let's Encrypt client implemented in C. It
765uses a modular design, and attempts to secure itself by dropping privileges and
766operating in a chroot where possible. acme-client is developed on OpenBSD and
767then ported to the GNU / Linux environment.")
768 (home-page "https://kristaps.bsd.lv/acme-client/")
769 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
770 ;; and 'jsmn.c' are distributed under the Expat license.
771 (license (list license:isc license:expat))))