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, 2017, 2018 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, 2018, 2019 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017, 2018 ng0 <ng0@n0.is>
10 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2017, 2018, 2019 Marius Bakke <mbakke@fastmail.com>
13 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
15 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages tls)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system go)
40 #:use-module (guix build-system perl)
41 #:use-module (guix build-system python)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system trivial)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages bash)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages dns)
50 #:use-module (gnu packages gawk)
51 #:use-module (gnu packages guile)
52 #:use-module (gnu packages libbsd)
53 #:use-module (gnu packages libffi)
54 #:use-module (gnu packages libidn)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages ncurses)
57 #:use-module (gnu packages nettle)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages python)
61 #:use-module (gnu packages python-crypto)
62 #:use-module (gnu packages python-web)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages sphinx)
65 #:use-module (gnu packages texinfo)
66 #:use-module (gnu packages time)
67 #:use-module (gnu packages base)
68 #:use-module (srfi srfi-1))
70 (define-public libtasn1
77 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
81 "025sqnlzji78ss2fi78dajc0v0h5fi02wp39hws41sn8qnjlnq4y"))))
82 (build-system gnu-build-system)
84 `(#:configure-flags '("--disable-static")))
85 (native-inputs `(("perl" ,perl)))
86 (home-page "https://www.gnu.org/software/libtasn1/")
87 (synopsis "ASN.1 library")
89 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
90 for transmitting machine-neutral encodings of data objects in computer
91 networking, allowing for formal validation of data according to some
93 (license license:lgpl2.0+)))
101 (uri (string-append "https://lionet.info/soft/asn1c-"
105 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
106 (build-system gnu-build-system)
109 (home-page "https://lionet.info/asn1c")
110 (synopsis "ASN.1 to C compiler")
111 (description "The ASN.1 to C compiler takes ASN.1 module
112 files and generates C++ compatible C source code. That code can be
113 used to serialize the native C structures into compact and unambiguous
114 BER/XER/PER-based data files, and deserialize the files back.
116 Various ASN.1 based formats are widely used in the industry, such as to encode
117 the X.509 certificates employed in the HTTPS handshake, to exchange control
118 data between mobile phones and cellular networks, to car-to-car communication
119 in intelligent transportation networks.")
120 (license license:bsd-2)))
122 (define-public p11-kit
129 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
130 "download/" version "/p11-kit-" version ".tar.gz"))
133 "07kwdlw07jk9833k43kkhv0q9gkll3vmd25wwp68cpy0crfv4isl"))))
134 (build-system gnu-build-system)
136 `(("pkg-config" ,pkg-config)))
139 ("libtasn1" ,libtasn1)))
141 `(#:configure-flags '("--without-trust-paths")
142 #:phases (modify-phases %standard-phases
143 (add-before 'check 'prepare-tests
145 ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
146 ;; and looks for .cache and other directories (only).
147 ;; For simplicity just drop it since it is irrelevant
148 ;; in the build container.
149 (substitute* "Makefile"
150 (("test-runtime\\$\\(EXEEXT\\)") ""))
152 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
153 (synopsis "PKCS#11 library")
155 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
156 provides a standard configuration setup for installing PKCS#11 modules
157 in such a way that they are discoverable. It also solves problems with
158 coordinating the use of PKCS#11 by different components or libraries
159 living in the same process.")
160 (license license:bsd-3)))
162 (define-public gnutls
169 ;; Note: Releases are no longer on ftp.gnu.org since the
170 ;; schism (after version 3.1.5).
171 (string-append "mirror://gnupg/gnutls/v"
172 (version-major+minor version)
173 "/gnutls-" version ".tar.xz"))
174 (patches (search-patches "gnutls-skip-trust-store-test.patch"))
177 "1jqz5s3lv8sa53348cfi9nr5pw5l55n8m40b8msdvv0pb2jzqca3"))))
178 (build-system gnu-build-system)
180 `(; Ensure we don't keep a reference to this buggy software.
181 #:disallowed-references (,net-tools)
184 ;; GnuTLS doesn't consult any environment variables to specify
185 ;; the location of the system-wide trust store. Instead it has a
186 ;; configure-time option. Unless specified, its configure script
187 ;; attempts to auto-detect the location by looking for common
188 ;; places in the file system, none of which are present in our
189 ;; chroot build environment. If not found, then no default trust
190 ;; store is used, so each program has to provide its own
191 ;; fallback, and users have to configure each program
192 ;; independently. This seems suboptimal.
193 "--with-default-trust-store-dir=/etc/ssl/certs"
195 ;; Tell the build system that we want Guile bindings installed to
196 ;; the output instead of Guiles own module directory.
197 (string-append "--with-guile-site-dir="
198 "$(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)")
199 (string-append "--with-guile-site-ccache-dir="
200 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache")
201 (string-append "--with-guile-extension-dir="
202 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/extensions")
204 ;; FIXME: Temporarily disable p11-kit support since it is not
205 ;; working on mips64el.
208 #:phases (modify-phases %standard-phases
211 (lambda* (#:key outputs #:allow-other-keys)
212 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
213 (let* ((out (assoc-ref outputs "out"))
214 (doc (assoc-ref outputs "doc"))
215 (mandir (string-append doc "/share/man/man3"))
216 (oldman (string-append out "/share/man/man3")))
218 (copy-recursively oldman mandir)
219 (delete-file-recursively oldman)
221 (outputs '("out" ;4.4 MiB
223 "doc")) ;4.1 MiB of man pages
225 `(("net-tools" ,net-tools)
226 ("pkg-config" ,pkg-config)
229 `(("guile" ,guile-2.2)))
231 ;; These are all in the 'Requires.private' field of gnutls.pc.
232 `(("libtasn1" ,libtasn1)
236 (home-page "https://www.gnu.org/software/gnutls/")
237 (synopsis "Transport layer security library")
239 "GnuTLS is a secure communications library implementing the SSL, TLS
240 and DTLS protocols. It is provided in the form of a C library to support the
241 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
242 required structures.")
243 (license license:lgpl2.1+)
244 (properties '((ftp-server . "ftp.gnutls.org")
245 (ftp-directory . "/gcrypt/gnutls")))))
247 (define-public gnutls/guile-2.2
248 (deprecated-package "guile2.2-gnutls" gnutls))
250 (define-public gnutls/guile-2.0
251 ;; GnuTLS for Guile 2.0.
254 (name "guile2.0-gnutls")
255 (inputs `(("guile" ,guile-2.0)
256 ,@(alist-delete "guile" (package-inputs gnutls))))))
258 (define-public gnutls/dane
259 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
260 ;; Authentication of Named Entities. This is required for GNS functionality
261 ;; by GNUnet and gnURL. This is done in an extra package definition
262 ;; to have the choice between GnuTLS with Dane and without Dane.
266 (inputs `(("unbound" ,unbound)
267 ,@(package-inputs gnutls)))))
269 (define-public openssl
273 (replacement openssl-1.1.1d)
276 (uri (list (string-append "https://www.openssl.org/source/openssl-"
278 (string-append "ftp://ftp.openssl.org/source/"
279 "openssl-" version ".tar.gz")
280 (string-append "ftp://ftp.openssl.org/source/old/"
281 (string-trim-right version char-set:letter)
282 "/openssl-" version ".tar.gz")))
285 "142c7zdlz06hjrrvinb9f276czc78bnkyhd9xma621qmmmwk1yzn"))
286 (patches (search-patches "openssl-1.1-c-rehash-in.patch"))))
287 (build-system gnu-build-system)
289 "doc" ;6.8 MiB of man3 pages and full HTML documentation
290 "static")) ;6.4 MiB of .a files
291 (native-inputs `(("perl" ,perl)))
293 `(#:disallowed-references (,perl)
298 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
299 ;; so we explicitly disallow it here.
300 #:disallowed-references ,(list (canonical-package perl))
302 (modify-phases %standard-phases
304 (lambda* (#:key outputs #:allow-other-keys)
305 (let* ((out (assoc-ref outputs "out"))
306 (lib (string-append out "/lib")))
307 ;; It's not a shebang so patch-source-shebangs misses it.
308 (substitute* "config"
310 (string-append (assoc-ref %build-inputs "coreutils")
313 "shared" ;build shared libraries
316 ;; The default for this catch-all directory is
317 ;; PREFIX/ssl. Change that to something more
319 (string-append "--openssldir=" out
320 "/share/openssl-" ,version)
322 (string-append "--prefix=" out)
323 (string-append "-Wl,-rpath," lib)))))
324 (add-after 'install 'move-static-libraries
325 (lambda* (#:key outputs #:allow-other-keys)
326 ;; Move static libraries to the "static" output.
327 (let* ((out (assoc-ref outputs "out"))
328 (lib (string-append out "/lib"))
329 (static (assoc-ref outputs "static"))
330 (slib (string-append static "/lib")))
331 (for-each (lambda (file)
332 (install-file file slib)
334 (find-files lib "\\.a$"))
336 (add-after 'install 'move-extra-documentation
337 (lambda* (#:key outputs #:allow-other-keys)
338 ;; Move man3 pages and full HTML documentation to "doc".
339 (let* ((out (assoc-ref outputs "out"))
340 (man3 (string-append out "/share/man/man3"))
341 (html (string-append out "/share/doc/openssl"))
342 (doc (assoc-ref outputs "doc"))
343 (man-target (string-append doc "/share/man/man3"))
344 (html-target (string-append doc "/share/doc/openssl")))
345 (copy-recursively man3 man-target)
346 (delete-file-recursively man3)
347 (copy-recursively html html-target)
348 (delete-file-recursively html)
351 'install 'remove-miscellany
352 (lambda* (#:key outputs #:allow-other-keys)
353 ;; The 'misc' directory contains random undocumented shell and Perl
354 ;; scripts. Remove them to avoid retaining a reference on Perl.
355 (let ((out (assoc-ref outputs "out")))
356 (delete-file-recursively (string-append out "/share/openssl-"
360 (list (search-path-specification
361 (variable "SSL_CERT_DIR")
362 (separator #f) ;single entry
363 (files '("etc/ssl/certs")))
364 (search-path-specification
365 (variable "SSL_CERT_FILE")
367 (separator #f) ;single entry
368 (files '("etc/ssl/certs/ca-certificates.crt")))))
369 (synopsis "SSL/TLS implementation")
371 "OpenSSL is an implementation of SSL/TLS.")
372 (license license:openssl)
373 (home-page "https://www.openssl.org/")))
375 (define openssl-1.1.1d
381 (uri (list (string-append "https://www.openssl.org/source/openssl-"
383 (string-append "ftp://ftp.openssl.org/source/"
384 "openssl-" version ".tar.gz")
385 (string-append "ftp://ftp.openssl.org/source/old/"
386 (string-trim-right version char-set:letter)
387 "/openssl-" version ".tar.gz")))
388 (patches (search-patches "openssl-1.1-c-rehash-in.patch"))
391 "1whinyw402z3b9xlb3qaxv4b9sk4w1bgh9k0y8df1z4x3yy92fhy"))))))
393 (define-public openssl-1.0
400 (uri (list (string-append "https://www.openssl.org/source/openssl-"
402 (string-append "ftp://ftp.openssl.org/source/"
403 "openssl-" version ".tar.gz")
404 (string-append "ftp://ftp.openssl.org/source/old/"
405 (string-trim-right version char-set:letter)
406 "/openssl-" version ".tar.gz")))
409 "15mbmg8hf7s12vr3v2bdc0pi9y4pdbnsxhzk4fyyap42jaa5rgfa"))
410 (patches (search-patches "openssl-runpath.patch"
411 "openssl-c-rehash-in.patch"))))
413 "doc" ;1.5MiB of man3 pages
414 "static")) ;6MiB of .a files
416 (substitute-keyword-arguments (package-arguments openssl)
418 `(modify-phases ,phases
419 (add-before 'patch-source-shebangs 'patch-tests
420 (lambda* (#:key inputs native-inputs #:allow-other-keys)
421 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
422 (substitute* (find-files "test" ".*")
424 (string-append bash "/bin/sh"))
428 (add-before 'configure 'patch-Makefile.org
429 (lambda* (#:key outputs #:allow-other-keys)
430 ;; The default MANDIR is some unusual place. Fix that.
431 (let ((out (assoc-ref outputs "out")))
432 (patch-makefile-SHELL "Makefile.org")
433 (substitute* "Makefile.org"
434 (("^MANDIR[[:blank:]]*=.*$")
435 (string-append "MANDIR = " out "/share/man\n")))
438 ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
439 (lambda* (#:key outputs #:allow-other-keys)
440 (let ((out (assoc-ref outputs "out")))
442 "shared" ;build shared libraries
445 ;; The default for this catch-all directory is
446 ;; PREFIX/ssl. Change that to something more
448 (string-append "--openssldir=" out
449 "/share/openssl-" ,version)
451 (string-append "--prefix=" out)))))
452 (delete 'move-extra-documentation)
453 (add-after 'install 'move-man3-pages
454 (lambda* (#:key outputs #:allow-other-keys)
455 ;; Move section 3 man pages to "doc".
456 (let* ((out (assoc-ref outputs "out"))
457 (man3 (string-append out "/share/man/man3"))
458 (doc (assoc-ref outputs "doc"))
459 (target (string-append doc "/share/man/man3")))
461 (for-each (lambda (file)
463 (string-append target "/"
466 (delete-file-recursively man3)
468 ;; XXX: Duplicate this phase to make sure 'version' evaluates
469 ;; in the current scope and not the inherited one.
470 (replace 'remove-miscellany
471 (lambda* (#:key outputs #:allow-other-keys)
472 ;; The 'misc' directory contains random undocumented shell and Perl
473 ;; scripts. Remove them to avoid retaining a reference on Perl.
474 (let ((out (assoc-ref outputs "out")))
475 (delete-file-recursively (string-append out "/share/openssl-"
479 (define-public libressl
485 (uri (string-append "mirror://openbsd/LibreSSL/"
486 name "-" version ".tar.gz"))
489 "19kxa5i97q7p6rrps9qm0nd8zqhdjvzx02j72400c73cl2nryfhy"))))
490 (build-system gnu-build-system)
492 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
493 ;; and libc would return ENOSYS, which is not properly handled.
494 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
495 '(#:configure-flags '("ac_cv_func_getentropy=no"
496 ;; Provide a TLS-enabled netcat.
499 ;; FIXME: These two variables must designate a single file or directory
500 ;; and are not actually "search paths." In practice it works OK in
501 ;; user profiles because there's always just one item that matches the
503 (list (search-path-specification
504 (variable "SSL_CERT_DIR")
505 (files '("etc/ssl/certs")))
506 (search-path-specification
507 (variable "SSL_CERT_FILE")
508 (files '("etc/ssl/certs/ca-certificates.crt")))))
509 (home-page "https://www.libressl.org/")
510 (synopsis "SSL/TLS implementation")
511 (description "LibreSSL is a version of the TLS/crypto stack, forked from
512 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
513 and applying best practice development processes. This package also includes a
514 netcat implementation that supports TLS.")
515 ;; Files taken from OpenSSL keep their license, others are under various
516 ;; non-copyleft licenses.
517 (license (list license:openssl
518 (license:non-copyleft
520 "See COPYING in the distribution.")))))
522 (define-public python-acme
525 ;; Remember to update the hash of certbot when updating python-acme.
529 (uri (pypi-uri "acme" version))
532 "0p3zqhna9p8iy5i9mfhzdf5bmjigs05r6rlwnxykk4n67fp8yyc8"))))
533 (build-system python-build-system)
536 (modify-phases %standard-phases
537 (add-after 'build 'build-documentation
539 (invoke "make" "-C" "docs" "man" "info")))
540 (add-after 'install 'install-documentation
541 (lambda* (#:key outputs #:allow-other-keys)
542 (let* ((out (assoc-ref outputs "out"))
543 (man (string-append out "/share/man/man1"))
544 (info (string-append out "/info")))
545 (install-file "docs/_build/texinfo/acme-python.info" info)
546 (install-file "docs/_build/man/acme-python.1" man)
548 ;; TODO: Add optional inputs for testing.
550 `(("python-mock" ,python-mock)
551 ("python-pytest" ,python-pytest)
553 ("python-sphinx" ,python-sphinx)
554 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
555 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
556 ("texinfo" ,texinfo)))
558 `(("python-josepy" ,python-josepy)
559 ("python-six" ,python-six)
560 ("python-requests" ,python-requests)
561 ("python-requests-toolbelt" ,python-requests-toolbelt)
562 ("python-pytz" ,python-pytz)
563 ("python-pyrfc3339" ,python-pyrfc3339)
564 ("python-pyasn1" ,python-pyasn1)
565 ("python-cryptography" ,python-cryptography)
566 ("python-pyopenssl" ,python-pyopenssl)))
567 (home-page "https://github.com/certbot/certbot")
568 (synopsis "ACME protocol implementation in Python")
569 (description "ACME protocol implementation in Python")
570 (license license:asl2.0)))
572 (define-public certbot
575 ;; Certbot and python-acme are developed in the same repository, and their
576 ;; versions should remain synchronized.
577 (version (package-version python-acme))
580 (uri (pypi-uri "certbot" version))
583 "1xbfv4fwkgfp9qqzlk8wxbhchc61349m26q9fg35j9fnm253cm74"))))
584 (build-system python-build-system)
586 `(,@(substitute-keyword-arguments (package-arguments python-acme)
588 `(modify-phases ,phases
589 (replace 'install-documentation
590 (lambda* (#:key outputs #:allow-other-keys)
591 (let* ((out (assoc-ref outputs "out"))
592 (man1 (string-append out "/share/man/man1"))
593 (man7 (string-append out "/share/man/man7"))
594 (info (string-append out "/info")))
595 (install-file "docs/_build/texinfo/Certbot.info" info)
596 (install-file "docs/_build/man/certbot.1" man1)
597 (install-file "docs/_build/man/certbot.7" man7)
599 ;; TODO: Add optional inputs for testing.
601 `(("python-mock" ,python-mock)
602 ("python-pytest" ,python-pytest)
604 ("python-sphinx" ,python-sphinx)
605 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
606 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
607 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
608 ("texinfo" ,texinfo)))
610 `(("python-acme" ,python-acme)
611 ("python-cryptography" ,python-cryptography)
612 ("python-zope-interface" ,python-zope-interface)
613 ("python-pyrfc3339" ,python-pyrfc3339)
614 ("python-pyopenssl" ,python-pyopenssl)
615 ("python-configobj" ,python-configobj)
616 ("python-configargparse" ,python-configargparse)
617 ("python-zope-component" ,python-zope-component)
618 ("python-parsedatetime" ,python-parsedatetime)
619 ("python-six" ,python-six)
620 ("python-psutil" ,python-psutil)
621 ("python-requests" ,python-requests)
622 ("python-pytz" ,python-pytz)))
623 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
624 (description "Certbot automatically receives and installs X.509 certificates
625 to enable Transport Layer Security (TLS) on servers. It interoperates with the
626 Let’s Encrypt certificate authority (CA), which issues browser-trusted
627 certificates for free.")
628 (home-page "https://certbot.eff.org/")
629 (license license:asl2.0)))
631 (define-public letsencrypt
632 (package (inherit certbot)
634 (properties `((superseded . ,certbot)))))
636 (define-public perl-net-ssleay
638 (name "perl-net-ssleay")
642 (uri (string-append "mirror://cpan/authors/id/C/CH/CHRISN/"
643 "Net-SSLeay-" version ".tar.gz"))
646 "1pfgh4h3szcpvqlcimc60pjbk9zwls99x5863sva0wc47i4dl010"))))
647 (build-system perl-build-system)
648 (inputs `(("openssl" ,openssl)))
651 (modify-phases %standard-phases
653 'configure 'set-ssl-prefix
654 (lambda* (#:key inputs #:allow-other-keys)
655 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
657 (synopsis "Perl extension for using OpenSSL")
659 "This module offers some high level convenience functions for accessing
660 web pages on SSL servers (for symmetry, the same API is offered for accessing
661 http servers, too), an sslcat() function for writing your own clients, and
662 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
663 servers or clients for more complicated applications.")
664 (license license:perl-license)
665 (home-page "https://metacpan.org/release/Net-SSLeay")))
667 (define-public perl-crypt-openssl-rsa
669 (name "perl-crypt-openssl-rsa")
675 "mirror://cpan/authors/id/T/TO/TODDR/Crypt-OpenSSL-RSA-"
680 "0djl5i6kibl7862b6ih29q8dhg5zpwzq77q9j8hp6xngshx40ws1"))))
681 (build-system perl-build-system)
683 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
685 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
686 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
687 ("openssl" ,openssl)))
688 (arguments perl-crypt-arguments)
690 "https://metacpan.org/release/Crypt-OpenSSL-RSA")
692 "RSA encoding and decoding, using the openSSL libraries")
693 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
694 OpenSSL libraries).")
695 (license license:perl-license)))
697 (define perl-crypt-arguments
698 `(#:phases (modify-phases %standard-phases
699 (add-before 'configure 'patch-Makefile.PL
700 (lambda* (#:key inputs #:allow-other-keys)
701 (substitute* "Makefile.PL"
702 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
703 (assoc-ref inputs "openssl")
704 "/lib -lcrypto'],")))
707 (define-public perl-crypt-openssl-bignum
709 (name "perl-crypt-openssl-bignum")
715 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
720 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
721 (build-system perl-build-system)
722 (inputs `(("openssl" ,openssl)))
723 (arguments perl-crypt-arguments)
725 "https://metacpan.org/release/Crypt-OpenSSL-Bignum")
727 "OpenSSL's multiprecision integer arithmetic in Perl")
728 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
729 arithmetic in Perl.")
730 ;; At your option either gpl1+ or the Artistic License
731 (license license:perl-license)))
733 (define-public perl-crypt-openssl-guess
735 (name "perl-crypt-openssl-guess")
741 "mirror://cpan/authors/id/A/AK/AKIYM/Crypt-OpenSSL-Guess-"
745 "0rvi9l4ljcbhwwvspq019nfq2h2v746dk355h2nwnlmqikiihsxa"))))
746 (build-system perl-build-system)
747 (home-page "https://metacpan.org/release/Crypt-OpenSSL-Guess")
748 (synopsis "Guess the OpenSSL include path")
750 "The Crypt::OpenSSL::Guess Perl module provides helpers to guess the
751 correct OpenSSL include path. It is intended for use in your
752 @file{Makefile.PL}.")
753 (license license:perl-license)))
755 (define-public perl-crypt-openssl-random
757 (name "perl-crypt-openssl-random")
763 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
767 (base32 "1x6ffps8q7mnawmcfq740llzy7i10g3319vap0wiw4d33fm6z1zh"))))
768 (build-system perl-build-system)
770 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
772 `(("openssl" ,openssl)))
773 (arguments perl-crypt-arguments)
775 "https://metacpan.org/release/Crypt-OpenSSL-Random")
777 "OpenSSL/LibreSSL pseudo-random number generator access")
778 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
780 (license license:perl-license)))
782 (define-public acme-client
788 (uri (string-append "https://kristaps.bsd.lv/" name "/"
789 "snapshots/" name "-portable-"
793 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
794 (build-system gnu-build-system)
796 '(#:tests? #f ; no test suite
799 (string-append "PREFIX=" (assoc-ref %outputs "out")))
801 (modify-phases %standard-phases
802 (add-after 'unpack 'patch-paths
803 (lambda* (#:key inputs #:allow-other-keys)
804 (let ((pem (string-append (assoc-ref inputs "libressl")
805 "/etc/ssl/cert.pem")))
806 (substitute* "http.c"
807 (("/etc/ssl/cert.pem") pem))
809 (delete 'configure)))) ; no './configure' script
811 `(("pkg-config" ,pkg-config)))
814 ("libressl" ,libressl)))
815 (synopsis "Let's Encrypt client by the OpenBSD project")
816 (description "acme-client is a Let's Encrypt client implemented in C. It
817 uses a modular design, and attempts to secure itself by dropping privileges and
818 operating in a chroot where possible. acme-client is developed on OpenBSD and
819 then ported to the GNU / Linux environment.")
820 (home-page "https://kristaps.bsd.lv/acme-client/")
821 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
822 ;; and 'jsmn.c' are distributed under the Expat license.
823 (license (list license:isc license:expat))))
825 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
826 ;; variant exists in addition to the "-apache" one.
827 (define-public mbedtls-apache
829 (name "mbedtls-apache")
834 ;; XXX: The download links on the website are script redirection links
835 ;; which effectively lead to the format listed in the uri here.
836 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
837 version "-apache.tgz"))
840 "0qd65lnr63vmx2gxla6lcmm5gawlnaj4wy4h4vmdc3h9h9nyw6zc"))))
841 (build-system cmake-build-system)
844 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON")))
848 (synopsis "Small TLS library")
850 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
851 for developers to include cryptographic and SSL/TLS capabilities in their
852 (embedded) products, facilitating this functionality with a minimal
854 (home-page "https://tls.mbed.org")
855 (license license:asl2.0)))
857 ;; The Hiawatha Web server requires some specific features to be enabled.
858 (define-public mbedtls-for-hiawatha
861 (inherit mbedtls-apache)
863 (substitute-keyword-arguments
865 (modify-phases %standard-phases
866 (add-after 'configure 'configure-extra-features
868 (for-each (lambda (feature)
869 (invoke "scripts/config.pl" "set" feature))
870 (list "MBEDTLS_THREADING_C"
871 "MBEDTLS_THREADING_PTHREAD"))
873 ,@(package-arguments mbedtls-apache)))))))
875 (define-public dehydrated
882 "https://github.com/lukas2511/dehydrated/releases/download/"
883 "v" version "/dehydrated-" version ".tar.gz"))
886 "0dgskgbdd95p13jx6s13p77y15wngb5cm6p4305cf2s54w0bvahh"))))
887 (build-system trivial-build-system)
889 `(#:modules ((guix build utils))
892 (use-modules (guix build utils))
893 (let* ((source (assoc-ref %build-inputs "source"))
894 (tar (assoc-ref %build-inputs "tar"))
895 (gz (assoc-ref %build-inputs "gzip"))
896 (out (assoc-ref %outputs "out"))
897 (bin (string-append out "/bin"))
898 (doc (string-append out "/share/doc/"))
899 (bash (in-vicinity (assoc-ref %build-inputs "bash") "bin")))
901 (setenv "PATH" (string-append gz "/bin"))
902 (invoke (string-append tar "/bin/tar") "xvf" source)
903 (chdir (string-append ,name "-" ,version))
905 (install-file "dehydrated" bin)
906 (install-file "LICENSE" (string-append doc ,name "-" ,version))
907 (with-directory-excursion bin
908 (patch-shebang "dehydrated" (list bash))
910 ;; Do not try to write in the store.
911 (substitute* "dehydrated"
912 (("SCRIPTDIR=\"\\$.*\"") "SCRIPTDIR=~/.dehydrated"))
915 (wrap-program "dehydrated"
918 (string-append dir "/bin"))
920 (assoc-ref %build-inputs input))
931 ("coreutils" ,coreutils)
933 ("diffutils" ,diffutils)
941 (home-page "https://dehydrated.io/")
942 (synopsis "Let's Encrypt/ACME client implemented as a shell script")
943 (description "Dehydrated is a client for signing certificates with an
944 ACME-server (currently only provided by Let's Encrypt) implemented as a
945 relatively simple Bash script.")
946 (license license:expat)))
948 (define-public go-github-com-certifi-gocertifi
949 (let ((commit "d2eda712971317d7dd278bc2a52acda7e945f97e")
952 (name "go-github-com-certifi-gocertifi")
953 (version (git-version "2018.01.18" revision commit))
957 (url "https://github.com/certifi/gocertifi")
959 (file-name (git-file-name name version))
962 "0f3v26xps7gadw4qfmh1kxbpgp0cgqdd61a257xnnvnd7ll6k8dh"))))
963 (build-system go-build-system)
965 '(#:import-path "github.com/certifi/gocertifi"))
966 (synopsis "X.509 TLS root certificate bundle for Go")
967 (description "This package is a Go language X.509 TLS root certificate bundle,
968 derived from Mozilla's collection.")
969 (home-page "https://certifi.io")
970 (license license:mpl2.0))))