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