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